UDP API Clients

Want to help out? Need help accessing the AniDB API? This is the place to ask questions.

Moderator: AniDB

Posts: 11
Joined: Tue Feb 22, 2005 6:31 am

Post by WoLpH »

If you just use the plain SQL commands then they shouldn't have a problem exchanging data.
As for the connector, maybe an external module that connects or something, haven't decided it yet.
Posts: 43
Joined: Wed Jul 14, 2004 8:03 am

Post by phip »

OKAY. I'm in, too.

Title: CocoaAOM (Super tentative working title, with apologies to PetriW)
OS: Mac OS X
Lang: Objective-C

Details: Notify and message observing. File hashing, identification, renaming, addition to mylist.

A mockup is available here
Posts: 1
Joined: Fri Mar 11, 2005 7:43 am

Post by Fatalis »

PetriW wrote:Check out sqlite (www.sqlite.org) for storing local data. Way better than flatfile imho.

That's what I'd use.
AniDB Staff
Posts: 1522
Joined: Sat May 24, 2003 2:34 pm

Post by PetriW »

That doesn't work well for very large amounts of data.
AniDB Staff
Posts: 379
Joined: Sun Nov 07, 2004 11:05 am

Post by epoximator »

ame v0.1 (beta) Simple Hasher | Mylist-File-Add Util written in C++

- commandline based
- ed2k hashing
- file add to mylist
- platform independent code, but only win build for now
Posts: 13
Joined: Thu Apr 07, 2005 5:56 pm

Post by elfish »

'ggkgpljigdff', to be named if/when it gets to the 'dogfood' stage, Java, platform-independent, GPLv2.

Command-line renamer, similar in concept to goodsnes, etc.

PM me with complaints.

(the clientid is a MAC address, the numbers converted into letters).
Posts: 6
Joined: Sat Apr 30, 2005 4:26 am

Re: UDP API Clients

Post by W1N9Zr0 »

Target OS: win32
Programming language: mIRC script
Using client name "testproto" since the time I was poking around the api first, doesn't let me change it to anything, weird...
The release name would probably be "mIRCaDBcSc"
for "mIRC AniDB Client Script"
I am reached by email in the profile or on the deltaanime/quakenet irc networks, same name.

Now working:
Log on, log off, PUSH, PUSHACK.
Displays *NEW MSG* / *NEW FILE*, beeps, flashes on the events.
The 30 min keepalive with NOTIFY.
Auto relog on disconnected.
All using the edit box commands for now.

To do list:
Window for login/pass, settings, etc.
Local notify list, available on command/window.
Get messages, file notifies from the list on command/window.
ed2k hashing dll for mIRC (tough one, we'll see)
If previous, then adding (freshly acquired) files.

Think that's about it for now.
Site Admin
Posts: 2438
Joined: Tue Oct 01, 2002 9:42 pm
Location: Nowhere

Post by exp »

remember that the client name needs to be all lowercase!

Posts: 13
Joined: Tue May 10, 2005 11:58 am

Post by ExElNeT »


anidb commandline client written in java for all those who love shells ;)

- hashing (all types)
- renaming (100% customable with more than just the api infos)
- mylist adding
- add files and dirs various wildcards are allowed
- moving hashed, checked and mylistadded files in their own animename dirs
- remove illegal strings from filenames (100% customable)

those things will be finished in a few days ... (started yesterday hehe)

if you have any ideas send a pm

if i am allowed i would add the source to the bin under gpl

have fun!
Site Admin
Posts: 2438
Joined: Tue Oct 01, 2002 9:42 pm
Location: Nowhere

Post by exp »

ExElNeT wrote:if i am allowed i would add the source to the bin under gpl
as the AniDB UDP API is public, there's nothing which would prevent you from releasing the source under gpl.

Posts: 13
Joined: Tue May 10, 2005 11:58 am

Post by ExElNeT »

there is one thing i dont understand about the udp api ...

why does the api send the sessionid inside of an errormessage?

Code: Select all

200 {str session_key} LOGIN ACCEPTED
in FILE does the api send the message after a \n

Code: Select all

 220 FILE
{int4 fid}|{int4 aid}|{int4 eid}|{int4 gid}|{int4 state}|{int4 size}|{str ed2k}|{str anidbfilename}
that just doesnt fit and is inconsequent ;/

and it would be nice if FILE would send all infos about the file ... ;)

everything else is just fine thanks exp ;)

AniDB Staff
Posts: 1522
Joined: Sat May 24, 2003 2:34 pm

Post by PetriW »

Please note 200 to 299 codes are _not_ error messages, they are success messages.

200-299: Request accepted
300-399: Not found but not an error
400-499: Not found, this is an error
500-599: Server error replies
601: API down

Anyway, the 200 message was probably never multiline and I' guess that when an extra field was needed it was added to the reply message instead to not break earlier clients. (Eventhough there probably were none then! :P)
Or the thinking comes from the TCP API where all non multiline replies are returned with eventual additional data on the same row as the message. The UDP api kinda inheririts from the TCP api I think and while almost all UDP api commands are twoline (aka, status + reply line) in the TCP api all those replies are "unknownlines", aka (startcode + lines with data + endcode).

