AniDB metadata agent

Good to see some progress. I’ve never used the custom search feature as I haven’t ever had a failed lookup or mismatch.



‘Fix incorrect match’ works. I repro the exact same issue doing a custom search - I guess custom search routes through the same part of the code but should probably bypass the hash-based lookup part.



‘Fix Incorrect Match’:


2012-08-03 20:30:54,444 (-48be3950) :  INFO (core:336) - Starting framework core - Version: 2.2.0.12, Build: 8a8b311 (Thu Aug 02 22:03:52 UTC 2012)<br />
2012-08-03 20:30:54,446 (-48be3950) :  DEBUG (core:348) - Using the elevated policy<br />
2012-08-03 20:30:54,447 (-48be3950) :  DEBUG (core:437) - Starting runtime component.<br />
2012-08-03 20:30:54,454 (-48be3950) :  DEBUG (core:437) - Starting caching component.<br />
2012-08-03 20:30:54,456 (-48be3950) :  DEBUG (core:437) - Starting data component.<br />
2012-08-03 20:30:54,458 (-48be3950) :  DEBUG (core:437) - Starting networking component.<br />
2012-08-03 20:30:54,461 (-48be3950) :  DEBUG (networking:297) - Loaded HTTP cookies<br />
2012-08-03 20:30:54,464 (-48be3950) :  DEBUG (networking:483) - Setting the default network timeout to 20.0<br />
2012-08-03 20:30:54,468 (-48be3950) :  DEBUG (core:437) - Starting localization component.<br />
2012-08-03 20:30:54,469 (-48be3950) :  INFO (localization:408) - Setting the default locale to en-us<br />
2012-08-03 20:30:54,471 (-48be3950) :  DEBUG (core:437) - Starting messaging component.<br />
2012-08-03 20:30:54,473 (-48be3950) :  DEBUG (core:437) - Starting debugging component.<br />
2012-08-03 20:30:54,475 (-4adb4470) :  DEBUG (networking:156) - Requesting 'http://127.0.0.1:32400/system/messaging/clear_events/com.plexapp.agents.anidb'<br />
2012-08-03 20:30:54,476 (-48be3950) :  DEBUG (core:437) - Starting services component.<br />
2012-08-03 20:30:54,483 (-48be3950) :  DEBUG (core:437) - Starting myplex component.<br />
2012-08-03 20:30:54,485 (-48be3950) :  DEBUG (core:437) - Starting notifications component.<br />
2012-08-03 20:30:55,142 (-48be3950) :  DEBUG (accessor:68) - Creating a new model access point for provider com.plexapp.agents.anidb in namespace 'metadata'<br />
2012-08-03 20:30:55,198 (-4adb4470) :  DEBUG (services:263) - Plug-in is not daemonized - loading services from system<br />
2012-08-03 20:30:55,199 (-48be3950) :  DEBUG (runtime:1009) - Created a thread named 'load_all_services'<br />
2012-08-03 20:30:55,204 (-4adb4470) :  DEBUG (networking:156) - Requesting 'http://127.0.0.1:32400/:/plugins/com.plexapp.system/messaging/function/X0J1bmRsZVNlcnZpY2U6QWxsU2VydmljZXM_/Y2VyZWFsMQoxCmxpc3QKMApyMAo_/Y2VyZWFsMQoxCmRpY3QKMApyMAo_'<br />
2012-08-03 20:30:55,208 (-48be3950) :  DEBUG (runtime:1009) - Created a thread named 'get_server_info'<br />
2012-08-03 20:30:55,209 (-4b390470) :  DEBUG (networking:156) - Requesting 'http://127.0.0.1:32400'<br />
2012-08-03 20:30:55,211 (-48be3950) :  DEBUG (core:149) - Finished starting framework core<br />
2012-08-03 20:30:55,217 (-48be3950) :  DEBUG (core:547) - Loading plug-in code<br />
2012-08-03 20:30:55,270 (-4b390470) :  DEBUG (core:525) - Machine identifier is fe73f088e2a8b9fdb1cec1c7b23ce361bece376d<br />
2012-08-03 20:30:55,272 (-4b390470) :  DEBUG (core:526) - Server version is 0.9.6.3.143-4466fb5<br />
2012-08-03 20:30:56,129 (-48be3950) :  DEBUG (core:553) - Finished loading plug-in code<br />
2012-08-03 20:30:56,808 (-4adb4470) :  DEBUG (services:357) - Loaded services<br />
2012-08-03 20:30:56,838 (-4b0a2470) :  DEBUG (services:433) - No shared code to load<br />
2012-08-03 20:31:02,058 (-48be3950) :  DEBUG (agentkit:1005) - Creating new agent class called AniDBAgentMovies<br />
2012-08-03 20:31:02,060 (-48be3950) :  DEBUG (agentkit:885) - Updating agent information: [{'media_types': ['Movie'], 'accepts_from': ['com.plexapp.agents.localmedia', 'com.plexapp.agents.opensubtitles'], 'fallback_agent': None, 'contributes_to': None, 'languages': ['en'], 'persist_stored_files': True, 'primary_provider': True, 'prefs': True, 'name': 'AniDB'}]<br />
2012-08-03 20:31:02,072 (-48be3950) :  DEBUG (networking:156) - Requesting 'http://127.0.0.1:32400/:/plugins/com.plexapp.system/messaging/function/X0FnZW50U2VydmljZTpVcGRhdGVJbmZv/Y2VyZWFsMQoxCmxpc3QKMApyMAo_/Y2VyZWFsMQo2CmRpY3QKbGlzdApkaWN0Cmxpc3QKbGlzdApsaXN0CjIKczI0CmNvbS5wbGV4YXBwLmFnZW50cy5hbmlkYnMxMAppZGVudGlmaWVycjEKczEwCmFnZW50X2luZm8xCnIyCjkKcjMKczExCm1lZGlhX3R5cGVzcjQKczEyCmFjY2VwdHNfZnJvbW5zMTQKZmFsbGJhY2tfYWdlbnRuczE0CmNvbnRyaWJ1dGVzX3RvcjUKczkKbGFuZ3VhZ2VzYjFzMjAKcGVyc2lzdF9zdG9yZWRfZmlsZXNiMXMxNgpwcmltYXJ5X3Byb3ZpZGVyYjFzNQpwcmVmc3M1CkFuaURCczQKbmFtZTEKczUKTW92aWUyCnMyOQpjb20ucGxleGFwcC5hZ2VudHMubG9jYWxtZWRpYXMzMgpjb20ucGxleGFwcC5hZ2VudHMub3BlbnN1YnRpdGxlczEKczIKZW5yMAo_'<br />
2012-08-03 20:31:02,134 (-48be3950) :  DEBUG (agentkit:1005) - Creating new agent class called AniDBAgentTV<br />
2012-08-03 20:31:02,136 (-48be3950) :  DEBUG (agentkit:885) - Updating agent information: [{'media_types': ['Movie'], 'accepts_from': ['com.plexapp.agents.localmedia', 'com.plexapp.agents.opensubtitles'], 'fallback_agent': None, 'contributes_to': None, 'languages': ['en'], 'persist_stored_files': True, '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'], 'persist_stored_files': True, 'primary_provider': True, 'prefs': True, 'name': 'AniDB'}]<br />
2012-08-03 20:31:02,141 (-48be3950) :  DEBUG (networking:156) - Requesting 'http://127.0.0.1:32400/:/plugins/com.plexapp.system/messaging/function/X0FnZW50U2VydmljZTpVcGRhdGVJbmZv/Y2VyZWFsMQoxCmxpc3QKMApyMAo_/Y2VyZWFsMQoxMApkaWN0Cmxpc3QKZGljdApsaXN0Cmxpc3QKbGlzdApkaWN0Cmxpc3QKbGlzdApsaXN0CjIKczI0CmNvbS5wbGV4YXBwLmFnZW50cy5hbmlkYnMxMAppZGVudGlmaWVycjEKczEwCmFnZW50X2luZm8yCnIyCnI2CjkKcjMKczExCm1lZGlhX3R5cGVzcjQKczEyCmFjY2VwdHNfZnJvbW5zMTQKZmFsbGJhY2tfYWdlbnRuczE0CmNvbnRyaWJ1dGVzX3RvcjUKczkKbGFuZ3VhZ2VzYjFzMjAKcGVyc2lzdF9zdG9yZWRfZmlsZXNiMXMxNgpwcmltYXJ5X3Byb3ZpZGVyYjFzNQpwcmVmc3M1CkFuaURCczQKbmFtZTEKczUKTW92aWUyCnMyOQpjb20ucGxleGFwcC5hZ2VudHMubG9jYWxtZWRpYXMzMgpjb20ucGxleGFwcC5hZ2VudHMub3BlbnN1YnRpdGxlczEKczIKZW45CnI3CnMxMQptZWRpYV90eXBlc3I4CnMxMgphY2NlcHRzX2Zyb21uczE0CmZhbGxiYWNrX2FnZW50bnMxNApjb250cmlidXRlc190b3I5CnM5Cmxhbmd1YWdlc2IxczIwCnBlcnNpc3Rfc3RvcmVkX2ZpbGVzYjFzMTYKcHJpbWFyeV9wcm92aWRlcmIxczUKcHJlZnNzNQpBbmlEQnM0Cm5hbWUxCnM3ClRWX1Nob3cyCnMyOQpjb20ucGxleGFwcC5hZ2VudHMubG9jYWxtZWRpYXMzMgpjb20ucGxleGFwcC5hZ2VudHMub3BlbnN1YnRpdGxlczEKczIKZW5yMAo_'<br />
2012-08-03 20:31:02,170 (-48be3950) :  INFO (core:598) - Started plug-in<br />
2012-08-03 20:31:02,171 (-48be3950) :  DEBUG (socketinterface:137) - Starting socket server<br />
2012-08-03 20:31:02,175 (-48be3950) :  DEBUG (runtime:1009) - Created a thread named 'start'<br />
2012-08-03 20:31:02,177 (-48be3950) :  INFO (socketinterface:161) - Socket server started on port 47705<br />
2012-08-03 20:31:02,178 (-48be3950) :  INFO (pipeinterface:25) - Entering run loop<br />
2012-08-03 20:31:02,180 (-48be3950) :  DEBUG (runtime:650) - Handling request GET /:/prefixes<br />
2012-08-03 20:31:02,187 (-48be3950) :  DEBUG (runtime:740) - Found route matching /:/prefixes<br />
2012-08-03 20:31:02,192 (-48be3950) :  DEBUG (runtime:830) - Response: [200] MediaContainer, 149 bytes<br />
2012-08-03 20:31:02,499 (-4adb4470) :  DEBUG (runtime:650) - Handling request GET /:/plugins/com.plexapp.agents.anidb/messaging/function/X0FnZW50S2l0OlNlYXJjaA__/Y2VyZWFsMQoxCmxpc3QKMApyMAo_/Y2VyZWFsMQoyCmRpY3QKZGljdAo0CnMyCmVuczQKbGFuZ3M3ClRWX1Nob3dzMTAKbWVkaWFfdHlwZWIxczYKbWFudWFscjEKczYKa3dhcmdzOQpzMTUKNmUxMjhmYjk2YjA3MjE1czE3Cm9wZW5TdWJ0aXRsZXNIYXNoczEKNnM3CmVwaXNvZGVzMQoxczgKZXBpc29kaWNzMTEKQnJlYWsgQmxhZGVzNApzaG93czEKMXM2CnNlYXNvbnMxMjEKJTJGc2hhcmUlMkZNRDBfREFUQSUyRk11bHRpbWVkaWElMkZWaWRlbyUyRkFuaW1lJTJGQnJlYWslMjBCbGFkZSUyRltnZ11fQnJlYWtfQmxhZGVfLV9FcGlzb2RlXzA2XygxMDgwcClfW0Q4MjBENkRFXSUyRW1rdnM4CmZpbGVuYW1lczQwCmU3ZDY3MGE4Y2NhZjlmNjk4MmIyYjY5N2JiNjVmNjFkZjFmMTJlMjFzOApwbGV4SGFzaHM3CjMxMjU2MzJzOApkdXJhdGlvbnM0CjIzNjdzMgppZHIwCg__<br />
2012-08-03 20:31:02,586 (-4adb4470) :  DEBUG (runtime:740) - Found route matching /:/plugins/com.plexapp.agents.anidb/messaging/function/X0FnZW50S2l0OlNlYXJjaA__/Y2VyZWFsMQoxCmxpc3QKMApyMAo_/Y2VyZWFsMQoyCmRpY3QKZGljdAo0CnMyCmVuczQKbGFuZ3M3ClRWX1Nob3dzMTAKbWVkaWFfdHlwZWIxczYKbWFudWFscjEKczYKa3dhcmdzOQpzMTUKNmUxMjhmYjk2YjA3MjE1czE3Cm9wZW5TdWJ0aXRsZXNIYXNoczEKNnM3CmVwaXNvZGVzMQoxczgKZXBpc29kaWNzMTEKQnJlYWsgQmxhZGVzNApzaG93czEKMXM2CnNlYXNvbnMxMjEKJTJGc2hhcmUlMkZNRDBfREFUQSUyRk11bHRpbWVkaWElMkZWaWRlbyUyRkFuaW1lJTJGQnJlYWslMjBCbGFkZSUyRltnZ11fQnJlYWtfQmxhZGVfLV9FcGlzb2RlXzA2XygxMDgwcClfW0Q4MjBENkRFXSUyRW1rdnM4CmZpbGVuYW1lczQwCmU3ZDY3MGE4Y2NhZjlmNjk4MmIyYjY5N2JiNjVmNjFkZjFmMTJlMjFzOApwbGV4SGFzaHM3CjMxMjU2MzJzOApkdXJhdGlvbnM0CjIzNjdzMgppZHIwCg__<br />
2012-08-03 20:31:02,589 (-4adb4470) :  INFO (agentkit:909) - Searching for matches for {'openSubtitlesHash': '6e128fb96b07215', 'episode': '6', 'episodic': '1', 'show': 'Break Blade', 'season': '1', 'filename': '%2Fshare%2FMD0_DATA%2FMultimedia%2FVideo%2FAnime%2FBreak%20Blade%2F[gg]_Break_Blade_-_Episode_06_(1080p)_[D820D6DE]%2Emkv', 'plexHash': 'e7d670a8ccaf9f6982b2b697bb65f61df1f12e21', 'duration': '3125632', 'id': '2367'}<br />
2012-08-03 20:31:02,621 (-4adb4470) :  DEBUG (networking:156) - Requesting 'http://127.0.0.1:32400/library/metadata/2367/tree'<br />
2012-08-03 20:31:02,758 (-4adb4470) :  WARNING (data:181) - Error decoding with simplejson, using demjson instead (this will cause a performance hit) - Expecting property name: line 8 column 9 (char 207)<br />
2012-08-03 20:31:02,770 (-4adb4470) :  DEBUG (preferences:259) - Loaded preferences from DefaultPrefs.json<br />
2012-08-03 20:31:02,773 (-4adb4470) :  DEBUG (preferences:181) - Loaded the user preferences for com.plexapp.agents.anidb<br />
2012-08-03 20:31:05,634 (-4adb4470) :  INFO (__init__:50) - Auth ok!<br />
2012-08-03 20:31:05,637 (-4adb4470) :  INFO (__init__:169) - Trying to lookup /share/MD0_DATA/Multimedia/Video/Anime/Break Blade/[gg]_Break_Blade_-_Episode_06_(1080p)_[D820D6DE].mkv by file on anidb<br />
2012-08-03 20:31:22,293 (-4adb4470) :  INFO (__init__:197) - Appending metadata search result for anime Broken Blade<br />
2012-08-03 20:31:22,299 (-4adb4470) :  DEBUG (runtime:830) - Response: [200] str, 632 bytes



