AniDB metadata agent

@Pallimud, good summary!



As for the love of the plugin - if you have an issue, send me some log files from the agent when the error occurrs so I can troubleshoot it. Perhaps there’s something I’ve overlooked. Just saying “it doesn’t work” wont’ do much. The issue with login/logout can be resolved, at the risk of you getting banned. If I get the time I’ll see if I can add this as a preference setting, whether to logout or not.

I just wanted to add a few suggestions to users having problems with the plug-in.

  1. resolve NAT issues

    2)UPDATE your media SERVER component



    This plug-in would repeatedly FAIL when I tried to match using aniDB at home and at my university (albeit I was over wi-fi) but when I tethered from my iPhone, I no longer received AUTH timeouts and it updated a few shows!

    This started stalling for whatever reason and I had a hunch to check if my client was out of date, and lo and behold it was, but not terribly so (9.5.X - > 9.6.X) Now the plugin (v2) works without a hitch!

    I’ll probably still look into the NAT issue as the UDP API wiki mentions a specific parameter to include if you are NAT. OP have you looked into this?



    Hope this helps someone.


Interesting find with the server version - I haven't seen the version causing any problems before. Nothing in the server API is used for aniDB communication, the only thing I can think of that might differ is the python version that's shipped, but that's only for Linux and Windows (for OSX Plex uses whatever's installed already). However there might be issues as the python version still differs between platforms: Linux -> 2.7, Windows -> 2.6 and (at least some) OSX -> 2.5.

As for the NAT issue mention, that has nothing to do with authentication, it's only if you keep a connection open over a longer period of time. I'm behind a NAT myself, as are most people I would think. Do you get AUTH timeout even if you try to manually match a single movie/show? I know that aniDB has problems from time to time where the API is virtually inaccessible, not sure if that's what you're seeing.

Edit: Removing post. It looks like the plugin is just broken. It doesn’t seem to work at all with the latest PMS release.



Well, I'm sorry to hear it's not working for you, but if you want some help you could add log files or some more description about the error you're getting? "Just broken" really doesn't say anything. I have the plugin running just fine in the Linux build 9.6.1.89 (QNAP), haven't had time to test on other platforms yet - so if something's not working on another platform let me know and I'll look into it.

Ive been trying to get this agent to run on my plex server, which is run on my unraid server (linux). I am getting this when doing a search:


2012-05-15 10:36:27,044 (-4b21f490) :  DEBUG (runtime:528) - Handling request GET /:/plugins/com.plexapp.agents.anidb/messaging/function/X0FnZW50S2l0OlNlYXJjaA__/Y2VyZWFsMQoxCmxpc3QKMApyMAo_/Y2VyZWFsMQoyCmRpY3QKZGljdAo0CnMyCmVuczQKbGFuZ3M1Ck1vdmllczEwCm1lZGlhX3R5cGViMXM2Cm1hbnVhbHIxCnM2Cmt3YXJnczYKczE2CjNhZWZlNTJlYzA0OGQzMDZzMTcKb3BlblN1YnRpdGxlc0hhc2hzMzgKQWNjZWxlcmFuZG8gRGF0ZW5zaGkgVGFjaGkgTm8gU2FzYXlha2lzNApuYW1lczE1MQolMkZtbnQlMkZ1c2VyJTJGVmlkZW9zJTJGQWR1bHQlMkZIZW50YWklMkZBY2NlbGVyYW5kbyUyMCUyMERhdGVuc2hpLXRhY2hpJTIwbm8lMjBTYXNheWFraSUyRkFjY2VsZXJhbmRvJTIwJTIwRGF0ZW5zaGktdGFjaGklMjBubyUyMFNhc2F5YWtpJTJFY2QxJTJFYXZpczgKZmlsZW5hbWVzNDAKNDg5N2ZiOGQ3ZWE2NTJiMThlY2YzNGI4ZDRmMDVhODkyOGFmNWY3MXM4CnBsZXhIYXNoczcKMTYzMDAwMHM4CmR1cmF0aW9uczYKMzAwODg3czIKaWRyMAo_<br />
2012-05-15 10:36:27,045 (-4b21f490) :  INFO (agentkit:833) - Searching for matches for {'openSubtitlesHash': '3aefe52ec048d306', 'name': 'Accelerando Datenshi Tachi No Sasayaki', 'filename': '%2Fmnt%2Fuser%2FVideos%2FAdult%2FHentai%2FAccelerando%20%20Datenshi-tachi%20no%20Sasayaki%2FAccelerando%20%20Datenshi-tachi%20no%20Sasayaki%2Ecd1%2Eavi', 'plexHash': '4897fb8d7ea652b18ecf34b8d4f05a8928af5f71', 'duration': '1630000', 'id': '300887'}<br />
2012-05-15 10:36:27,045 (-4b21f490) :  DEBUG (networking:147) - Requesting 'http://127.0.0.1:32400/library/metadata/300887/tree'<br />
2012-05-15 10:36:49,442 (-4b21f490) :  INFO (__init__:24) - Auth exception msg: Command has timed out<br />
2012-05-15 10:36:49,442 (-4b21f490) :  INFO (__init__:129) - Trying to lookup /mnt/user/Videos/Adult/Hentai/Accelerando  Datenshi-tachi no Sasayaki/Accelerando  Datenshi-tachi no Sasayaki.cd1.avi by file on anidb<br />
2012-05-15 10:36:51,399 (-4b21f490) :  INFO (__init__:132) - Could not load file data, msg: You must be authed to execute commands besides AUTH and PING<br />
2012-05-15 10:36:51,400 (-4b21f490) :  INFO (__init__:139) - Trying to lookup Accelerando Datenshi Tachi No Sasayaki by name on anidb<br />
2012-05-15 10:36:51,400 (-4b21f490) :  INFO (__init__:142) - Could not load anime data, msg: You must be authed to execute commands besides AUTH and PING<br />
2012-05-15 10:36:51,401 (-4b21f490) :  CRITICAL (agentkit:849) - Exception in the search function of agent named 'AniDB', called with keyword arguments {'openSubtitlesHash': '3aefe52ec048d306', 'name': 'Accelerando Datenshi Tachi No Sasayaki', 'filename': '%2Fmnt%2Fuser%2FVideos%2FAdult%2FHentai%2FAccelerando%20%20Datenshi-tachi%20no%20Sasayaki%2FAccelerando%20%20Datenshi-tachi%20no%20Sasayaki%2Ecd1%2Eavi', 'plexHash': '4897fb8d7ea652b18ecf34b8d4f05a8928af5f71', 'duration': '1630000', 'id': '300887'} (most recent call last):<br />
  File "/mnt/cache/data/plex/Application Support/Plex Media Server/Plug-ins/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/api/agentkit.py", line 842, in _search<br />
    agent.search(results, media, lang)<br />
  File "/mnt/cache/data/plex/Application Support/Plex Media Server/Plug-ins/AniDB.bundle/Contents/Code/__init__.py", line 171, in search<br />
    self.doSearch(results, media, lang)<br />
  File "/mnt/cache/data/plex/Application Support/Plex Media Server/Plug-ins/AniDB.bundle/Contents/Code/__init__.py", line 144, in doSearch<br />
    self.disconnect(connection)<br />
  File "/mnt/cache/data/plex/Application Support/Plex Media Server/Plug-ins/AniDB.bundle/Contents/Code/__init__.py", line 29, in disconnect<br />
    connection.stop()<br />
  File "/mnt/cache/data/plex/Application Support/Plex Media Server/Plug-ins/AniDB.bundle/Contents/Code/adba.py", line 71, in stop<br />
    self.logout(cutConnection=True)<br />
  File "/mnt/cache/data/plex/Application Support/Plex Media Server/Plug-ins/AniDB.bundle/Contents/Code/adba.py", line 208, in logout<br />
    result = self.handle(LogoutCommand(), callback)<br />
  File "/mnt/cache/data/plex/Application Support/Plex Media Server/Plug-ins/AniDB.bundle/Contents/Code/adba.py", line 112, in handle<br />
    self.link.request(command)<br />
  File "/mnt/cache/data/plex/Application Support/Plex Media Server/Plug-ins/AniDB.bundle/Contents/Code/aniDBlink.py", line 213, in request<br />
    raise AniDBMustAuthError, "You must be authed to execute commands besides AUTH and PING"<br />
AniDBMustAuthError: You must be authed to execute commands besides AUTH and PING<br />






Are you sure you've set username and password correctly in the proper preferences file? I've seen this error previously when just updating defaultPrefs.json and not com.plexapp.agents.anidb.xml. What version of the server are you running?

I am running v0.9.6.1.89-3c84bb7, I only edited the com.plexapp.agents.anidb.xml
just as a note when I installed it through the unsupported appstore (used the version for alternate clients, due to roku)the com.plexapp.agents.anidb.xml file was listed like same for password, I changed that manually so it was username and the same for password.