/me goes to hide under his rock again. :oops:
Posts: 13
Joined: Tue May 10, 2005 11:58 am

AniDBCmdC first version. 1.0 beta

Post by ExElNeT »

So thats the first version of my java commandline client. 1.0 beta


I hope everything will work ... Its really late :P

some basic features are:
- hashing files
- checking them at anidb
- getting more informations about a file than the api provides
- adding the file to mylist
- renaming the file 100% customable

something i really like ;)
- filenames can contain wildcards
- filenames can even contain regular expressions

here is a small example for regexes:
anidbcmdc.jar -Rx -l=name -p=pass /path/.*\.avi|.*\.ogm|.*\.mpg

for windows users:
anidbcmdc.jar -Rx -l=name -p=pass c:\anime\.*\.avi|.*\.ogm|.*\.mpg

this will hash all files with the endings .avi ogm and .mpg in all subdirs of /path and add them to your mylist

additional features are planed ... like moving finished files creating for each anime his own dir under a given dir and so on ...

here is the output of anidbcmdc.jar --help

Code: Select all

Usage: anidbcmdc.jar [OPTION]... login=LOGIN pass=PASSWORD DIRECTORY
  or:  anidbcmdc.jar [OPTION]... login=LOGIN pass=PASSWORD --files=DIRECTORY_LIST
  or:  anidbcmdc.jar [OPTION]... login=LOGIN pass=PASSWORD --recursive-files=DIRECTORY_LIST
Hash files in DIRECTORY(s), add them to AniDB - MyList and rename them.

Mandatory arguments to long options are mandatory for short options too.
  -f, --files=DIRECTORY_LIST              processes files in the listed DIRECTORY(s)
  -g  --gui                               will start the gui-mode (no gui available yet)
  -h, --help                              print this help
  -i, --ip-address=IP-ADDRESS:PORT        specify the IP-ADDRESS and PORT of AniDB
  -l, --login=LOGINNAME                   specifiy AniDB LOGINNAME
  -p, --password=PASSWORD                 specifiy AniDB PASSWORD
  -c  --clientport=PORT                   the localport on which anidbcmdc is working
  -r, --recursive-files=DIRECTORY_LIST    processes files recursive in the listed DIRECTORY(s) (incl subdirs)
  -n  --name-replace=REPLACE_LIST         replaces SOURCE string with DEST string of the anime filename
  -R                                      processes files recursive in DIRECTORY(s) (incl subdirs)
                                            syntax: SOURCE->DEST,SOURCE->DEST,...
  -s, --style=STYLE                       renames files after STYLE
                                            available templates: %animenamepart1,%animenamepart2,
  -x                                      enables regular expressions in filenames
                                            example: anidbcmdc.jar -R -l=name -p=pass 
                                                     '/path/.*\.avi|.*\.ogm|.*\.mpg' will add all
                                                     .avi,.ogm,.mpg files in all subdirs of /path
                                            more information: http://java.sun.com/j2se/1.4.2/docs/
                                            NOTE: Wildcards '*' and '?' are always enabled.

AniDBCmdC will use the default localport 44444 and the anidb ip-address api.anidb.info:9000
AniDBCmdC will use the default style: %animenamepart1_%animenamepart2_-_%epnr_-_%epnamepart1_

Report bugs to <exelnet@web.de>.
I have included all docs and sources in the jar.

Have fun!
Posts: 199
Joined: Wed Apr 06, 2005 8:42 pm
Location: Sweden / Västrås

Post by ricce »

Code: Select all

Exception in thread "main" java.lang.NoSuchMethodError: java.lang.String.replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String;
        at anidbcmdc.impl.AniDBUdpApiConnection.evaluateReplyMessage(AniDBUdpApiConnection.java:138)
        at anidbcmdc.impl.AniDBUdpApiConnection.auth(AniDBUdpApiConnection.java:161)
        at anidbcmdc.ui.Console.start(Console.java:118)
        at anidbcmdc.ui.AniDBCmdC.parseOptions(AniDBCmdC.java:162)
        at anidbcmdc.ui.AniDBCmdC.main(AniDBCmdC.java:56)

Dosn't seem to work
my WM is:

Code: Select all

java version "1.4.2-01"
Java(TM) 2 Runtime Environment, Standard Edition (build Blackdown-1.4.2-01)
Java HotSpot(TM) 64-Bit Server VM (build Blackdown-1.4.2-01, mixed mode)

Your code only works in a 1.5 WM - but some folks (like me) still use 1.4 WM.

You can't use String.replace(CharSecunece, CharSequence) use String.replaceAll(String, String) and escepe the regex.

You can't use String.contains(CharSequnece) use String.indexOf(String) != -1
Posts: 13
Joined: Tue May 10, 2005 11:58 am

Post by ExElNeT »

Ok I changed those String problems. You should be able to use the program now. If you find any more bugs or have some ideas for features just pm me.

- made it compatible with 1.4.3
- disabled wildcards ... they will only cause problems use regexes instead
* is .* and ? is .

have fun