Custom search from that dialog:


<br />
2012-08-03 20:31:46,762 (-4adb4470) :  DEBUG (runtime:650) - Handling request GET /:/plugins/com.plexapp.agents.anidb/messaging/function/X0FnZW50S2l0OlNlYXJjaA__/Y2VyZWFsMQoxCmxpc3QKMApyMAo_/Y2VyZWFsMQoyCmRpY3QKZGljdAo0CnMyCmVuczQKbGFuZ3M3ClRWX1Nob3dzMTAKbWVkaWFfdHlwZWIxczYKbWFudWFscjEKczYKa3dhcmdzMwpzNAoyMDEwczQKeWVhcnM0CjIzNjdzMgppZHMxMQpCcmVhayBCbGFkZXM0CnNob3dyMAo_<br />
2012-08-03 20:31:46,767 (-4adb4470) :  DEBUG (runtime:740) - Found route matching /:/plugins/com.plexapp.agents.anidb/messaging/function/X0FnZW50S2l0OlNlYXJjaA__/Y2VyZWFsMQoxCmxpc3QKMApyMAo_/Y2VyZWFsMQoyCmRpY3QKZGljdAo0CnMyCmVuczQKbGFuZ3M3ClRWX1Nob3dzMTAKbWVkaWFfdHlwZWIxczYKbWFudWFscjEKczYKa3dhcmdzMwpzNAoyMDEwczQKeWVhcnM0CjIzNjdzMgppZHMxMQpCcmVhayBCbGFkZXM0CnNob3dyMAo_<br />
2012-08-03 20:31:46,770 (-4adb4470) :  INFO (agentkit:909) - Searching for matches for {'show': 'Break Blade', 'id': '2367', 'year': '2010'}<br />
2012-08-03 20:31:46,772 (-4adb4470) :  DEBUG (networking:156) - Requesting 'http://127.0.0.1:32400/library/metadata/2367/tree'<br />
2012-08-03 20:31:46,798 (-4adb4470) :  INFO (__init__:29) - Reusing authenticated connection<br />
2012-08-03 20:31:46,931 (-4adb4470) :  CRITICAL (agentkit:925) - Exception in the search function of agent named 'AniDB', called with keyword arguments {'show': 'Break Blade', 'id': '2367', 'year': '2010'} (most recent call last):<br />
  File "/share/MD0_DATA/.qpkg/PlexMediaServer/Library/Plex Media Server/Plug-ins/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/api/agentkit.py", line 918, in _search<br />
    agent.search(results, media, lang)<br />
  File "/root/Library/Plex Media Server/Plug-ins/AniDB.bundle/Contents/Code/__init__.py", line 240, in search<br />
    self.doSearch(results, media, lang)<br />
  File "/root/Library/Plex Media Server/Plug-ins/AniDB.bundle/Contents/Code/__init__.py", line 162, in doSearch<br />
    filePath = urllib.unquote(media.filename)<br />
  File "/share/MD0_DATA/.qpkg/PlexMediaServer/Resources/Python/lib/python2.7/urllib.py", line 1174, in unquote<br />
    res = s.split('%')<br />
