546
edits
Epoximator (talk | contribs) |
Epoximator (talk | contribs) No edit summary |
||
Line 1: | Line 1: | ||
'''UDP DEF V0.03 DEV''' | '''UDP DEF V0.03 DEV''' | ||
* chii powr / minichii | |||
* feel free to edit / comment / whatever | |||
* do use discussion | |||
* [[User:Exp|Exp]] will approve / disapprove | |||
* [[User:Epoximator|Epoximator]] will implement | |||
== General == | |||
* All commands except PING requires login, meaning session tag must be set (s=xxxxx). | |||
* Possible return codes for all commands: | |||
:* 600 INTERNAL SERVER ERROR | |||
:* 601 ANIDB OUT OF SERVICE - TRY AGAIN LATER | |||
:* 505 ILLEGAL INPUT OR ACCESS DENIED | |||
:* 598 UNKNOWN COMMAND (sort of) | |||
* Additional return codes for all commands that require login: | |||
:* 501 LOGIN FIRST | |||
:* 506 INVALID SESSION | |||
* General return data: | |||
{three digit return code} {str return string}\n | |||
{data field 0}|{data field 1}|...|{data field n} | |||
* Exceptions are 200,201,271,272,504,? which returns additional data in the first line. | |||
== Data == | == Data == | ||
=== ANIME : new ? high === | === ANIME : new ? high === | ||
Line 23: | Line 38: | ||
* XXX ANIME BEST MATCH | * XXX ANIME BEST MATCH | ||
: {int4 aid}|{int2 type}|{int4 eps}|{int4 ep count}|{int4 special cnt}|{int4 rating}|{int4 votes}|{int4 tmprating}|{int4 tmpvotes}|{int4 review rating average}|{int4 reviews}|{str year}|{str romaji}|{str kanji}|{str english}|{str other}|{str synonyms}|{str short names}{str genre list} | : {int4 aid}|{int2 type}|{int4 eps}|{int4 ep count}|{int4 special cnt}|{int4 rating}|{int4 votes}|{int4 tmprating}|{int4 tmpvotes}|{int4 review rating average}|{int4 reviews}|{str year}|{str romaji}|{str kanji}|{str english}|{str other}|{str synonyms}|{str short names}{str genre list} | ||
''' | '''Examples:''' (html escaped code intended) | ||
> ANIME name=tmm&s=xxxxx | > ANIME name=tmm&s=xxxxx | ||
< 230 ANIME | < 230 ANIME | ||
Line 77: | Line 92: | ||
* Login is required. (?) | * Login is required. (?) | ||
=== | === FILE: extend ? high === | ||
'''Command String:''' | '''Description:'''<br> | ||
Retrieves most available info for a specific file defined by id or size+ed2k (and possibly others). | |||
'''Command String:'''<br> | |||
by fid: | |||
* FILE fid={int4 id}[&code={int4}] | |||
by size+ed2k hash: | |||
* FILE size={int4 size}&ed2k={str ed2khash}[&code={int4}] | |||
by <anime title> <ep#> <groupname> ? <br> | |||
by <aid> <ep#> <groupname> ? <br> | |||
by <aid> <ep#> <gid> ? | |||
'''Possible Replies:''' | '''Possible Replies:''' | ||
* XXX FILE | |||
: {int4 fid}|{int4 aid}|{int4 eid}|{int4 gid}|{int4 lid}|{int4 state}|{int4 size}|{str ed2k}|{int2 type}{str animetitle}|{str eptitle}{str groupname} | |||
:* XXX NO SUCH FILE | * XXX FILE | ||
: {int4 fid}|{int4 aid}|{int4 eid}|{int4 gid}|{int4 lid}|...(data list) | |||
* XXX NO SUCH FILE | |||
'''Info:''' | '''Info:''' | ||
* See FILE | |||
: | * by crc for @find command | ||
: | * code is an integer where each bit corresponds to a data field related to the specified file (se below). The data list received is sorted in the same order as the table. code=-1 means retrieve all fields. | ||
: | |||
'''Code:''' | |||
{| cellpadding="0" align="center" | |||
! width="40"|Bit | |||
! width="80"|Decimal | |||
! width="140"|Data field | |||
! width="50"|- | |||
! width="40"|Bit | |||
! width="80"|Decimal | |||
! width="140"|Data field | |||
|- style="background-color: #eee;" | |||
|0 ||1 || int2 state || || 16 || 65536 || str epno | |||
|- | |||
|1 ||2 || int4 size || || 17 || 131072 || str ep name | |||
|- style="background-color: #eee;" | |||
|2 ||4 || str ed2k || || 18 || 262144 || str ep japname | |||
|- | |||
|3 ||8 || str md5 || || 19 || 524288 || not ep kanjiname | |||
|- style="background-color: #eee;" | |||
|4 ||16 || str sha1 || || 20 || 1048576 || int2 episodes | |||
|- | |||
|5 ||32 || str crc || || 21 || 2097152 || int2 ep count | |||
|- style="background-color: #eee;" | |||
|6 ||64 || str dub || || 22 || 4194304 || str year | |||
|- | |||
|7 ||128 || str sub || || 23 || 8388608 || str anime type | |||
|- style="background-color: #eee;" | |||
|8 ||256 || str quality || || 24 || 16777216 || str title romaji | |||
|- | |||
|9 ||512 || str source || || 25 || 33554432 || str title kanji | |||
|- style="background-color: #eee;" | |||
|10 ||1024 || str audio info || || 26 || 67108864 || str title english | |||
|- | |||
|11 ||2048 || str video info || || 27 || 134217728 || str title other | |||
|- style="background-color: #eee;" | |||
|12 ||4096 || str video resolution || || 28 || 268435456 || str synonyms | |||
|- | |||
|13 ||8192 || str file type || || 29 || 536870912 || str short names | |||
|- style="background-color: #eee;" | |||
|14 ||16384 || str group name || || 30 || 1073741824 || str genre list | |||
|- | |||
|15 ||32768 || str group short name || || 31 || -2147483648 || not used | |||
|} | |||
'''Examples:''' | |||
<pre> | |||
> FILE fid=15201 | |||
< 220 FILE | |||
15201|74|445|41|1|242772540|a53c401ed95eaa502ba85acde773040c|Ai yori Aoshi - 1 - Relation - [Zhentarim DivX].ogm | |||
> FILE fid=15201&data=-1 | |||
< 220 FILE | |||
15201|74|445|41|1|242772540|a53c401ed95eaa502ba85acde773040c|a69c9ca88822338685f163db95da8231|842fc9060b4338757d0197a9f7bf0c79cf39a549|01ffc5f4|842fc9060b4338757d0197a9f7bf0c79cf39a549|dual (jap/eng)|english|very high|DVD|Ogg Vorbis|101|DivX5|1182|640x480|ogm|Zhentarim DivX|zx|24|24|2002|TV|Ai yori Aoshi|藍より青し|Bluer than Indigo|Azul||aya1§AYA§AiAo| | |||
== | > FILE fid=83532&data=17006624 | ||
< 220 FILE | |||
83532|896|26316|374|e1980142|KAA|S3|Ayu Mayu Theater 03|Kimi ga Nozomu Eien | |||
</pre> | |||
'''Comments:'''<br> | |||
Pass a list of fields (limit e.g. 10 entries) | Pass a list of fields (limit e.g. 10 entries) | ||
and return content. This makes it possible to request new fields in the database without | and return content. This makes it possible to request new fields in the database without | ||
breaking API for older clients. | breaking API for older clients. | ||
On updates, only the list of possible fields | On updates, only the list of possible fields | ||
need to be extendet. | need to be extendet. -- --[[User:Dinoex|Dinoex]] | ||
: I think it's a good idea. Modified a bit. --[[User:Epoximator|Epoximator]] 13:38, 26 November 2005 (CET) | |||
: | |||
=== A4G : new ? questionable === | === A4G : new ? questionable === | ||
Line 223: | Line 289: | ||
<pre> | <pre> | ||
C | /* | ||
C | * POSITVE 2XX | ||
C | */ | ||
LOGIN_ACCEPTED =200, //C | |||
C | LOGIN_ACCEPTED_NEW_VER =201, //C | ||
C | LOGGED_OUT =203, //C | ||
C | |||
C | MYLIST_ENTRY_ADDED =210, //C | ||
N | ENTRY_DELETED =211, //C | ||
N | |||
FILE =220, //C | |||
MYLIST =221, //C | |||
ANIME =230, //N | |||
ANIME_BEST_MATCH =231, //N | |||
EPISODE =240, //N | |||
GROUP =250, //N | |||
VOTED =260, //N | |||
VOTE_FOUND =261, //N | |||
VOTE_UPDATED =262, //N | |||
VOTE_REVOKED =263, //N | |||
NOTIFICATION_ENABLED =270, //C | |||
PUSHACK_CONFIRMED =280, //C | |||
NOTIFYACK_SUCCESSFUL_M =281, //C | |||
NOTIFYACK_SUCCESSFUL_N =282, //C | |||
NOTIFICATION =290, //C | |||
NOTIFYLIST =291, //C | |||
NOTIFYGET_MESSAGE =292, //C | |||
NOTIFYGET_NOTIFY =293, //C | |||
SENDMSG_SUCCESSFUL =294, //C | |||
/* | |||
* AFFIRMATIVE/NEGATIVE 3XX | |||
*/ | |||
PONG =300, //C | |||
FILE_ALREADY_IN_MYLIST =310, //C | |||
MYLIST_ENTRY_EDITED =311, //C | |||
NO_SUCH_FILE =320, //C | |||
NO_SUCH_ENTRY =321, //C | |||
NO_SUCH_ANIME =330, //N | |||
NO_SUCH_EPISODE =340, //N | |||
NO_SUCH_GROUP =350, //N | |||
NO_SUCH_VOTE =360, //N | |||
INVALID_VOTE_TYPE =361, //N | |||
INVALID_VOTE_VALUE =362, //N | |||
PERMVOTE_NOT_ALLOWED =363, //N | |||
NOTIFICATION_DISABLED =370, //C | |||
NO_SUCH_PACKET_PENDING =380, //C | |||
NO_SUCH_ENTRY_M =381, //C | |||
NO_SUCH_ENTRY_N =382, //C | |||
NO_SUCH_MESSAGE =392, //C | |||
NO_SUCH_NOTIFY =393, //C | |||
NO_SUCH_USER =394, //C | |||
NO_SUCH_DATA_ENTRY =396, //N | |||
/* | |||
* NEGATIVE 4XX | |||
*/ | |||
C | NOT_LOGGED_IN =403, //C | ||
C | NO_SUCH_MYLIST_FILE =410, //C | ||
C | NO_SUCH_MYLIST_ENTRY =411, //C | ||
/* | |||
* CLIENT SIDE FAILURE 5XX | |||
*/ | |||
C | LOGIN_FAILED =500, //C | ||
C | LOGIN_FIRST =501, //C | ||
C | ACCESS_DENIED =502, //C | ||
CLIENT_VERSION_OUTDATED =503, //C | |||
CLIENT_BANNED =504, //C | |||
ILLEGAL_INPUT_OR_ACCESS_DENIED =505, //C | |||
INVALID_SESSION =506, //C | |||
BANNED_FOR_FLOODING =507, //C | |||
UNKNOWN_COMMAND =598, //C | |||
/* | |||
* SERVER SIDE FAILURE 6XX | |||
*/ | |||
C | INTERNAL_SERVER_ERROR =600, //C | ||
C | ANIDB_OUT_OF_SERVICE =601, //C | ||
API_VIOLATION =666, //C | |||
</pre> | </pre> |
edits