[Rel] HTTP Anidb Metadata Agent (HAMA)

there was an issue recently, update to latest version and delete anidb xml title database cache file manually.

Ah! Yeah, that seemed to do the trick.

Thanks!

Hello,

Been having issues recently where some of the posters for anime are not loading and when I go to do a fix match Nothing loads. I set it up back in December and it’s worked fine until now.

As for Troubleshooting Steps
-I tried updating to the latest Absolute Series Scanner, Hama and Plex.
-Instead of recreating my library, I tried creating another library but none of the posters loaded at all and the fix match did not work as well.
-Took a look through the logs to see if I could figure out what was causing it however this was the only error I noticed and could not figure out how to resolve it

2019-05-03 22:34:13,539 (1418) :  CRITICAL (core:574) - Exception in the update function of agent named 'HamaTV', called with guid 'com.plexapp.agents.hama://anidb-12665?lang=en' (most recent call last):
  File "C:\Program Files (x86)\Plex\Plex Media Server\Resources\Plug-ins-bb4a2cb6c\Framework.bundle\Contents\Resources\Versions\2\Python\Framework\api\agentkit.py", line 1076, in _update
    agent.update(obj, media, lang, **kwargs)
  File "C:\Users\NAS\AppData\Local\Plex Media Server\Plug-ins\Hama.bundle\Contents\Code\__init__.py", line 152, in update
    def update (self, metadata, media, lang, force ):  Update (metadata, media, lang, force,  False)
  File "C:\Users\NAS\AppData\Local\Plex Media Server\Plug-ins\Hama.bundle\Contents\Code\__init__.py", line 124, in Update
    dict_AnimeLists, AniDBid, TVDBid, TMDbid, IMDbid, mappingList =  AnimeLists.GetMetadata(media, movie, error_log, metadata.id)
  File "C:\Users\NAS\AppData\Local\Plex Media Server\Plug-ins\Hama.bundle\Contents\Code\AnimeLists.py", line 212, in GetMetadata
    title = AniDB.GetAniDBTitle(AniDB.AniDBTitlesDB.xpath('/animetitles/anime[@aid="{}"]/title'.format(anime.get("anidbid", ""))))[0]  #returns [title, main, language_rank]
AttributeError: 'str' object has no attribute 'xpath'

Not sure how to fix that one but it seems to spit out that error anytime I try to do a fix match or refresh the metadata on something without the poster.

I have attached all the logs requested in the readme and a picture of the issue to this post as well.

Any help would be greatly appreciated.
Logs.zip (589.8 KB)

Same as above. Latest Hama and delete manually anidb title XML cache file

Hello. I just installed HAMA but the agent is not showing up under Settings > Agents > Shows. I saw a similar issue way near the top of this thread. However, this solution did not work:

I couldn’t find “Application Support” in the Library section of settings in the Plex GUI. Navigating to the Plex Media Server/Plug-ins/Hama.bundle/Contents directory indeed showed the contents as

Code  DefaultPrefs.json  Info.plist Resources

but your instructions were unclear as to what needed to be done to fix the issue (e.g. what to edit in these files).

I’m running my Plex server on Arch Linux, so I used the AUR Package to install HAMA, since it looked like the PKGBUILD automatically put things in the right directories. I did notice there were a couple missing directories in the DataItems folder after installing, but manually creating these directories did not fix the issue.

I have tried restarting Plex using systemctl restart plexmediaserver many times and I even updated to the latest version, but it’s still not showing up under Agents, and Manage > Plugins says I have no plugins installed.

For debugging purposes I have included the output of tree in both the “Plug-ins” directory and the “Plug-in Support” directory in case there’s still something wrong with the directory structure:
plugins-tree.txt (35.5 KB)
plugin-support-tree.txt (521.3 KB)
As far as permissions, I have /var/lib/plex/Plex Media Server/ and all subdirectories set to 755 for directories and 644 for files. The same is true of my actual Plex libraries.

Thank you for your amazing work developing this user agent. I had been wishing for AniDB support in Plex for a long time and only just now found this. I will consider donating if I can afford it.

Hama is a plex agent that is os agnostic.
there is no longer a need for folders in agent data folders, they are automatically created and would on old versions caused no posters.
I need the plex logs listed in the troubleshooting section of the readme.

  • [
]/Plex Media Server/Logs/PMS Plugin Logs/com.plexapp.agents.hama.log (Agent logs)
  • [
]/Plex Media Server/Logs/PMS Plugin Logs/com.plexapp.system.log (show why the agent cannot launch)

com.plexapp.agents.hama.log (5.9 KB)
com.plexapp.system.log (40.6 KB)

IOError: [Errno 13] Permission denied: ‘/var/lib/plex/Plex Media Server/Plug-in Support/Data/com.plexapp.agents.hama/._StoredValues’
File system permissions errors

hmmm
 looking at that directory there is no ._StoredValues when I ls -a, so it would seem that the plex user didn’t have write access in that directory to create the file.

I’ll try setting all the permissions to 777 to see if that fixes it.

Alright that worked. I hate setting permissions to 777 as this is essentially giving up on figuring out what the exact permission issue is, but now that it works I don’t feel like changing itℱ. Thanks for your help.