AttributeError: 'NoneType' object has no attribute 'split'<br />
<br />
2012-08-03 20:31:46,937 (-4adb4470) :  DEBUG (runtime:830) - Response: [200] str, 16 bytes



Looks like we've possibly gotten to the bottom of things, finally. No idea whether custom search used to work or not. Maybe it never did, maybe some of the other changes recently have broken it.


Thanks for helping to troubleshoot this one. Custom search has never been handled properly by design (I've never payed any attention to it), so if it worked previously it was by chance. I'll look into it to see what is needed to get it working.

New version - v8 - out. Install from the usual places. This should fix filename being empty when using custom search.

everything works now!



have my babies <3.

Thanks for this. I’ve just started using Plex and glad I found this to stream my Anime!

I’ve recently run into a problem with this agent. It appears to my untrained eye to be defaulting to Open Subtitles, even though I have open subtitled unchecked and at the bottom of the list. Can anyone figure out wtf is going on here? Several days of not being able to pull metadata. Also, since I’ve added this agent, my TV shows no longer pull metadata automatically, and instead I have to manually check with TVDB each time. I’ve spent probably 20 hours checking logs, rearranging folder structures, playing with agent order, manually looking for metadata, adding pictures, theme music, etc… It’s almost perfect, but now the agent is refusing to work. UPDATE: I realized that the default metagent for the entire section was set to personal media instead of TVDB or AniDB. I’ve set it to AniDB and we’ll see how things go after an update.



I’ve seen it attempt to connect to AniDB and time out before, which is strange, as the service NORMALLY works fine when I attempt to manually search on anidb.net. But for the past few days it’s been failing. Here’s the log:



Also, I wanted to know: How do you remove the secondary metadata fallbacks of open subtitles or personal media in the TV section. Under movies, I have yet to have a single problem. Every time it pulls the data correctly automatically… but never so in my TV section. In the movie section, under AniDB, nothing is checked at all.





2012-08-22 18:34:03,950 (10e8) :  INFO (core:336) - Starting framework core - Version: 2.2.0.12, Build: 8a8b311 (Thu Aug 02 22:03:52 UTC 2012)<br />
2012-08-22 18:34:03,950 (10e8) :  DEBUG (core:348) - Using the elevated policy<br />
2012-08-22 18:34:03,950 (10e8) :  DEBUG (core:437) - Starting runtime component.<br />
2012-08-22 18:34:03,953 (10e8) :  DEBUG (core:437) - Starting caching component.<br />
2012-08-22 18:34:03,954 (10e8) :  DEBUG (core:437) - Starting data component.<br />
2012-08-22 18:34:03,954 (10e8) :  DEBUG (core:437) - Starting networking component.<br />
2012-08-22 18:34:03,957 (10e8) :  DEBUG (networking:297) - Loaded HTTP cookies<br />
2012-08-22 18:34:03,957 (10e8) :  DEBUG (networking:483) - Setting the default network timeout to 20.0<br />
2012-08-22 18:34:03,957 (10e8) :  DEBUG (core:437) - Starting localization component.<br />
2012-08-22 18:34:03,959 (10e8) :  INFO (localization:408) - Setting the default locale to en-us<br />
2012-08-22 18:34:03,959 (10e8) :  DEBUG (core:437) - Starting messaging component.<br />
2012-08-22 18:34:03,960 (10e8) :  DEBUG (core:437) - Starting debugging component.<br />
2012-08-22 18:34:03,960 (10e8) :  DEBUG (core:437) - Starting services component.<br />
2012-08-22 18:34:03,960 (c44) :  DEBUG (networking:156) - Requesting 'http://127.0.0.1:32400/system/messaging/clear_events/com.plexapp.agents.anidb'<br />
2012-08-22 18:34:03,960 (10e8) :  DEBUG (core:437) - Starting myplex component.<br />
2012-08-22 18:34:03,961 (10e8) :  DEBUG (core:437) - Starting notifications component.<br />
2012-08-22 18:34:04,075 (10e8) :  DEBUG (accessor:68) - Creating a new model access point for provider com.plexapp.agents.anidb in namespace 'metadata'<br />
2012-08-22 18:34:04,085 (10e8) :  DEBUG (runtime:1009) - Created a thread named 'load_all_services'<br />
2012-08-22 18:34:04,085 (1008) :  DEBUG (services:263) - Plug-in is not daemonized - loading services from system<br />
2012-08-22 18:34:04,088 (10e8) :  DEBUG (runtime:1009) - Created a thread named 'get_server_info'<br />
2012-08-22 18:34:04,088 (12c0) :  DEBUG (networking:156) - Requesting 'http://127.0.0.1:32400'<br />
2012-08-22 18:34:04,089 (10e8) :  DEBUG (core:149) - Finished starting framework core<br />
2012-08-22 18:34:04,089 (1008) :  DEBUG (networking:156) - Requesting 'http://127.0.0.1:32400/:/plugins/com.plexapp.system/messaging/function/X0J1bmRsZVNlcnZpY2U6QWxsU2VydmljZXM_/Y2VyZWFsMQoxCmxpc3QKMApyMAo_/Y2VyZWFsMQoxCmRpY3QKMApyMAo_'<br />
2012-08-22 18:34:04,091 (10e8) :  DEBUG (core:547) - Loading plug-in code<br />
2012-08-22 18:34:04,105 (12c0) :  DEBUG (core:525) - Machine identifier is 297c1990e147c4468061f9ee8699b3df01bb4ea3<br />
2012-08-22 18:34:04,107 (12c0) :  DEBUG (core:526) - Server version is 0.9.6.7-266f05d<br />
2012-08-22 18:34:04,315 (10e8) :  DEBUG (core:553) - Finished loading plug-in code<br />
2012-08-22 18:34:04,421 (1008) :  DEBUG (services:357) - Loaded services<br />
2012-08-22 18:34:04,430 (10d4) :  DEBUG (services:433) - No shared code to load<br />
2012-08-22 18:34:05,369 (10e8) :  DEBUG (agentkit:1005) - Creating new agent class called AniDBAgentMovies<br />
2012-08-22 18:34:05,371 (10e8) :  DEBUG (agentkit:885) - Updating agent information: [{'media_types': ['Movie'], 'accepts_from': ['com.plexapp.agents.localmedia', 'com.plexapp.agents.opensubtitles'], 'fallback_agent': None, 'contributes_to': None, 'languages': ['en'], 'persist_stored_files': True, 'primary_provider': True, 'prefs': True, 'name': 'AniDB'}]<br />
2012-08-22 18:34:05,371 (10e8) :  DEBUG (networking:156) - Requesting 'http://127.0.0.1:32400/:/plugins/com.plexapp.system/messaging/function/X0FnZW50U2VydmljZTpVcGRhdGVJbmZv/Y2VyZWFsMQoxCmxpc3QKMApyMAo_/Y2VyZWFsMQo2CmRpY3QKbGlzdApkaWN0Cmxpc3QKbGlzdApsaXN0CjIKczI0CmNvbS5wbGV4YXBwLmFnZW50cy5hbmlkYnMxMAppZGVudGlmaWVycjEKczEwCmFnZW50X2luZm8xCnIyCjkKcjMKczExCm1lZGlhX3R5cGVzcjQKczEyCmFjY2VwdHNfZnJvbW5zMTQKZmFsbGJhY2tfYWdlbnRuczE0CmNvbnRyaWJ1dGVzX3RvcjUKczkKbGFuZ3VhZ2VzYjFzMjAKcGVyc2lzdF9zdG9yZWRfZmlsZXNiMXMxNgpwcmltYXJ5X3Byb3ZpZGVyYjFzNQpwcmVmc3M1CkFuaURCczQKbmFtZTEKczUKTW92aWUyCnMyOQpjb20ucGxleGFwcC5hZ2VudHMubG9jYWxtZWRpYXMzMgpjb20ucGxleGFwcC5hZ2VudHMub3BlbnN1YnRpdGxlczEKczIKZW5yMAo_'<br />
2012-08-22 18:34:05,381 (10e8) :  DEBUG (agentkit:1005) - Creating new agent class called AniDBAgentTV<br />
2012-08-22 18:34:05,381 (10e8) :  DEBUG (agentkit:885) - Updating agent information: [{'media_types': ['Movie'], 'accepts_from': ['com.plexapp.agents.localmedia', 'com.plexapp.agents.opensubtitles'], 'fallback_agent': None, 'contributes_to': None, 'languages': ['en'], 'persist_stored_files': True, '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'], 'persist_stored_files': True, 'primary_provider': True, 'prefs': True, 'name': 'AniDB'}]<br />
2012-08-22 18:34:05,384 (10e8) :  DEBUG (networking:156) - Requesting 'http://127.0.0.1:32400/:/plugins/com.plexapp.system/messaging/function/X0FnZW50U2VydmljZTpVcGRhdGVJbmZv/Y2VyZWFsMQoxCmxpc3QKMApyMAo_/Y2VyZWFsMQoxMApkaWN0Cmxpc3QKZGljdApsaXN0Cmxpc3QKbGlzdApkaWN0Cmxpc3QKbGlzdApsaXN0CjIKczI0CmNvbS5wbGV4YXBwLmFnZW50cy5hbmlkYnMxMAppZGVudGlmaWVycjEKczEwCmFnZW50X2luZm8yCnIyCnI2CjkKcjMKczExCm1lZGlhX3R5cGVzcjQKczEyCmFjY2VwdHNfZnJvbW5zMTQKZmFsbGJhY2tfYWdlbnRuczE0CmNvbnRyaWJ1dGVzX3RvcjUKczkKbGFuZ3VhZ2VzYjFzMjAKcGVyc2lzdF9zdG9yZWRfZmlsZXNiMXMxNgpwcmltYXJ5X3Byb3ZpZGVyYjFzNQpwcmVmc3M1CkFuaURCczQKbmFtZTEKczUKTW92aWUyCnMyOQpjb20ucGxleGFwcC5hZ2VudHMubG9jYWxtZWRpYXMzMgpjb20ucGxleGFwcC5hZ2VudHMub3BlbnN1YnRpdGxlczEKczIKZW45CnI3CnMxMQptZWRpYV90eXBlc3I4CnMxMgphY2NlcHRzX2Zyb21uczE0CmZhbGxiYWNrX2FnZW50bnMxNApjb250cmlidXRlc190b3I5CnM5Cmxhbmd1YWdlc2IxczIwCnBlcnNpc3Rfc3RvcmVkX2ZpbGVzYjFzMTYKcHJpbWFyeV9wcm92aWRlcmIxczUKcHJlZnNzNQpBbmlEQnM0Cm5hbWUxCnM3ClRWX1Nob3cyCnMyOQpjb20ucGxleGFwcC5hZ2VudHMubG9jYWxtZWRpYXMzMgpjb20ucGxleGFwcC5hZ2VudHMub3BlbnN1YnRpdGxlczEKczIKZW5yMAo_'<br />
2012-08-22 18:34:05,392 (10e8) :  INFO (core:598) - Started plug-in<br />
2012-08-22 18:34:05,392 (10e8) :  DEBUG (socketinterface:137) - Starting socket server<br />
2012-08-22 18:34:05,394 (10e8) :  DEBUG (runtime:1009) - Created a thread named 'start'<br />
2012-08-22 18:34:05,394 (10e8) :  INFO (socketinterface:161) - Socket server started on port 3853<br />
2012-08-22 18:34:05,394 (10e8) :  INFO (pipeinterface:25) - Entering run loop<br />
2012-08-22 18:34:05,395 (10e8) :  DEBUG (runtime:650) - Handling request GET /:/prefixes<br />
2012-08-22 18:34:05,397 (10e8) :  DEBUG (runtime:740) - Found route matching /:/prefixes<br />
2012-08-22 18:34:05,398 (10e8) :  DEBUG (runtime:830) - Response: [200] MediaContainer, 148 bytes<br />
2012-08-22 18:34:05,513 (10cc) :  DEBUG (runtime:650) - Handling request GET /:/plugins/com.plexapp.agents.anidb/messaging/function/X0FnZW50S2l0OlNlYXJjaA__/Y2VyZWFsMQoxCmxpc3QKMApyMAo_/Y2VyZWFsMQoyCmRpY3QKZGljdAo0CnMyCnhuczQKbGFuZ3M3ClRWX1Nob3dzMTAKbWVkaWFfdHlwZWIwczYKbWFudWFscjEKczYKa3dhcmdzOQpzMTYKNGU2ZDFlZTUxZWIzZDVkYnMxNwpvcGVuU3VidGl0bGVzSGFzaHMyCjI1czcKZXBpc29kZXMxCjFzOAplcGlzb2RpY3MxNApLaW1pIE5pIFRvZG9rZXM0CnNob3dzMQoxczYKc2Vhc29uczk1Ckg6JTVDVFYlMjBTaG93cyU1Q1RWJTVDS2ltaSUyMG5pJTIwVG9kb2tlJTVDW0FOQlUtRnJvc3RpaV1fS2ltaV9uaV9Ub2Rva2VfLV8yNV9bQUI5NzFCNzhdJTJFbWt2czgKZmlsZW5hbWVzNDAKYjFmYzQzNzVjNTdkODM1ZGYxN2M2NTJmYzgyOTJhODZmNzEyZmQ2NHM4CnBsZXhIYXNoczcKMTM0OTk3NHM4CmR1cmF0aW9uczUKMTY5MzJzMgppZHIwCg__<br />
2012-08-22 18:34:05,532 (10cc) :  DEBUG (runtime:740) - Found route matching /:/plugins/com.plexapp.agents.anidb/messaging/function/X0FnZW50S2l0OlNlYXJjaA__/Y2VyZWFsMQoxCmxpc3QKMApyMAo_/Y2VyZWFsMQoyCmRpY3QKZGljdAo0CnMyCnhuczQKbGFuZ3M3ClRWX1Nob3dzMTAKbWVkaWFfdHlwZWIwczYKbWFudWFscjEKczYKa3dhcmdzOQpzMTYKNGU2ZDFlZTUxZWIzZDVkYnMxNwpvcGVuU3VidGl0bGVzSGFzaHMyCjI1czcKZXBpc29kZXMxCjFzOAplcGlzb2RpY3MxNApLaW1pIE5pIFRvZG9rZXM0CnNob3dzMQoxczYKc2Vhc29uczk1Ckg6JTVDVFYlMjBTaG93cyU1Q1RWJTVDS2ltaSUyMG5pJTIwVG9kb2tlJTVDW0FOQlUtRnJvc3RpaV1fS2ltaV9uaV9Ub2Rva2VfLV8yNV9bQUI5NzFCNzhdJTJFbWt2czgKZmlsZW5hbWVzNDAKYjFmYzQzNzVjNTdkODM1ZGYxN2M2NTJmYzgyOTJhODZmNzEyZmQ2NHM4CnBsZXhIYXNoczcKMTM0OTk3NHM4CmR1cmF0aW9uczUKMTY5MzJzMgppZHIwCg__<br />
2012-08-22 18:34:05,532 (10cc) :  INFO (agentkit:909) - Searching for matches for {'openSubtitlesHash': '4e6d1ee51eb3d5db', 'episode': '25', 'episodic': '1', 'show': 'Kimi Ni Todoke', 'season': '1', 'filename': 'H:%5CTV%20Shows%5CTV%5CKimi%20ni%20Todoke%5C[ANBU-Frostii]_Kimi_ni_Todoke_-_25_[AB971B78]%2Emkv', 'plexHash': 'b1fc4375c57d835df17c652fc8292a86f712fd64', 'duration': '1349974', 'id': '16932'}<br />
2012-08-22 18:34:05,533 (10cc) :  DEBUG (networking:156) - Requesting 'http://127.0.0.1:32400/library/metadata/16932/tree'<br />
2012-08-22 18:34:05,571 (10cc) :  WARNING (data:181) - Error decoding with simplejson, using demjson instead (this will cause a performance hit) - Expecting property name: line 8 column 9 (char 207)<br />
2012-08-22 18:34:05,572 (10cc) :  DEBUG (preferences:259) - Loaded preferences from DefaultPrefs.json<br />
2012-08-22 18:34:05,572 (10cc) :  DEBUG (preferences:181) - Loaded the user preferences for com.plexapp.agents.anidb<br />
2012-08-22 18:34:27,733 (10cc) :  INFO (logkit:16) - Auth exception msg: Command has timed out<br />
2012-08-22 18:34:27,734 (10cc) :  CRITICAL (core:561) - Exception in the search function of agent named 'AniDB', called with keyword arguments {'openSubtitlesHash': '4e6d1ee51eb3d5db', 'episode': '25', 'episodic': '1', 'show': 'Kimi Ni Todoke', 'season': '1', 'filename': 'H:%5CTV%20Shows%5CTV%5CKimi%20ni%20Todoke%5C[ANBU-Frostii]_Kimi_ni_Todoke_-_25_[AB971B78]%2Emkv', 'plexHash': 'b1fc4375c57d835df17c652fc8292a86f712fd64', 'duration': '1349974', 'id': '16932'} (most recent call last):<br />
  File "C:\Users\Satsugai\AppData\Local\Plex Media Server\Plug-ins\Framework.bundle\Contents\Resources\Versions\2\Python\Framework\api\agentkit.py", line 918, in _search<br />
    agent.search(results, media, lang)<br />
  File "C:\Users\Satsugai\AppData\Local\Plex Media Server\Plug-ins\AniDB.bundle\Contents\Code\__init__.py", line 256, in search<br />
    self.doSearch(results, media, lang)<br />
  File "C:\Users\Satsugai\AppData\Local\Plex Media Server\Plug-ins\AniDB.bundle\Contents\Code\__init__.py", line 185, in doSearch<br />
    connection = self.connect()<br />
  File "C:\Users\Satsugai\AppData\Local\Plex Media Server\Plug-ins\AniDB.bundle\Contents\Code\__init__.py", line 54, in connect<br />
    raise e<br />
