[Rel] HTTP Anidb Metadata Agent (HAMA)

@gundamguy: you have to refresh all metadata when you change the language settings to update the titles.
Check in anibd title database (anime-titles.xml in plugin data folder) if the title is indeed not english:

<anime aid="217">en official: Mobile Suit Gundam: The 08th MS Team
<title xml:lang="th" type="official">โมบิลสูทกันดั้ม 08th ทีม</title>
<title xml:lang="en" type="short">8th Team</title>
<title xml:lang="en" type="syn">Gundam 08th MS Team</title>
<title xml:lang="x-jat" type="main">Kidou Senshi Gundam: Dai 08 MS Shoutai</title>
<title xml:lang="it" type="syn">Mobile Suit Gundam: L`ottavo plotone</title>
<title xml:lang="en" type="official">Mobile Suit Gundam: The 08th MS Team</title>
<title xml:lang="zh-Hans" type="syn">机动战士高达第08MS小队</title>
<title xml:lang="ja" type="official">機動戦士ガンダム 第08MS小隊</title>
</anime>

-<anime aid="229"> EN official: Mobile Suit Gundam Win
<title xml:lang="x-jat" type="short">Gundam W</title>
<title xml:lang="x-jat" type="syn">Gundam Wing</title>
<title xml:lang="pt-BR" type="official">Gundam Wing</title>
<title xml:lang="es-LA" type="official">Gundam Wing</title>
<title xml:lang="nl" type="official">Gundam Wing</title>
<title xml:lang="de" type="official">Gundam Wing</title>
<title xml:lang="el" type="official">Gundam Wing</title>
<title xml:lang="en" type="syn">Gundam Wing TV</title>
<title xml:lang="x-jat" type="short">GW</title>
<title xml:lang="x-jat" type="short">gwtv</title>
<title xml:lang="pl" type="official">Kombinezon Bojowy Gundam Wing</title>
<title xml:lang="fr" type="official">Mobile Suit Gundam Wing</title>
<title xml:lang="en" type="official">Mobile Suit Gundam Wing</title>
<title xml:lang="en" type="syn">New Mobile Report Gundam Wing</title>
<title xml:lang="en" type="syn">New Mobile War Century: Gundam Wing</title>
<title xml:lang="x-jat" type="main">Shin Kidou Senki Gundam Wing</title>
<title xml:lang="ar" type="official">أجنحة كاندام</title>
<title xml:lang="uk" type="short">Ґандам W</title>
<title xml:lang="zh" type="official">新机动战记高达W</title>
<title xml:lang="ja" type="official">新機動戦記ガンダムW[ウイング]</title>
<title xml:lang="zh" type="short">高达W</title>

Without example we cannot discuss.

Please give me an example of main title you have for the serie and include hama logs after trying to custom match the serie

Hey did somone of you understand German? THis is to much english for me but i want use this guid 2 :slight_smile:

“Serie/tvdb2.id” with tvdbid inside
Or
“Serie/Extras/tvdb2.id” with tvdbid inside
Or
“Serie [tvdb2-xxxxxx]” with xxxxxx being the tvdbid

Hm that meens no i think :frowning:

@clowncracker said:

@ZeroQI said:
Not possible currently
you can create a folder per movie however, or use tvdb3 mode but you will have TVDB seasons in plex
Metadata should be pulling in
I need the agent logs and the scanner filelist to reproduce the issue

Any updates on my issue? I uploaded the agent logs and scanner filelist.

@clowncracker: we did a lot of coding for the tvdb 2 (tvdb seasons ep reset to 0) 3 (tvdb seasons, keep absolute ep number) 4 (absolute ep in nay season, using seasons for arcs) mode in HAMA. Have a look

com.plexapp.agents.thetvdb.log

my agent is Hama and you are using thetvdb agent and it crashes “AttributeError: ‘NoneType’ object has no attribute ‘getitem’” so not my problem. all my calls to thetvdb are self contained into my agent so you are using the wrong agent for the library possibly

com.plexapp.agents.localmedia.log

2016-05-16 17:49:34,967 (5b4) : CRITICAL (core:574) - Exception in the update function of agent named ‘Local Media Assets (TV)’, called with guid ‘com.plexapp.agents.thetvdb://81797?lang=en’ (most recent call last):
File “C:\Program Files (x86)\Plex\Plex Media Server\Resources\Plug-ins-5089475\Framework.bundle\Contents\Resources\Versions\2\Python\Framework\api\agentkit.py”, line 1065, in update
agent.update(obj, media, lang, **kwargs)
File "C:\Program Files (x86)\Plex\Plex Media Server\Resources\Plug-ins-5089475\LocalMedia.bundle\Contents\Code_init
.py", line 140, in update
localmedia.findSubtitles(part)
File “C:\Program Files (x86)\Plex\Plex Media Server\Resources\Plug-ins-5089475\LocalMedia.bundle\Contents\Code\localmedia.py”, line 258, in findSubtitles
for file_path_listing in os.listdir(path):
File “C:\Program Files (x86)\Plex\Plex Media Server\Resources\Plug-ins-5089475\Framework.bundle\Contents\Resources\Versions\2\Python\subsystem\ospathfix.py”, line 105, in os_listdir
return os._listdir(longpathify(uni(path)))
WindowsError: [Error 3] The system cannot find the path specified: u’\\?\D:\Casey\Videos\Anime\One Piece\One Piece [tvdb3-81797]\Season 1 [tvdb3-81797]\.

try to remove “‘Local Media Assets (TV)’” from the agent list for this library

I miss the filelist created by my scanner so i can re-create your library and i also miss the HAMA agent log…
try latest hama version, make sure it is selected as the agent in your library with no “local media assets” agent selected, and return meaningful logs (com.plexapp.agents.localmedia.log ok only when agent doesn’t start but miss HAMA logs and miss scanner filelist for this library)

i cannot get it to show up in my servers agents category. i have moved all the folders (hama.bundle, scanners) from github and the plugin support folder from this post but it doesnt show up i have had it work before but had to reinstall.

my system is a debian server and everything is located in /var/lib/plexmediaserver/Library/Application Support/

Read the readme? because it include the below and you didn’t says anything about that:

Install issue under linux are generally permission issues:
OpenMediaVault (Debian): “sudo chmod 775 -R /var/lib/plexmediaserver”
Synology: “chown -R plex:users” and “chmod -R 700” to solve posters missing

* touch /var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-in Support/Data/com.plexapp.agents.hama/._StoredValues
* chmod 777 /var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-in Support/Data/com.plexapp.agents.hama/._StoredValues
* chown plex:plex /var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-in Support/Data/com.plexapp.agents.hama/._StoredValues
* service plexmediaserver restart

Although the log “com.plexapp.agents.localmedia.log” would say why hte agent isn’t loading…

Well that fixed it thanks i guess my permissions changed after creatign a symbolic link to the plexmedia folder (since meta data got to large xD)
Thanks for such a great project and the fast help :))

Maybe someone can make a Youtube Video how to install all “right”?

@ZeroQI said:
@clowncracker: we did a lot of coding for the tvdb 2 (tvdb seasons ep reset to 0) 3 (tvdb seasons, keep absolute ep number) 4 (absolute ep in nay season, using seasons for arcs) mode in HAMA. Have a look

com.plexapp.agents.thetvdb.log

my agent is Hama and you are using thetvdb agent and it crashes “AttributeError: ‘NoneType’ object has no attribute ‘getitem’” so not my problem. all my calls to thetvdb are self contained into my agent so you are using the wrong agent for the library possibly

com.plexapp.agents.localmedia.log

2016-05-16 17:49:34,967 (5b4) : CRITICAL (core:574) - Exception in the update function of agent named ‘Local Media Assets (TV)’, called with guid ‘com.plexapp.agents.thetvdb://81797?lang=en’ (most recent call last):
File “C:\Program Files (x86)\Plex\Plex Media Server\Resources\Plug-ins-5089475\Framework.bundle\Contents\Resources\Versions\2\Python\Framework\api\agentkit.py”, line 1065, in update
agent.update(obj, media, lang, **kwargs)
File "C:\Program Files (x86)\Plex\Plex Media Server\Resources\Plug-ins-5089475\LocalMedia.bundle\Contents\Code_init
.py", line 140, in update
localmedia.findSubtitles(part)
File “C:\Program Files (x86)\Plex\Plex Media Server\Resources\Plug-ins-5089475\LocalMedia.bundle\Contents\Code\localmedia.py”, line 258, in findSubtitles
for file_path_listing in os.listdir(path):
File “C:\Program Files (x86)\Plex\Plex Media Server\Resources\Plug-ins-5089475\Framework.bundle\Contents\Resources\Versions\2\Python\subsystem\ospathfix.py”, line 105, in os_listdir
return os._listdir(longpathify(uni(path)))
WindowsError: [Error 3] The system cannot find the path specified: u’\\?\D:\Casey\Videos\Anime\One Piece\One Piece [tvdb3-81797]\Season 1 [tvdb3-81797]\.

try to remove “‘Local Media Assets (TV)’” from the agent list for this library

I miss the filelist created by my scanner so i can re-create your library and i also miss the HAMA agent log…
try latest hama version, make sure it is selected as the agent in your library with no “local media assets” agent selected, and return meaningful logs (com.plexapp.agents.localmedia.log ok only when agent doesn’t start but miss HAMA logs and miss scanner filelist for this library)

The metadata for the movies isn’t pulling in correctly. It’s pulling in anidb metadata for movies instead of TVDB (which is the movie numbering you provided previously). I just updated HAMA + ASS today.

No crash, much better. missing the first line for one piece serie to confirm the folder name used though…

The specials numbering used is thetvdb.com one however One piece is in absolute mode so anidb mode so using anidb specials metadata…

Few choices, all involve :
. ‘One Piece [tvdb4-81797]’ will achieve tvdb mode with nay season arangement, episode number stay absolute
. ‘One Piece [tvdb-81797]’ will achieve tvdb mode but expect tvdb seasons, won’t gather metadata beyond the first tvdb season 1 episodes
. ‘One Piece [tvdb2-81797]’ will achieve tvdb mode while using tvdb seasons, ep number resets to 1 each seasons
. ‘One Piece [tvdb3-81797]’ will achieve tvdb mode while using tvdb seasons, ep number stay absolute

Please name the serie folder ‘One Piece [tvdb4-81797]’ and re-match the serie to re-create the guid (so it starts with “tvdb-” and therefore use tvdb metadata for specials).
it will use a single season despite thetvdb using multiple (use tvdb3 if you want seasons used instead despite no seasons indicated in the serie folder)

Hello everyone!
Iam new on this forum and i would like to ask for help. I do everything by manual how to install Hama and ASS but downloading metada for me not working. Folder with metada is empty or incomplete (folder security is fine). So i tried to do new clean installation only with HAMA + ASS but situation is same.

Can i ask for help? I added my personal folder with plex because i am not sure if i have all data in plugin data, scanners etc… I will be very grateful for help :frowning:

https://www.sendspace.com/file/d4db8p

if you see the files in plex, then the scanner part works

Agent logs to include:

  • […]/Plex Media Server/Logs/PMS Plugin Logs/com.plexapp.system.log
  • […]/Plex Media Server/Logs/PMS Plugin Logs/com.plexapp.agents.hama.log

updated the readme to try to make t/s instructions clearer

Scanner goes in scanner/series only
Tvdb4 files are for online pulling no need to copy them
More importantly the agent crashes when running… files look like they are in the right places. Error doesn’t mention hama code. Which python version do you have installed?

There are my “python” files.
First file is in path C:\Users\P…e…t…a\AppData\Local\Plex Media Server\Scanners\Series\Absolute Series Scanner.py
Download link is here
https://www.sendspace.com/file/rmp9xp
Scnd file is in path C:\Users\P…e…t…a\AppData\Local\Plex Media Server\Plug-ins\Hama.bundle\Contents\Code_init_.py
Download link is here
https://www.sendspace.com/file/i65mb8

I used files from
https://github.com/ZeroQI/Hama.bundle/blob/master/Contents/Code/init.py
and from
https://github.com/ZeroQI/Absolute-Series-Scanner/blob/master/Scanners/Series/Absolute%20Series%20Scanner.py

Also here you can found how looks my settings for Anime folder and agetns settings

If you can i can switch language from Czech to English :wink:

I have all your files in the dump, they look fine, in the right places.
Plex Media Scanner.log show no error so scanner loads ok

Logs/PMS Plugins Logs/com.plexapp.system.log show error:

2016-06-28 11:36:04,115 (4fc) :  DEBUG (runtime:717) - Handling request GET /system/messaging/clear_events/com.plexapp.agents.hama
2016-06-28 11:36:04,115 (4fc) :  DEBUG (runtime:814) - Found route matching /system/messaging/clear_events/com.plexapp.agents.hama
2016-06-28 11:36:04,117 (4fc) :  DEBUG (runtime:924) - Response: [200] str, 0 bytes
2016-06-28 11:36:04,207 (734) :  DEBUG (runtime:717) - Handling request GET /:/plugins/com.plexapp.system/resourceHashes
2016-06-28 11:36:04,207 (734) :  DEBUG (runtime:814) - Found route matching /:/plugins/com.plexapp.system/resourceHashes
2016-06-28 11:36:04,210 (734) :  DEBUG (runtime:924) - Response: [200] str, 13276 bytes
2016-06-28 11:36:04,226 (14e8) :  DEBUG (runtime:717) - Handling request GET /:/plugins/com.plexapp.system/messaging/function/X0J1bmRsZVNlcnZpY2U6QWxsU2VydmljZXM_/Y2VyZWFsMQoxCmxpc3QKMApyMAo_/Y2VyZWFsMQoxCmRpY3QKMApyMAo_
2016-06-28 11:36:04,226 (14e8) :  DEBUG (runtime:814) - Found route matching /:/plugins/com.plexapp.system/messaging/function/X0J1bmRsZVNlcnZpY2U6QWxsU2VydmljZXM_/Y2VyZWFsMQoxCmxpc3QKMApyMAo_/Y2VyZWFsMQoxCmRpY3QKMApyMAo_
2016-06-28 11:36:04,242 (14e8) :  DEBUG (runtime:924) - Response: [200] str, 76120 bytes
2016-06-28 11:39:03,411 (508) :  ERROR (networking:217) - Error opening URL 'http://127.0.0.1:32400/:/plugins/com.plexapp.agents.hama/messaging/function/X0FnZW50S2l0OlNlYXJjaA__/Y2VyZWFsMQoxCmxpc3QKMApyMAo_/Y2VyZWFsMQoyCmRpY3QKZGljdAo2CnMyCmVuczQKbGFuZ2IwczYKbWFudWFsYjFzNwpwcmltYXJ5aTAKczcKdmVyc2lvbnIxCnM2Cmt3YXJnc3M3ClRWX1Nob3dzMTAKbWVkaWFfdHlwZTExCnMxNgpiNTJiNjEzZmNhYzNhZDFkczE3Cm9wZW5TdWJ0aXRsZXNIYXNoczIKMjRzNwplcGlzb2RlczE0CkFrYW1lIGdhIEtpbGwhczQKbmFtZXMxCjFzOAplcGlzb2RpY3MxNApBa2FtZSBnYSBLaWxsIXM0CnNob3dzMQoxczYKc2Vhc29ubnM0CnllYXJzMTAzCkUlM0ElNUNGdWxsSEQlNUNBbmltZSU1Q0FrYW1lJTIwZ2ElMjBLaWxsISU1Q0FrYW1lJTIwZ2ElMjBLaWxsISUyMC0lMjAyNCUyMC0lMjBBa2FtZSUyMGdhJTIwS2lsbCElMkVta3ZzOApmaWxlbmFtZXM0MApkOTBjMWEyN2ZhYjg0MmI2ZjZkMTkwMDQxNzVjMmU1MDE3MjlhYjk3czgKcGxleEhhc2hzMgotMXM4CmR1cmF0aW9uczQKMzczM3MyCmlkcjAK'

Logs/PMS Plugins Logs/com.plexapp.agents.hama.log
2016-06-28 11:39:04,273 (1070) : DEBUG (networking:166) - Requesting ‘http://127.0.0.1:32400/:/plugins/com.plexapp.system/messaging/function/X0J1bmRsZVNlcnZpY2U6QWxsU2VydmljZXM_/Y2VyZWFsMQoxCmxpc3QKMApyMAo_/Y2VyZWFsMQoxCmRpY3QKMApyMAo_
2016-06-28 11:39:04,276 (1374) : CRITICAL (core:574) - Exception while loading code (most recent call last):
File “C:\Program Files (x86)\Plex\Plex Media Server\Resources\Plug-ins-a17e99e\Framework.bundle\Contents\Resources\Versions\2\Python\Framework\core.py”, line 563, in load_code
self.init_code = self.loader.load(self.init_path, elevated, use_xpython = Framework.constants.flags.use_xpython in self.sandbox.flags)
File “C:\Program Files (x86)\Plex\Plex Media Server\Resources\Plug-ins-a17e99e\Framework.bundle\Contents\Resources\Versions\2\Python\Framework\code\loader.py”, line 47, in load
code = self.compile(str(source), str(uni(filename)), elevated)
File “C:\Program Files (x86)\Plex\Plex Media Server\Resources\Plug-ins-a17e99e\Framework.bundle\Contents\Resources\Versions\2\Python\Framework\code\loader.py”, line 52, in compile
return RestrictedPython.compile_restricted(source, name, ‘exec’, elevated=elevated)
File “C:\Program Files (x86)\Plex\Plex Media Server\Resources\Plug-ins-a17e99e\Framework.bundle\Contents\Resources\Platforms\Shared\Libraries\RestrictedPython\RCompile.py”, line 115, in compile_restricted
gen.compile()
File “C:\Program Files (x86)\Plex\Plex Media Server\Resources\Plug-ins-a17e99e\Framework.bundle\Contents\Resources\Platforms\Shared\Libraries\RestrictedPython\RCompile.py”, line 68, in compile
tree = self._get_tree()
File “C:\Program Files (x86)\Plex\Plex Media Server\Resources\Plug-ins-a17e99e\Framework.bundle\Contents\Resources\Platforms\Shared\Libraries\RestrictedPython\RCompile.py”, line 59, in _get_tree
tree = self.parse()
File “C:\Program Files (x86)\Plex\Plex Media Server\Resources\Plug-ins-a17e99e\Framework.bundle\Contents\Resources\Platforms\Shared\Libraries\RestrictedPython\RCompile.py”, line 56, in parse
return niceParse(self.source, self.filename, self.mode)
File “C:\Program Files (x86)\Plex\Plex Media Server\Resources\Plug-ins-a17e99e\Framework.bundle\Contents\Resources\Platforms\Shared\Libraries\RestrictedPython\RCompile.py”, line 38, in niceParse
compile(source, filename, mode)
TypeError: compile() expected string without null bytes

Hama crashes no even when running but when loading the first time.
That is either a right issue on your pc, a python issue, but it seems unique to your pc…

https://forums.plex.tv/discussion/55362/plex-causing-python-to-repeatedly-crash seem to imply updating the plex media server could solve this type of issues

Can you install another agent and see if it works ?
If so, then try to remove "urllib, " from line 59:
import os, re, time, datetime, string, thread, threading, urllib, copy # Functions used per module: os (read), re (sub, match), time (sleep), datetim (datetime).

posters now showing , could you guide me how to fix this issue ?