Ok, that should be ok (assuming you've entered your actual username and password ;) ). Did you restart your server after changing settings? I don't know if Plex is supposed to pick it up anyway, but it hasn't worked for me without a restart.

I'm not sure if I did, going to try now and let you know what happens.
Edit*
Nope still didnt work but the error was different this time (putting the whole log in since its small):

2012-05-16 08:19:13,335 (-48b5e730) :  DEBUG (core:151) - Starting framework core - Version: 2.1.6.4, Build: fa64768 (Tue Apr 24 00:03:16 UTC 2012)<br />
2012-05-16 08:19:13,336 (-48b5e730) :  DEBUG (core:165) - Using the elevated security policy<br />
2012-05-16 08:19:13,336 (-48b5e730) :  DEBUG (core:205) - Starting runtime component.<br />
2012-05-16 08:19:13,341 (-48b5e730) :  DEBUG (core:207) - Starting caching component.<br />
2012-05-16 08:19:13,341 (-48b5e730) :  DEBUG (core:209) - Starting data component.<br />
2012-05-16 08:19:13,342 (-48b5e730) :  DEBUG (core:211) - Starting networking component.<br />
2012-05-16 08:19:13,342 (-48b5e730) :  DEBUG (networking:427) - Setting the default network timeout to 20.0<br />
2012-05-16 08:19:13,343 (-48b5e730) :  DEBUG (networking:283) - Loaded HTTP cookies<br />
2012-05-16 08:19:13,343 (-48b5e730) :  DEBUG (core:213) - Starting localization component.<br />
2012-05-16 08:19:13,344 (-48b5e730) :  INFO (localization:406) - Setting the default locale to en-us<br />
2012-05-16 08:19:13,344 (-48b5e730) :  DEBUG (localization:428) - Unable to find en strings<br />
2012-05-16 08:19:13,344 (-48b5e730) :  DEBUG (localization:440) - Unable to find en-us strings<br />
2012-05-16 08:19:13,345 (-48b5e730) :  DEBUG (core:215) - Starting messaging component.<br />
2012-05-16 08:19:13,345 (-48b5e730) :  DEBUG (runtime:991) - Created a thread named 'get_server_info'<br />
2012-05-16 08:19:13,346 (-4afc6490) :  DEBUG (networking:147) - Requesting 'http://127.0.0.1:32400/system/messaging/clear_events/com.plexapp.agents.anidb'<br />
2012-05-16 08:19:13,346 (-4b2b4490) :  DEBUG (networking:147) - Requesting 'http://127.0.0.1:32400'<br />
2012-05-16 08:19:13,488 (-48b5e730) :  DEBUG (runtime:991) - Created a thread named 'load_all_services'<br />
2012-05-16 08:19:13,488 (-4b5a2490) :  DEBUG (networking:147) - Requesting 'http://127.0.0.1:32400/:/plugins/com.plexapp.system/messaging/function/X0J1bmRsZVNlcnZpY2U6QWxsU2VydmljZXM_/Y2VyZWFsMQoxCmxpc3QKMApyMAo_/Y2VyZWFsMQoxCmRpY3QKMApyMAo_'<br />
2012-05-16 08:19:13,490 (-48b5e730) :  DEBUG (accessor:68) - Creating a new model access point for provider com.plexapp.agents.anidb in namespace 'metadata'<br />
2012-05-16 08:19:13,491 (-4b890490) :  WARNING (data:178) - Error decoding with simplejson, using demjson instead (this will cause a performance hit) - Expecting property name: line 8 column 9 (char 207)<br />
2012-05-16 08:19:13,491 (-48b5e730) :  DEBUG (classes:9) - Generating class for 'Album' model in namespace 'metadata' with access point 'com.plexapp.agents.anidb'<br />
2012-05-16 08:19:13,494 (-4b890490) :  DEBUG (prefskit:218) - Loaded preferences from DefaultPrefs.json<br />
2012-05-16 08:19:13,494 (-48b5e730) :  DEBUG (classes:9) - Generating class for 'Episode' model in namespace 'metadata' with access point 'com.plexapp.agents.anidb'<br />
2012-05-16 08:19:13,495 (-48b5e730) :  DEBUG (classes:9) - Generating class for 'TV_Show' model in namespace 'metadata' with access point 'com.plexapp.agents.anidb'<br />
2012-05-16 08:19:13,496 (-48b5e730) :  DEBUG (classes:9) - Generating class for 'Artist' model in namespace 'metadata' with access point 'com.plexapp.agents.anidb'<br />
2012-05-16 08:19:13,496 (-48b5e730) :  DEBUG (classes:9) - Generating class for 'Track' model in namespace 'metadata' with access point 'com.plexapp.agents.anidb'<br />
2012-05-16 08:19:13,497 (-48b5e730) :  DEBUG (classes:9) - Generating class for 'Movie' model in namespace 'metadata' with access point 'com.plexapp.agents.anidb'<br />
2012-05-16 08:19:13,497 (-48b5e730) :  DEBUG (classes:9) - Generating class for 'Photo' model in namespace 'metadata' with access point 'com.plexapp.agents.anidb'<br />
2012-05-16 08:19:13,498 (-48b5e730) :  DEBUG (classes:9) - Generating class for 'VideoClip' model in namespace 'metadata' with access point 'com.plexapp.agents.anidb'<br />
2012-05-16 08:19:13,499 (-48b5e730) :  DEBUG (classes:9) - Generating class for 'Person' model in namespace 'metadata' with access point 'com.plexapp.agents.anidb'<br />
2012-05-16 08:19:13,499 (-48b5e730) :  DEBUG (classes:9) - Generating class for 'Role' model in namespace 'metadata' with access point 'com.plexapp.agents.anidb'<br />
2012-05-16 08:19:13,500 (-48b5e730) :  DEBUG (classes:9) - Generating class for 'Season' model in namespace 'metadata' with access point 'com.plexapp.agents.anidb'<br />
2012-05-16 08:19:13,500 (-48b5e730) :  DEBUG (classes:9) - Generating class for 'PhotoAlbum' model in namespace 'metadata' with access point 'com.plexapp.agents.anidb'<br />
2012-05-16 08:19:13,504 (-48b5e730) :  DEBUG (core:261) - Finished starting framework core<br />
2012-05-16 08:19:13,504 (-48b5e730) :  DEBUG (core:310) - Loading plug-in code<br />
2012-05-16 08:19:13,533 (-4b2b4490) :  DEBUG (core:292) - Machine identifier is d3095a3117b5d8011c0dee282c3e449ec569166e<br />
2012-05-16 08:19:13,534 (-4b2b4490) :  DEBUG (core:293) - Server version is 0.9.6.1.89-3c84bb7<br />
2012-05-16 08:19:13,686 (-4b5a2490) :  DEBUG (core:746) - Loaded services<br />
2012-05-16 08:19:13,833 (-4b890490) :  DEBUG (prefskit:320) - Loaded the user preferences for com.plexapp.agents.anidb<br />
2012-05-16 08:19:13,891 (-4b890490) :  DEBUG (prefskit:353) - Saved the user preferences<br />
2012-05-16 08:19:14,806 (-48b5e730) :  DEBUG (agentkit:923) - Creating new agent class called AniDBAgentMovies<br />
2012-05-16 08:19:14,807 (-48b5e730) :  DEBUG (agentkit:810) - Updating agent information: [{'media_types': ['Movie'], 'accepts_from': ['com.plexapp.agents.localmedia', 'com.plexapp.agents.opensubtitles'], 'fallback_agent': None, 'contributes_to': None, 'languages': ['en'], 'primary_provider': True, 'prefs': True, 'name': 'AniDB'}]<br />
2012-05-16 08:19:14,807 (-48b5e730) :  DEBUG (networking:147) - Requesting 'http://127.0.0.1:32400/:/plugins/com.plexapp.system/messaging/function/X0FnZW50U2VydmljZTpVcGRhdGVJbmZv/Y2VyZWFsMQoxCmxpc3QKMApyMAo_/Y2VyZWFsMQo2CmRpY3QKbGlzdApkaWN0Cmxpc3QKbGlzdApsaXN0CjIKczI0CmNvbS5wbGV4YXBwLmFnZW50cy5hbmlkYnMxMAppZGVudGlmaWVycjEKczEwCmFnZW50X2luZm8xCnIyCjgKcjMKczExCm1lZGlhX3R5cGVzcjQKczEyCmFjY2VwdHNfZnJvbW5zMTQKZmFsbGJhY2tfYWdlbnRuczE0CmNvbnRyaWJ1dGVzX3RvcjUKczkKbGFuZ3VhZ2VzYjFzMTYKcHJpbWFyeV9wcm92aWRlcmIxczUKcHJlZnNzNQpBbmlEQnM0Cm5hbWUxCnM1Ck1vdmllMgpzMjkKY29tLnBsZXhhcHAuYWdlbnRzLmxvY2FsbWVkaWFzMzIKY29tLnBsZXhhcHAuYWdlbnRzLm9wZW5zdWJ0aXRsZXMxCnMyCmVucjAK'<br />
2012-05-16 08:19:14,817 (-48b5e730) :  DEBUG (agentkit:923) - Creating new agent class called AniDBAgentTV<br />
2012-05-16 08:19:14,817 (-48b5e730) :  DEBUG (agentkit:810) - Updating agent information: [{'media_types': ['Movie'], 'accepts_from': ['com.plexapp.agents.localmedia', 'com.plexapp.agents.opensubtitles'], 'fallback_agent': None, 'contributes_to': None, 'languages': ['en'], 'primary_provider': True, 'prefs': True, 'name': 'AniDB'}, {'media_types': ['TV_Show'], 'accepts_from': ['com.plexapp.agents.localmedia', 'com.plexapp.agents.opensubtitles'], 'fallback_agent': None, 'contributes_to': None, 'languages': ['en'], 'primary_provider': True, 'prefs': True, 'name': 'AniDB'}]<br />
2012-05-16 08:19:14,818 (-48b5e730) :  DEBUG (networking:147) - Requesting 'http://127.0.0.1:32400/:/plugins/com.plexapp.system/messaging/function/X0FnZW50U2VydmljZTpVcGRhdGVJbmZv/Y2VyZWFsMQoxCmxpc3QKMApyMAo_/Y2VyZWFsMQoxMApkaWN0Cmxpc3QKZGljdApsaXN0Cmxpc3QKbGlzdApkaWN0Cmxpc3QKbGlzdApsaXN0CjIKczI0CmNvbS5wbGV4YXBwLmFnZW50cy5hbmlkYnMxMAppZGVudGlmaWVycjEKczEwCmFnZW50X2luZm8yCnIyCnI2CjgKcjMKczExCm1lZGlhX3R5cGVzcjQKczEyCmFjY2VwdHNfZnJvbW5zMTQKZmFsbGJhY2tfYWdlbnRuczE0CmNvbnRyaWJ1dGVzX3RvcjUKczkKbGFuZ3VhZ2VzYjFzMTYKcHJpbWFyeV9wcm92aWRlcmIxczUKcHJlZnNzNQpBbmlEQnM0Cm5hbWUxCnM1Ck1vdmllMgpzMjkKY29tLnBsZXhhcHAuYWdlbnRzLmxvY2FsbWVkaWFzMzIKY29tLnBsZXhhcHAuYWdlbnRzLm9wZW5zdWJ0aXRsZXMxCnMyCmVuOApyNwpzMTEKbWVkaWFfdHlwZXNyOApzMTIKYWNjZXB0c19mcm9tbnMxNApmYWxsYmFja19hZ2VudG5zMTQKY29udHJpYnV0ZXNfdG9yOQpzOQpsYW5ndWFnZXNiMXMxNgpwcmltYXJ5X3Byb3ZpZGVyYjFzNQpwcmVmc3M1CkFuaURCczQKbmFtZTEKczcKVFZfU2hvdzIKczI5CmNvbS5wbGV4YXBwLmFnZW50cy5sb2NhbG1lZGlhczMyCmNvbS5wbGV4YXBwLmFnZW50cy5vcGVuc3VidGl0bGVzMQpzMgplbnIwCg__'<br />
2012-05-16 08:19:14,826 (-48b5e730) :  DEBUG (core:452) - Running pre-flight checks<br />
2012-05-16 08:19:14,827 (-48b5e730) :  INFO (core:459) - Started plug-in<br />
2012-05-16 08:19:14,827 (-48b5e730) :  DEBUG (socketinterface:137) - Starting socket server<br />
2012-05-16 08:19:14,828 (-48b5e730) :  DEBUG (runtime:991) - Created a thread named 'start'<br />
2012-05-16 08:19:14,828 (-48b5e730) :  INFO (socketinterface:161) - Socket server started on port 33771<br />
2012-05-16 08:19:14,829 (-48b5e730) :  INFO (pipeinterface:28) - Entering run loop<br />
2012-05-16 08:19:14,831 (-48b5e730) :  DEBUG (runtime:528) - Handling request GET /:/prefixes<br />
2012-05-16 08:19:14,832 (-48b5e730) :  DEBUG (runtime:678) - Response: 200<br />
2012-05-16 08:19:14,996 (-4b5a2490) :  DEBUG (runtime:528) - Handling request GET /:/plugins/com.plexapp.agents.anidb/messaging/function/X0FnZW50S2l0OlNlYXJjaA__/Y2VyZWFsMQoxCmxpc3QKMApyMAo_/Y2VyZWFsMQoyCmRpY3QKZGljdAo0CnMyCmVuczQKbGFuZ3M1Ck1vdmllczEwCm1lZGlhX3R5cGViMHM2Cm1hbnVhbHIxCnM2Cmt3YXJnczYKczE2CmM0ODQ2ODAwNTgxODk3NzNzMTcKb3BlblN1YnRpdGxlc0hhc2hzMjIKMTUgQmlzaG91am8gSHlvdXJ5dXVraXM0Cm5hbWVzMTA5CiUyRm1udCUyRnVzZXIlMkZWaWRlb3MlMkZBZHVsdCUyRkhlbnRhaSUyRjE1JTIwQmlzaG91am8lMjBIeW91cnl1dWtpJTJGMTUlMjBCaXNob3VqbyUyMEh5b3VyeXV1a2klMkVjZDElMkVta3ZzOApmaWxlbmFtZXM0MAoyZDY0YjI2ZWQzMGJiNWY5MjI2ZWU5NmY4YTIyOTU4NDBmMGY0NzhhczgKcGxleEhhc2hzNwoxNTEwMDAwczgKZHVyYXRpb25zNgozMDA4OTZzMgppZHIwCg__<br />
2012-05-16 08:19:14,997 (-4b5a2490) :  INFO (agentkit:833) - Searching for matches for {'openSubtitlesHash': 'c484680058189773', 'name': '15 Bishoujo Hyouryuuki', 'filename': '%2Fmnt%2Fuser%2FVideos%2FAdult%2FHentai%2F15%20Bishoujo%20Hyouryuuki%2F15%20Bishoujo%20Hyouryuuki%2Ecd1%2Emkv', 'plexHash': '2d64b26ed30bb5f9226ee96f8a2295840f0f478a', 'duration': '1510000', 'id': '300896'}<br />
2012-05-16 08:19:14,997 (-4b5a2490) :  DEBUG (networking:147) - Requesting 'http://127.0.0.1:32400/library/metadata/300896/tree'<br />
2012-05-16 08:19:15,039 (-4b5a2490) :  DEBUG (prefskit:322) - Reloaded the user preferences for com.plexapp.agents.anidb<br />
2012-05-16 08:19:17,429 (-4b5a2490) :  INFO (__init__:129) - Trying to lookup /mnt/user/Videos/Adult/Hentai/15 Bishoujo Hyouryuuki/15 Bishoujo Hyouryuuki.cd1.mkv by file on anidb<br />
2012-05-16 08:19:23,376 (-4b5a2490) :  CRITICAL (agentkit:849) - Exception in the search function of agent named 'AniDB', called with keyword arguments {'openSubtitlesHash': 'c484680058189773', 'name': '15 Bishoujo Hyouryuuki', 'filename': '%2Fmnt%2Fuser%2FVideos%2FAdult%2FHentai%2F15%20Bishoujo%20Hyouryuuki%2F15%20Bishoujo%20Hyouryuuki%2Ecd1%2Emkv', 'plexHash': '2d64b26ed30bb5f9226ee96f8a2295840f0f478a', 'duration': '1510000', 'id': '300896'} (most recent call last):<br />
  File "/mnt/cache/data/plex/Application Support/Plex Media Server/Plug-ins/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/api/agentkit.py", line 842, in _search<br />
    agent.search(results, media, lang)<br />
  File "/mnt/cache/data/plex/Application Support/Plex Media Server/Plug-ins/AniDB.bundle/Contents/Code/__init__.py", line 171, in search<br />
    self.doSearch(results, media, lang)<br />
  File "/mnt/cache/data/plex/Application Support/Plex Media Server/Plug-ins/AniDB.bundle/Contents/Code/__init__.py", line 155, in doSearch<br />
    if year.find('-') > -1:<br />
AttributeError: 'int' object has no attribute 'find'<br />
<br />
2012-05-16 08:19:23,377 (-4b5a2490) :  DEBUG (runtime:678) - Response: 200<br />


Really not working here (MBA). I can provide logs if necessary




Please do. Troubleshooting "really not working here" is a bit tricky. To re-iterate: have you set correct username and password - in the correct file - and then restarted the server?


Good thing the authentication is working. Ok, so this (new?) version of python apparently assumes that year is an int. I'll have to make sure to cast it to a string before using string functions. I'll fix that when I get back home (on holiday now) and can test it a bit more. A new version should hopefully be up on Monday or Tuesday!

I did set it up in the GUI. Should I write it down directly into the file?




Hey,



Thanks a lot for your hard work. It’s nice to have a proper source for anime.



The year and original_title properties are not part of the TV_Shows metadata model though (http://dev.plexapp.com/docs/agents/models.html), so I get ugly errors like this:



<br />
2012-05-18 11:24:12,562 (-4f9e9000) :  INFO (__init__:105) - Could not set anime metadata, msg: 'TV_Show' object has no attribute named 'year'<br />
2012-05-18 11:24:16,804 (-4f9e9000) :  CRITICAL (agentkit:891) - Exception in the update function of agent named 'AniDB', called with guid 'com.plexapp.agents.anidb://8597?lang=en' (most recent call last): <br />
File "/Users/aowi/Library/Application Support/Plex Media Server/Plug-ins/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/api/agentkit.py", line 889, in _update<br />
    agent.update(obj, media, lang)<br />
File "/Users/aowi/Library/Application Support/Plex Media Server/Plug-ins/AniDB.bundle/Contents/Code/__init__.py", line 201, in update<br />
    Log("Loading metadata for '" + metadata.title + "', episode " + e)<br />
TypeError: cannot concatenate 'str' and 'NoneType' objects<br />




and the update process leaves me with only some metadata set.

Apparently I'm not allowed to attach a patch, so I'll just include it inline. It fixes the problem by simply omitting year and original_title for tv shows. Year gets picked up from the episode air dates and original title it seems I'll just have to live without.


<br />
--- old/__init__.py	2012-02-27 20:47:14.000000000 +0100<br />
+++ new/__init__.py	2012-05-18 12:25:47.000000000 +0200<br />
@@ -86,20 +86,11 @@<br />
       Log("Could not load anime info, msg: " + str(e))<br />
     <br />
     try:<br />
-      if anime.dataDict.has_key('year'):<br />
-        year = anime.dataDict['year']<br />
-        if year.find('-') > -1:<br />
-          year = year[:year.find('-')]<br />
-        try:<br />
-          metadata.year = int(year)<br />
-        except:<br />
-          pass<br />
         <br />
       if anime.dataDict.has_key('rating'):<br />
         metadata.rating = float(anime.dataDict['rating']) / 100<br />
       <br />
       metadata.title = self.getValueWithFallbacks(anime.dataDict, 'english_name', 'romaji_name', 'kanji_name')<br />
-      metadata.original_title = self.getValueWithFallbacks(anime.dataDict, 'romaji_name', 'kanji_name')<br />
       metadata.originally_available_at = self.getDate(anime.dataDict['air_date'])<br />
         <br />
       if anime.dataDict.has_key('picname'):<br />




Edit: To elaborate, the INFO-bit is not a critical error, but it causes an entire try-block to fail, and thus metadata.title isn't set so when you try to access it later, it results in a fatal error.


Well, if you're on OSX it should work after setting it in the GUI, but just in case - check the file as well to make sure it's been written correctly. Restart the server afterwards and try again. And as I wrote before, if you want further help you need to provide me with log files so I have a chance of troubleshooting.




Not sure why I haven't spotted this before, might be that something changed between server/API version? Thanks for the info though! I'll fix this and put it into the next release, but I'll make sure that year and original title is kept for movies, don't worry :)

New version - v3 - is out in this thread (first post) or via Unsupported Appstore. Check it out and let me know if you have any problems.



@ChronoStriker1 - I’ve added explicit cast to string to avoid the problems you had.



@aowi - I cannot seem to recreate your errors (which in itself is very strange), but I’ve added checks whether it’s a movie or a tv-show so you should be ok (year and original_title is now only set for movies).



It is definatly working better now, as in its finding things.
I am however seing this error on most searches:

2012-05-21 18:00:42,707 (-4b9f8490) :  ERROR (model:194) - Cannot read model from /mnt/cache/data/plex/Application Support/Plex Media Server/Metadata/Movies/0/a0bd401eda1856da583c142b67aaef646f956e9.bundle/Contents/com.plexapp.agents.anidb


Also just notices this seems to be hapening quite often in the logs:

2012-05-21 18:01:10,181 (-4ae40490) :  DEBUG (runtime:729) - Response: 200<br />
2012-05-21 18:01:11,495 (-4ae40490) :  DEBUG (runtime:568) - Handling request GET /:/plugins/com.plexapp.agents.anidb/messaging/function/X0FnZW50S2l0OlNlYXJjaA__/Y2VyZWFsMQoxCmxpc3QKMApyMAo_/Y2VyZWFsMQoyCmRpY3QKZGljdAo0CnMyCmVuczQKbGFuZ3M1Ck1vdmllczEwCm1lZGlhX3R5cGViMHM2Cm1hbnVhbHIxCnM2Cmt3YXJnczYKczE2CjM4NjkxZWRjNGJmN2U3ZWRzMTcKb3BlblN1YnRpdGxlc0hhc2hzMjAKQ2FudGFsb3VwZSBDb2xsZWN0b3JzNApuYW1lczEwOAolMkZtbnQlMkZ1c2VyJTJGVmlkZW9zJTJGQWR1bHQlMkZIZW50YWklMkZDYW50YWxvdXBlJTIwQ29sbGVjdG9yJTJGVHN1bWElMjB0byUyME1hbWElMjB0byUyMEJvaW4lMkVjZDElMkVhdmlzOApmaWxlbmFtZXM0MAowZDc1ZmIyNWQ4ZGFiNDg3NDVjMTU3N2QyNzBjNjg5MzY1YWVhZjM2czgKcGxleEhhc2hzNwoxNTIyMDAwczgKZHVyYXRpb25zNgozMDA5NzRzMgppZHIwCg__<br />
2012-05-21 18:01:11,496 (-4ae40490) :  INFO (agentkit:839) - Searching for matches for {'openSubtitlesHash': '38691edc4bf7e7ed', 'name': 'Cantaloupe Collector', 'filename': '%2Fmnt%2Fuser%2FVideos%2FAdult%2FHentai%2FCantaloupe%20Collector%2FTsuma%20to%20Mama%20to%20Boin%2Ecd1%2Eavi', 'plexHash': '0d75fb25d8dab48745c1577d270c689365aeaf36', 'duration': '1522000', 'id': '300974'}<br />
2012-05-21 18:01:11,496 (-4ae40490) :  DEBUG (networking:153) - Requesting 'http://127.0.0.1:32400/library/metadata/300974/tree'<br />
2012-05-21 18:01:25,095 (-4b9f8490) :  INFO (__init__:91) - Could not load anime info, msg: Command has timed out<br />
2012-05-21 18:01:25,095 (-4b9f8490) :  INFO (__init__:116) - Could not set anime metadata, msg: 'air_date'<br />
2012-05-21 18:01:45,124 (-4b9f8490) :  INFO (__init__:121) - Could not load description, msg: 'air_date'<br />
2012-05-21 18:01:51,593 (-4ae40490) :  INFO (__init__:29) - Auth exception msg: Command has timed out<br />
2012-05-21 18:01:51,594 (-4ae40490) :  INFO (__init__:138) - Trying to lookup /mnt/user/Videos/Adult/Hentai/Cantaloupe Collector/Tsuma to Mama to Boin.cd1.avi by file on anidb<br />
2012-05-21 18:01:54,339 (-4ae40490) :  INFO (__init__:141) - Could not load file data, msg: You must be authed to execute commands besides AUTH and PING<br />
2012-05-21 18:01:54,340 (-4ae40490) :  INFO (__init__:148) - Trying to lookup Cantaloupe Collector by name on anidb<br />
2012-05-21 18:01:54,340 (-4ae40490) :  INFO (__init__:151) - Could not load anime data, msg: You must be authed to execute commands besides AUTH and PING<br />
2012-05-21 18:01:54,341 (-4ae40490) :  CRITICAL (agentkit:855) - Exception in the search function of agent named 'AniDB', called with keyword arguments {'openSubtitlesHash': '38691edc4bf7e7ed', 'name': 'Cantaloupe Collector', 'filename': '%2Fmnt%2Fuser%2FVideos%2FAdult%2FHentai%2FCantaloupe%20Collector%2FTsuma%20to%20Mama%20to%20Boin%2Ecd1%2Eavi', 'plexHash': '0d75fb25d8dab48745c1577d270c689365aeaf36', 'duration': '1522000', 'id': '300974'} (most recent call last):<br />
  File "/mnt/cache/data/plex/Application Support/Plex Media Server/Plug-ins/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/api/agentkit.py", line 848, in _search<br />
    agent.search(results, media, lang)<br />
  File "/mnt/cache/data/plex/Application Support/Plex Media Server/Plug-ins/AniDB.bundle/Contents/Code/__init__.py", line 180, in search<br />
    self.doSearch(results, media, lang)<br />
  File "/mnt/cache/data/plex/Application Support/Plex Media Server/Plug-ins/AniDB.bundle/Contents/Code/__init__.py", line 153, in doSearch<br />
    self.disconnect(connection)<br />
  File "/mnt/cache/data/plex/Application Support/Plex Media Server/Plug-ins/AniDB.bundle/Contents/Code/__init__.py", line 34, in disconnect<br />
    connection.stop()<br />
  File "/mnt/cache/data/plex/Application Support/Plex Media Server/Plug-ins/AniDB.bundle/Contents/Code/adba.py", line 71, in stop<br />
    self.logout(cutConnection=True)<br />
  File "/mnt/cache/data/plex/Application Support/Plex Media Server/Plug-ins/AniDB.bundle/Contents/Code/adba.py", line 208, in logout<br />
    result = self.handle(LogoutCommand(), callback)<br />
  File "/mnt/cache/data/plex/Application Support/Plex Media Server/Plug-ins/AniDB.bundle/Contents/Code/adba.py", line 112, in handle<br />
    self.link.request(command)<br />
  File "/mnt/cache/data/plex/Application Support/Plex Media Server/Plug-ins/AniDB.bundle/Contents/Code/aniDBlink.py", line 213, in request<br />
    raise AniDBMustAuthError, "You must be authed to execute commands besides AUTH and PING"<br />
AniDBMustAuthError: You must be authed to execute commands besides AUTH and PING



You can ignore the first error if you still see correct metadata for the show/movie - I get that too but that's before the agent has set the metdata (for me at least). When does this timeout occurr? Is it after loading a few shows/movies, or do you get it even if you just do a manual match from the GUI for one movie/show? I'm not sure if this is the "too-many-auths-within-a-time-period" issue that has been reported before. If so, I might have to look into a workaround. This should then only occurr on the initial scan and not when doing delta updates (unless you add loads of shows/movies at a time).