AniDBCommandTimeoutError: Command has timed out<br />
<br />
2012-08-22 18:34:27,736 (10cc) :  DEBUG (runtime:830) - Response: [200] str, 16 bytes<br />




Not sure what you mean by "defaulting to Open Subtitles"? AniDB is the main agent and it can utilise other secondary agents if you select them, otherwise it's on its own. So you're saying you can automatically and manually search in the movie section, you can manually search in the tv section but you cannot automatically search - am I correct?

If movies and manual search work then I don't see a reason for the agent to fail for automatic search, as it is the same code. Also, it seems like you have set login credentials correctly, otherwise it wouldn't work at all. Can you wait 24 hours without scanning movies or tv shows, restart the Plex server and then retry an automatic search for tv shows and see what happens?

Thanks for the reply. It seems I wasn’t clear, however. Automatic search does not work. Manual search does not work. Restarting Plex does not work (tried this one dozens of times). I’ve had this problem for the past 5 days. Prior to this, it worked fine.



If I open a browser and go to anidb.net, I’m able to search with no problems, and no delays. With that in mind, I wonder if there’s any way to adjust the timeout threshold? I’ll follow your advice and leave it alone for 24 hours, though.



What I meant by defaulting to open subtitles was in the code. This section right here seems to be the problem, in my eyes.



