Author Topic: AniDB  (Read 12187 times)

Offline jonnyboy

  • Epic Indexer
  • *****
  • Posts: 1046
  • Helpful: +93/-1
  • Lazzy Trucker
    • nZEDb
AniDB
« on: 2013-11-06, 03:58:10 PM »
AniDB postprocessing has been updated and fixed, hopefully, by egandt. I am permabanned from anidb.net so I am unable to test it and don't know if it works.

Feedback would be great.

Offline junkman690

  • Decent Indexer
  • ***
  • Posts: 60
  • Helpful: +4/-0
    • ubernzb
Re: AniDB
« Reply #1 on: 2013-11-10, 02:58:32 AM »
I am willing to test, but am unsure of how its pulling in data.... Do I need a dev api key (get off them from there IRC) or is the API the user code, or does the script load the daily db dump from the Anime DB?

Offline jonnyboy

  • Epic Indexer
  • *****
  • Posts: 1046
  • Helpful: +93/-1
  • Lazzy Trucker
    • nZEDb
Re: AniDB
« Reply #2 on: 2013-11-10, 02:30:01 PM »
How it works? I don't know, i haven't taken the time to read it over. Yes, you do need an api key to download from anidb.net, but not for the rest of the script. I do not know where to get one. I assume you get it at anidb.net, but I can't connect to find out.

Offline junkman690

  • Decent Indexer
  • ***
  • Posts: 60
  • Helpful: +4/-0
    • ubernzb
Re: AniDB
« Reply #3 on: 2013-11-10, 07:44:46 PM »
From what I could tell, I need to go on their IRC for a API key (which I will do later tonight). I noticed there was a error when merging  misc/testing/DB_scripts/populate_anidb.cron. The current one in git references /nZEDb/misc/testing/DB_scripts/populate_anidb_with_proxy.php which doesn't exist. There was another version which called populate_anidb.php directly. I think it needs reverting back to the other, but I should be able to test just the populate_anidb.php once I find a API key.

Offline junkman690

  • Decent Indexer
  • ***
  • Posts: 60
  • Helpful: +4/-0
    • ubernzb
Re: AniDB
« Reply #4 on: 2013-11-11, 12:00:38 AM »
The API key is the user id. The script seemed to work then I keep getting

Code: [Select]
http://api.anidb.net:9001/httpapi?request=anime&client=upxxxxxx&clientver=1&protover=1&aid=10244
Response: '<error>Client Values Missing or Invalid</error>'
PHP Notice:  Undefined offset: 0 in /var/www/nZEDb/misc/testing/DB_scripts/populate_anidb.php on line 382
PHP Notice:  Undefined offset: 0 in /var/www/nZEDb/misc/testing/DB_scripts/populate_anidb.php on line 384
PHP Notice:  Undefined offset: 0 in /var/www/nZEDb/misc/testing/DB_scripts/populate_anidb.php on line 386

Guessing its due to a show with no eps....

Code: [Select]
// if there are no episodes defined this can throw an error we should catch and handle this, but currently we do not
« Last Edit: 2013-11-24, 10:43:47 PM by junkman690 »

Offline sniffer

  • Junior Indexer
  • **
  • Posts: 7
  • Helpful: +3/-0
Re: AniDB
« Reply #5 on: 2013-11-24, 12:46:45 PM »
it simple login by anidb.net
goto your profile

goto Account there you can type your own api key

Offline egandt

  • Decent Indexer
  • ***
  • Posts: 62
  • Helpful: +8/-0
Re: AniDB
« Reply #6 on: 2013-11-24, 01:15:10 PM »
Sorry was out of town for 2 weeks, here is how it works.

To use AniDB it is required that you have a developer ID which is gotten from the Wiki, however as currently we are using the HTTP API it only allows limited access so more than a few access attempts at a time result in bans.  For instance the code currently is designed with random waits and random counts so as to reduce this possibility, however even then it can can result in limited bans.  I'm looking into using the UDP API to perform the same actions as this works much better (individual accounts), but so far it appears I may need  a Java helper for this to work (I have gotten that to work), since doing in pure PHP is looking to be something of an issue.

