IrateDev.NewIrateProtocol History
Hide minor edits - Show changes to output
Changed lines 3-106 from:
Client : GET http://irate.server.org/?u=myuser&p=mypass
"u=myuser&p=mypass" : The client connects with login/pass : myuser/mypass . If the user "myuser" doesn't exists, it'll be automatically created with the given password.
After the first login, the client will only send a hash of this password to the server.
! Computing the hash
SHA1("irate".$password)
! Asking for new tracks
Client : GET http://../?u=myuser&h=HASH&do=getnew&n=5
"do=getnew&n=5" : The client asks for 5 new tracks.
Server reply :
(HTTP Headers) \\
\\
<tracks> \\
<track> \\
<id>XXXX</id> \\
<artistname>XXXX</artistname> \\
<albumname>XXXX</albumname> \\
<distribution> \\
<id>SHA1</id> \\
<codec>VORBIS</codec> \\
<averagebitrate>128</averagebitrate> \\
<crediturl>http://www.magnatune.com/artists/XXXX</crediturl> \\
<source> \\
<protocol>http</protocol> \\
<link>http://../XXX.mp3</link> \\
</source> \\
<source> \\
... \\
</source> \\
</distribution> \\
<distribution> \\
... \\
</distribution> \\
</track> \\
\\
<track> \\
... \\
</track> \\
\\
... 3 more times .... \\
</tracks>
! Fields for a track
* id : string, 6digit - 8digit - 2digit mod 97
* artistname : string
* albumname : string
* trackname : string
* duration : int (length in seconds)
* source : string (url), see behind for attributes
* crediturl : string
! Fields for a distribution
* crediturl : string
* codec : string (http://www.matroska.org/technical/specs/codecid/)
* averagebitrate : int (indicative)
! Fields for a source
* protocol : string (eg. "http" or "bittorrent" or whatever)
* link : string
* crediturl : string
! Rating tracks
Client : GET http://../?u=myuser&h=HASH&do=rate&rate=99:6,33:9
"do=rate&t=99:6,33:9" : Rate the tracks 99 and 33 to 6/10 and 9/10
! Getting all the ratings back to the client
Client : GET http://../&u=myuser&h=HASH&do=getratings
"do=getratings" : the client asks for its previous ratings
Server replu : \\
(HTTP Headers) \\
\\
<ratings>55:6,43:3</ratings>
The client had previously done 2 ratings : it rated the track with ID 55 to 6/10, and the track 43 to 3/10
! Errors
The server returns an error like this :
Server reply : \\
<error>ERROR_CODE</error>
The error codes can be :
* WRONG_PASSWORD : The password doesn't match for the user.
* MUST_LOGIN : The username or the password wasn't given
to:
see XmlRpc.
Changed line 21 from:
Server reply : \\
to:
Server reply :
Changed line 29 from:
<distribution>
to:
<distribution> \\
Changed line 78 from:
Client : GET http://../?u=myuser&h=HASH&do=rate&t=99:6,33:9
to:
Client : GET http://../?u=myuser&h=HASH&do=rate&rate=99:6,33:9
Changed lines 22-46 from:
\\
<tracks> \\
<
<
<
<
<
<
<distribution> \\
... \\
\\
<track> \\
... \\
\\
... 3 more times .... \\
to:
(HTTP Headers) \\
\\
<tracks> \\
<track> \\
<id>XXXX</id> \\
<artistname>XXXX</artistname> \\
<albumname>XXXX</albumname> \\
<distribution>
<id>SHA1</id> \\
<codec>VORBIS</codec> \\
<averagebitrate>128</averagebitrate> \\
<crediturl>http://www.magnatune.com/artists/XXXX</crediturl> \\
<source> \\
<protocol>http</protocol> \\
<link>http://../XXX.mp3</link> \\
</source> \\
<source> \\
... \\
</source> \\
</distribution> \\
<distribution> \\
... \\
</distribution> \\
</track> \\
\\
<track> \\
... \\
</track> \\
\\
... 3 more times .... \\
\\
<tracks> \\
<track> \\
<id>XXXX</id> \\
<artistname>XXXX</artistname> \\
<albumname>XXXX</albumname> \\
<distribution>
<id>SHA1</id> \\
<codec>VORBIS</codec> \\
<averagebitrate>128</averagebitrate> \\
<crediturl>http://www.magnatune.com/artists/XXXX</crediturl> \\
<source> \\
<protocol>http</protocol> \\
<link>http://../XXX.mp3</link> \\
</source> \\
<source> \\
... \\
</source> \\
</distribution> \\
<distribution> \\
... \\
</distribution> \\
</track> \\
\\
<track> \\
... \\
</track> \\
\\
... 3 more times .... \\
Added line 62:
* crediturl : string
Changed lines 73-74 from:
to:
* link : string
* crediturl : string
* crediturl : string
Changed lines 24-25 from:
<Track>
to:
<tracks> \\
<track> \\
<track> \\
Changed lines 29-31 from:
<source protocol="http" crediturl="http://www.magnatune.com/artists/XXXX">http://../XXX.mp3</source> \\
<source ...>...</source> \\
</Track>
<
to:
<distribution>
<id>SHA1</id> \\
<codec>VORBIS</codec> \\
<averagebitrate>128</averagebitrate> \\
<crediturl>http://www.magnatune.com/artists/XXXX</crediturl> \\
<source protocol="http">http://../XXX.mp3</source> \\
<source ...>...</source> \\
</distribution> \\
<distribution> \\
... \\
</distribution> \\
</track> \\
<id>SHA1</id> \\
<codec>VORBIS</codec> \\
<averagebitrate>128</averagebitrate> \\
<crediturl>http://www.magnatune.com/artists/XXXX</crediturl> \\
<source protocol="http">http://../XXX.mp3</source> \\
<source ...>...</source> \\
</distribution> \\
<distribution> \\
... \\
</distribution> \\
</track> \\
Changed lines 42-46 from:
<Track>
<id>YYYYY</id> \\
<artistname>YYYYY</artistname> \\
... \\
</Track>
</
to:
<track> \\
... \\
</track> \\
... \\
</track> \\
Changed lines 46-47 from:
... 3 more times ....
to:
... 3 more times .... \\
</tracks>
</tracks>
Changed line 51 from:
* id : string, server-dependant (todo: global IDs ?)
to:
* id : string, 6digit - 8digit - 2digit mod 97
Changed lines 58-64 from:
! Attributes for a source
to:
! Fields for a distribution
* crediturl : string
* codec : string (http://www.matroska.org/technical/specs/codecid/)
* averagebitrate : int (indicative)
! Fields for a source
* crediturl : string
* codec : string (http://www.matroska.org/technical/specs/codecid/)
* averagebitrate : int (indicative)
! Fields for a source
Deleted line 66:
Changed line 71 from:
Client : GET http://../?u=myuser&p=mypass&do=rate&t=99:6,33:9
to:
Client : GET http://../?u=myuser&h=HASH&do=rate&t=99:6,33:9
Changed line 78 from:
Client : GET http://../&u=myuser&p=mypass&do=getratings
to:
Client : GET http://../&u=myuser&h=HASH&do=getratings
Changed line 85 from:
<Ratings>55:6,43:3</Ratings>
to:
<ratings>55:6,43:3</ratings>
Changed line 95 from:
<Error>ERROR_CODE</Error>
to:
<error>ERROR_CODE</error>
Changed line 58 from:
Client : GET http://../?u=myuser&p=mypass&do=rate&t=99&r=6
to:
Client : GET http://../?u=myuser&p=mypass&do=rate&t=99:6,33:9
Changed lines 60-66 from:
"do=rate&t=99&r=6" : Rate the track with id "99" with 6/10
Server reply : \\
(HTTP Headers) \\
\\
rate \\
OK \\
Server reply : \\
(HTTP Headers) \\
\\
rate \\
OK \\
to:
"do=rate&t=99:6,33:9" : Rate the tracks 99 and 33 to 6/10 and 9/10
Changed lines 72-73 from:
55:6,43:
to:
<Ratings>55:6,43:3</Ratings>
Changed lines 82-85 from:
\\
error \\
ERROR_CODE
to:
<Error>ERROR_CODE</Error>
Added lines 9-13:
After the first login, the client will only send a hash of this password to the server.
! Computing the hash
SHA1("irate".$password)
! Computing the hash
SHA1("irate".$password)
Changed line 17 from:
Client : GET http://../?u=myuser&p=mypass&do=getnew&n=5
to:
Client : GET http://../?u=myuser&h=HASH&do=getnew&n=5
Changed lines 24-31 from:
id
artistname
albumname
id:YYYYY \\
artistname:YYYYY \\
albumname
to:
<Track>
<id>XXXX</id> \\
<artistname>XXXX</artistname> \\
<albumname>XXXX</albumname> \\
<source protocol="http" crediturl="http://www.magnatune.com/artists/XXXX">http://../XXX.mp3</source> \\
<source ...>...</source> \\
</Track>
\\
<Track>
<id>YYYYY</id> \\
<artistname>YYYYY</artistname> \\
... \\
</Track>
<id>XXXX</id> \\
<artistname>XXXX</artistname> \\
<albumname>XXXX</albumname> \\
<source protocol="http" crediturl="http://www.magnatune.com/artists/XXXX">http://../XXX.mp3</source> \\
<source ...>...</source> \\
</Track>
\\
<Track>
<id>YYYYY</id> \\
<artistname>YYYYY</artistname> \\
... \\
</Track>
Added lines 41-54:
! Fields for a track
* id : string, server-dependant (todo: global IDs ?)
* artistname : string
* albumname : string
* trackname : string
* duration : int (length in seconds)
* source : string (url), see behind for attributes
! Attributes for a source
* protocol : string (eg. "http" or "bittorrent" or whatever)
* crediturl : string
* id : string, server-dependant (todo: global IDs ?)
* artistname : string
* albumname : string
* trackname : string
* duration : int (length in seconds)
* source : string (url), see behind for attributes
! Attributes for a source
* protocol : string (eg. "http" or "bittorrent" or whatever)
* crediturl : string
Added lines 44-59:
! Getting all the ratings back to the client
Client : GET http://../&u=myuser&p=mypass&do=getratings
"do=getratings" : the client asks for its previous ratings
Server replu : \\
(HTTP Headers) \\
\\
getratings \\
55:6,43:3
The client had previously done 2 ratings : it rated the track with ID 55 to 6/10, and the track 43 to 3/10
Added line 20:
id:XXXX \\
Added line 24:
id:YYYYY \\
Added line 32:
! Rating tracks
Added line 34:
Client : GET http://../?u=myuser&p=mypass&do=rate&t=99&r=6
Added lines 36-56:
"do=rate&t=99&r=6" : Rate the track with id "99" with 6/10
Server reply : \\
(HTTP Headers) \\
\\
rate \\
OK \\
! Errors
The server returns an error like this :
Server reply : \\
(HTTP Headers) \\
\\
error \\
ERROR_CODE
The error codes can be :
* WRONG_PASSWORD : The password doesn't match for the user.
* MUST_LOGIN : The username or the password wasn't given
Server reply : \\
(HTTP Headers) \\
\\
rate \\
OK \\
! Errors
The server returns an error like this :
Server reply : \\
(HTTP Headers) \\
\\
error \\
ERROR_CODE
The error codes can be :
* WRONG_PASSWORD : The password doesn't match for the user.
* MUST_LOGIN : The username or the password wasn't given
Changed lines 1-31 from:
to:
!! Draft of the new HTTP iRATE protocol
! Logging in
Client : GET http://irate.server.org/?u=myuser&p=mypass
"u=myuser&p=mypass" : The client connects with login/pass : myuser/mypass . If the user "myuser" doesn't exists, it'll be automatically created with the given password.
! Asking for new tracks
Client : GET http://../?u=myuser&p=mypass&do=getnew&n=5
"do=getnew&n=5" : The client asks for 5 new tracks.
Server reply : \\
(HTTP Headers) \\
getnew \\
artistname:XXXX \\
albumname:XXXX \\
artistname:YYYYY \\
albumname:YYYYYY \\
... 3 more times ....
! Logging in
Client : GET http://irate.server.org/?u=myuser&p=mypass
"u=myuser&p=mypass" : The client connects with login/pass : myuser/mypass . If the user "myuser" doesn't exists, it'll be automatically created with the given password.
! Asking for new tracks
Client : GET http://../?u=myuser&p=mypass&do=getnew&n=5
"do=getnew&n=5" : The client asks for 5 new tracks.
Server reply : \\
(HTTP Headers) \\
getnew \\
artistname:XXXX \\
albumname:XXXX \\
artistname:YYYYY \\
albumname:YYYYYY \\
... 3 more times ....
Page last modified on January 18, 2005, at 06:51 AM