2012-08-23 11:52:04,171 (164c) :  INFO (agentkit:909) - Searching for matches for {'openSubtitlesHash': '4e6d1ee51eb3d5db', 'episode': '25', 'episodic': '1', 'show': 'Kimi Ni Todoke', 'season': '1', 'filename': 'H:%5CAnime%5CKimi%20ni%20Todoke%5C[ANBU-Frostii]_Kimi_ni_Todoke_-_25_[AB971B78]%2Emkv', 'plexHash': 'b1fc4375c57d835df17c652fc8292a86f712fd64', 'duration': '1349974', 'id': '16989'}<br />
2012-08-23 11:52:04,173 (164c) :  DEBUG (networking:156) - Requesting 'http://127.0.0.1:32400/library/metadata/16989/tree'<br />
2012-08-23 11:52:04,226 (164c) :  WARNING (data:181) - Error decoding with simplejson, using demjson instead (this will cause a performance hit) - Expecting property name: line 8 column 9 (char 207)<br />
2012-08-23 11:52:04,229 (164c) :  DEBUG (preferences:259) - Loaded preferences from DefaultPrefs.json<br />
2012-08-23 11:52:04,229 (164c) :  DEBUG (preferences:181) - Loaded the user preferences for com.plexapp.agents.anidb<br />
2012-08-23 11:52:26,443 (164c) :  INFO (logkit:16) - Auth exception msg: Command has timed out<br />
2012-08-23 11:52:26,447 (164c) :  CRITICAL (core:561) - Exception in the search function of agent named 'AniDB', called with keyword arguments {'openSubtitlesHash': '4e6d1ee51eb3d5db', 'episode': '25', 'episodic': '1', 'show': 'Kimi Ni Todoke', 'season': '1', 'filename': 'H:%5CAnime%5CKimi%20ni%20Todoke%5C[ANBU-Frostii]_Kimi_ni_Todoke_-_25_[AB971B78]%2Emkv', 'plexHash': 'b1fc4375c57d835df17c652fc8292a86f712fd64', 'duration': '1349974', 'id': '16989'} (most recent call last):<br />
  File "C:\Users\Satsugai\AppData\Local\Plex Media Server\Plug-ins\Framework.bundle\Contents\Resources\Versions\2\Python\Framework\api\agentkit.py", line 918, in _search<br />
    agent.search(results, media, lang)<br />
  File "C:\Users\Satsugai\AppData\Local\Plex Media Server\Plug-ins\AniDB.bundle\Contents\Code\__init__.py", line 256, in search<br />
    self.doSearch(results, media, lang)<br />
  File "C:\Users\Satsugai\AppData\Local\Plex Media Server\Plug-ins\AniDB.bundle\Contents\Code\__init__.py", line 185, in doSearch<br />
    connection = self.connect()<br />
  File "C:\Users\Satsugai\AppData\Local\Plex Media Server\Plug-ins\AniDB.bundle\Contents\Code\__init__.py", line 54, in connect<br />
    raise e<br />