This did bring up another question though. I have a one-episode OVA called “Sequence” from 1992 (https://anidb.net/perl-bin/animedb.pl?show=anime&aid=5015), which it correctly identified and scraped metadata from anidb, but as there is no TVDB or TMDB listing it doesn’t have a cover or episode thumbnail. The readme says posters come from TVDB by default due to fixed sizes, but is there any way to have Anidb posters be a fallback if there are none from TVDB or do I have to download them manually?

If this question has been answered before, all I would need is a pointer to where the answer is.

This cache file is 
\Plex Media Server\Plug-in Support\Data\com.plexapp.agents.hama\DataItems\AniDB\anime-titles.xml correct? I wanted to make sure I deleted the correct file and didn’t mess something up. Tried doing a quick search but wasn’t able to find the file path.

that’s the one. you need latest Hama as well

plex.zip (946.2 KB)


Hello once again!
I have followed all of the steps in the README on the github and I tried to find as many of the files as possible to send you. The problem I was having was the new files being added weren’t being matched up with the folder they were in. They were creating it as a new file seperately and no data was being pulled. So I deleted the folder and started from scratch via the README. Now all of my content that doesn’t have an anidb number show up blank with no information and when I try to match them it shows zero results.

Any help is greatly appreciated

Thank you

THANK YOU! I’ve been having this problem intermittently the past couple week. But the past couple days hama wasn’t working at all. This finally fixed it!

ok so I deleted the xml file and it’s loading the information now. What exactly caused this issue?

Why is it that it will sometime not grab the latest episode title?

For example:

  • Dororo - Episode 17 - The Story of Questions and Answers [Aired 6th of May]

When “Refresh Metadata” is used it will either not grab the episode name at all or it will grab the date the episode was released. (Only for recently aired)

HamaTV agent has matched with the AniDB source as well as me having AniDB as my prefered source for episode titles, so I don’t see why it will sometimes take over a week for the episode name to be fetched.

Having the name fetch so late causes me having to go to Tautulli (former Plex.py) and manually edit the episodes watched so it matches the new name when it finally gets one (otherwise it will not work properly).

Otherwise, great service, ohh and I tried reinstalling as well.

Sincerely, Soitora

if you can tell me an exemple of when an episode airs and when the title is updated in AniDB, i can optimize the cache period.


@ cbanks79 the file needs to be double decompressed now, could be because the size just went above 1024KB. issue is, it saved a compressed version, hence the issue. after cache period, pass we should be ok but downloading twice in a day result in a 1 day ban

I did the Plex dance just before writing this as well as looking up the dates added on AniDB.
It still won’t add the episode title and just set it as “Episode 17” (nameless).

  • Episode aired the 6th of May, 15:00 UTC
  • Episode title was added the 8th of May, 11:07 UTC
  • Plex Dance was performed the 8th of May, 12:04 UTC
  • Plex Dance was performed the 9th of May, 14:05 UTC
  • Plex Dance was performed the 10th of May, 23:35 UTC
  • Plex Dance was performed the 11th of May, 23:00 UTC
  • Plex Dance was performed the 13th of May, 15:08 UTC

The Plex Dance is tested with episode 16 and 17 at the same time so I’m sure it still finds at least a title.

I’ll edit this message again when it works sucessfully, but it has gone more than 48 hours since the title was added and it still won’t find it which I think is a bit too long.

EDIT: I looked into the ~\Plex Media Server\Plug-in Support\Data\com.plexapp.agents.hama\DataItems\AniDB\xml folder and then th 13946.xml file for Dororo. It hasn’t been updated since 7th of May, 11:15 UTC. When I go into the file I see this:

<episode id="214268" update="2019-03-25">
<epno type="1">16</epno>
<length>25</length>
<airdate>2019-04-29</airdate>
<rating votes="5">7.32</rating>
<title xml:lang="ja">しらくいた添</title>
<title xml:lang="en">The Story of Shiranui</title>
<title xml:lang="x-jat">Shiranui no Maki</title>
</episode>
<episode id="214901" update="2019-04-08">
<epno type="3">C2</epno>
<length>2</length>
<airdate>2019-04-08</airdate>
<rating votes="1">1.17</rating>
<title xml:lang="en">Opening 2</title>
</episode>
<episode id="214902" update="2019-04-08">
<epno type="3">C4</epno>
<length>2</length>
<airdate>2019-04-08</airdate>
<rating votes="1">1.01</rating>
<title xml:lang="en">Ending 2</title>
</episode>
<episode id="216042" update="2019-04-24">
<epno type="1">17</epno>
<length>25</length>
<airdate>2019-05-06</airdate>
<rating votes="1">8.34</rating>
<title xml:lang="ja">ć•ç­”ăźć·»</title>
<title xml:lang="en">Episode 17</title>
<title xml:lang="x-jat">Mondou no Maki</title>
</episode>
<episode id="216043" update="2019-04-24">
<epno type="1">18</epno>
<length>25</length>
<airdate>2019-05-13</airdate>
<title xml:lang="en">Episode 18</title>
</episode>

Looking into the log files it looked like anime-titles.xml was the issue here, I’ve updated to latest HAMA again and for now it grabbed the episode 17 title, I’ll try to document and see how long it will take for 18 as well.

Sincerely, Soitora

I’m having a problem with HAMA not downloading any metadata (posters, descriptions, episode titles). I tried following some of the ways to try and fix it like what was in the README file and deleting the anime-titles.xml but nothing seems to work. I even reset windows and made a fresh server version with the newest Agent and scanner and it is still not allowing me to get the data. If I use the Plex Series Scanner and the TVDB Agent I will start getting information piled in but some of my animes aren’t coming up correctly using this method.

com.plexapp.agents.hama.log (937.4 KB)

com.plexapp.system.log (22.5 KB)

EDIT I fixed it by downloading manually the anime title.

now it is working if I go to any element and select “more options” --> Fix match. There I can choose the correct match and the data will be downloaded.

However, if I click in Scan Library Files, it wont work.

Am I doing something wrong?