In the mean time if you do not wish to get a developer account or even if you do then per-populating anidb will help alleviate bans, I have made the DB and covers for a full export (as of 4PM EST 11/23) available on dropbox using the URLs below.

The DB https://dl.dropboxusercontent.com/u/106119348/anidb.sql 9Megs
The Covers https://dl.dropboxusercontent.com/u/106119348/anime_coves.zip 451Megs
The DB is required the cover well make thing pretty, but are not required.

Simply copy the covers to the correct location and import the DB and you are ready to go.  As I make progress on the UDP setup hopefully this will become a thing of the past, but first I need to catch up on 2 weeks of real work (the kind that pays the bills  ;D ), I'm hoping to get back to this by next weekend.

ERIC

FYI for information of getting a developer ID see http://wiki.anidb.net/w/API, but again ensure you per-populate the DB, otherwise it will take about 3 weeks to get the entire listing.
« Last Edit: 2013-11-24, 01:20:54 PM by egandt »

ruhllatio

  • Guest
Re: AniDB
« Reply #7 on: 2013-12-05, 07:11:53 PM »
I've got the AniDB HTTP API script working again on my install.  The last time I tried to merge a fork it was already obsolete and all my changes were lost, so I will just help out where I can and point folks in the right direction to update the branch.  I have registered nzedb as a client under my AniDB account with a client version of 1.  It needs to be added to the UDP API list (even though it is NOT used for UDP API) here http://wiki.anidb.net/w/UDP_Clients to mark it as available.  If everyone starts using it and it isn't in their UDP API listing they will probably delete it.  Go here http://anidb.net/perl-bin/animedb.pl?show=client to register a client.

Using the below line instead of the original line 319 in populate_anidb.php curl_init(); nets actual results that are inserted because it conforms to the new HTTP API's specs.  You MUST have the client, clientver, and protover tags now or the requests will fail.

Code: [Select]
$ch = curl_init('http://api.anidb.net:9001/httpapi?request=anime&client=nzedb&clientver=1&protover=1&aid='.$anidbID);
Try it out for yourselves and let me know if you guys have any questions.

Jonnyboy,

If you're behind a standard NAT router, you were likely blocked because it is doing source port randomization.  AniDB wants to see one IP come from the same source port on a daily basis apparently.  Not multiple.  Multiple ports would potentially mean multiple client pollers sharing an address which is apparently against their terms of use.

EDIT -

Simply placing nzedb (the name of the client I registered) in the AniDB API Key field in Site Settings will restore AniDB functionality... for now.
« Last Edit: 2013-12-05, 07:23:10 PM by ruhllatio »

Offline jonnyboy

  • Epic Indexer
  • *****
  • Posts: 1046
  • Helpful: +93/-1
  • Lazzy Trucker
    • nZEDb
Re: AniDB
« Reply #8 on: 2013-12-05, 09:25:48 PM »
I have added the client to the wiki page and i have requested my ip be unbanned from anidb.net. Also, our client version is 0.0.3, not 1.
« Last Edit: 2013-12-05, 10:12:48 PM by jonnyboy »

ruhllatio

  • Guest
Re: AniDB
« Reply #9 on: 2013-12-09, 08:36:21 AM »
jb,

API client versions must be integers.  I can make it 003 and we can increment based on that.

Offline jonnyboy

  • Epic Indexer
  • *****
  • Posts: 1046
  • Helpful: +93/-1
  • Lazzy Trucker
    • nZEDb
Re: AniDB
« Reply #10 on: 2013-12-09, 08:45:14 AM »
Then they do not really want the client version, they just want some arbitrary number.

ruhllatio

  • Guest
Re: AniDB
« Reply #11 on: 2013-12-09, 09:51:32 AM »
It is arbitrary, but I think they cross reference the client registration lists.  I have to manually assign the client version in the main plugin registration (not the wiki registration you did).  This client version must be presented when using the API or the request will fail.