AniDBCommandTimeoutError: Command has timed out





Well, that code only tells you what metadata is sent to the agent, if you get this from the anidb agent log then it's that agent that's running - not OpenSubtitles. So no searching work, not even for movies? If so, and if you've had this problem "the last five days" then I would say that it's more likely to do with something outside of the agent, since it hasn't been updated in the last five days. Just tested the agent here as well and I can't search either, seems as if something is fishy with AniDB..?

a few of my anime was not being scanned, so i checked log and found this error “INFO (logkit:16) - Could not load file data, msg: [Errno 2] The specified path is invalid: u’\\\MEDIA_SERVER\Public\Anime\Air Gear\Air Gear - 25 - Episode 25.mkv’” seem do me that is has to many “” at start but thats just my none programming 2 cents. anyone no why im getting this error? or how i go about fixing it? full log been attached



Edit: this is on the windows plex server btw



Don't worry about all of the backslashes, that's just how python handles them internally. I see that you use UNC paths to your media library and that won't work I'm afraid. You need to have a mounted drive (e.g. H:) or the agent will fail. Sorry.

Thx for the help i went a head and took your advice and that seemed to work for that problem, but then i ran in to another “INFO (logkit:16) - Auth exception msg: Command has timed out” what ive done is


  1. Checked to make sure user/pass right (was able to login to anidb website)
  2. Make sure com.plexapp.agents.anidb have the correct user/pass
  3. Restart Plex
  4. checked windows firewall to make sure it wasnt blocking the connection
  5. check to see if anidb API is down ( was able to use the API via “AOM” client)
  6. ran out of ideas ;_;
  7. starts to think that anidb banned the client? (if they did it would say you/client are banned not connection timed out…)





    Edit: Found out why i was getting that error. ran a network sniffer will i tryed to scan a anime and this is what came back from anidb



<br />
.Úé+3 ƒtD.R.<br />
Ÿ..E..'..@.2.<br />
%œ2..fÀ¨.þ#(<br />
&”..H¸555 BA<br />
NNED....œÚ.Ÿ<br />




if you cant see the error msg it says "555 BANNED" in other words anidb banned the client for some reason. hope the dev can get it unbanned

Edit 2: here a good read from anidb forums that may give you a idea why that happens... [link](http://anidb.net/perl-bin/animedb.pl?show=cmt&id=43309)


I'll have to check why the client doesn't return 555 to the agent properly, but 555 doesn't mean that the entire client is banned, just your instance (at least according to aniDB's API docs). 504 is client banned. Note though that I haven't developed the client, just modified it for use with my Plex agent.


Not sure if [this](http://anidb.net/perl-bin/animedb.pl?show=cmt&id=44362) is related, but it sure sounds like it. I know that the API behaves strangely from time to time, but I don't know if this is such a time though.

Oh ok i see what you saying. but for some reason something telling me that UDP is timing out is what starts, the down hill spiral of errors (just from what i no about how UDP works).





Edit: Found this code python code about socket pinging dont no if you may be able to get it to work with plex or not or if its any use at all (looks like it time to try to learn python lol)… Link



Well it's not the timeout per se, but it might be that aniDB's API doesn't properly cleanup resources when they're closed so that maximum connection count is reached eventually. Currently the agent keeps a connection open until aniDB's timeout closes it, but I might have to redo that one so that the agent closes it after a certain amount of inactivity.

New version - v9 - out. Changes:


  • Search by aid is now possible. Set name to “aid:xxxx” (where xxxx is aid) in the custom search dialog, right-click menu and “Fix incorrect match”.
  • Proper idle connection timeout handler implemented.

still getting the 555 banned error (not as must but still get time) from what i can tell by the log it looks like it going…


  1. opens a connection with anidb
  2. hash file
  3. send/receive data
  4. if more files goto step 2, if done goto step 5
  5. close connection



    wouldnt it be better and keep it from timing out if it went(seeing as anidb thinks the connection open when its really not)…


  6. hash file
  7. open connection
  8. send/receive
  9. close connection
  10. if more file goto step 1, if done, stop



    ya it maybe a little slower but i think its better then getting the “555 banned” error. just my non programming 2 cents and hope you understand what i was trying to say ^^


Only problem is that your alternative is bascially a step back. AniDB doesn't like when you cycle login/logout for each operation and other users have been banned just by that. Does file hashing really take that long for you? Do you have a slow network connection between the media server and the video files?

There might be a possibility that for some reason aniDB fails to authenticate the connection, but the agent still keep the connection. Your subsequent requests will then use the existing - but non-authenticated - connection. This might lead to 555. I'll see if I can fix this.

i have a full gigabit network, it dont take long to hash a file maybe 10-15 secs… to explain more why i said that. when i order anime alot of times i get box sets or 3-4 volumes at a time. and when i rip them all, then dump them on the media server anidb chokes. but if i rip one volume at a time and dump them, then force a update. it works fine (8/10 times). and thats why i said that.