[Rel] HTTP Anidb Metadata Agent (HAMA)

Hi are you asking me what I meant by “OP”? In your “original post”, the link is now broken.

@ frazhp either plex did them and it’s not the agent problem or TheTVDB provided them and if it is in a single resolution we can’t increase it.

@https://forums.plex.tv/u/ataribaby keeping the link, can’t point it to a better location

@Ramzilla95

  • The agent pick the first language found that match using “TheTVDB, AniDB” for series title, then “TheTVDB, AniDB” for episode titles.
  • x-jat (or better ‘main’) only exists for Anidb.

s01e11 should come from thetvdb and it sees it then when come the looping over the dict says it can’t from thetvdb… a bug to investigate…
[?] rank: 0, source_title: AniDB, title: “Once Upon a Time… in Garterbelt / Nothing to Room”

How can I confirm if the thumbnails came from Plex or TVDB?

Hi

So when you list deleting the library as a troubleshooting step, do you mean this? https://support.plex.tv/articles/200289286-deleting-libraries/

I have a lot of custom stuff in there and would hate to have to recreate all of it, but I will if that’s necessary. Just want to make sure that’s the thing I need to do.

skip recreating library. you can create a new one for tests though…

Question - I’ve been using Absolute Series Scanner and Hamatv for over a year now and by force matching each of my anime with the [anidb-XXXX] I’ve had no problem populating my metadata until very recently. Now all of the new folders I name just as I did the old ones no longer match to anything and the title of the anime within plex’s interface also shows the text of the [anidb-XXXX] It’s doing this for every anime I have added, though the old ones are still perfectly fine, and as far as I know I haven’t changed any settings or changed the way I name folders/their location this entire time. Do you know what may cause this?

That’s usually an issue of the agent itself dying due to error while trying to update. The [source-id] visible in Plex is replaced by the actual title retrieved from the metadata endpoint, but that doesn’t happen if it dies midway through so that raw [source-id] isn’t cleaned up. If you haven’t updated HAMA in awhile, I suggest you grab a new release zip and drop it in and give it a whirl.

Sorry for the late reply, kinda weird that the forum never sent me a notification. Anyway…

I think I finally fixed my issue. I wasn’t aware that for the ‘title’ option that the first half represented the “Series Title” options and the second half was for the “Episode Title” options. I promptly switched “AniDB, TheTVDB | TheTVDB AniDB” to “AniDB, TheTVDB | AniDB, TheTVDB” and that gave me exactly what I wanted. Correct English episode titles. I then switched the ‘summary’ section from “TheTVDB AniDB” to “AniDB, TheTVDB” in order to get the proper episode summaries as well. TheTVDB, for whatever reason, split the episodes by the individual stories, whereas AniDB kept the stories that aired together in the same episode.

I’m having a different issue now. One that I believe was brought up before and that you responded to but was ultimately closed due to the other person never responding back: Incorrect image matching · Issue #156 · ZeroQI/Hama.bundle · GitHub

Perhaps Dragon Ball Z: Kami to Kami (Battle of Gods) is just a tricky one in general because it is all around buggy.


And as you can tell, it takes art from Dragon Ball Z the tv show and not from Kami to Kami. Not sure why this is the case since I choose the x-jat Dragon Ball Z: Kami to Kami option whenever I match.

From what I’ve seen, it appears to be an issue with TheTVDB, but why would the episode summary come from TheTVDB when I explicitly have AniDB as the first source for episode summaries?

Here are the logs: root.agent-search.log (2.7 KB)
root.agent-update.log (102.0 KB)
_root_G -Videos-Anime.filelist.log (17.8 KB)
_root_G -Videos-Anime.scanner.log (72.7 KB)
com.plexapp.agents.hama.log (124.2 KB)
com.plexapp.system.log (447.6 KB)

@Ramzilla95: Both search and update logs provided are for G:\Videos\Private Shows\Love, Chunibyo & Other Delusions! … You didn’t check the logs before attaching it seems

Prefs[title ] = AniDB, TheTVDB | AniDB, TheTVDB (Default: AniDB, TheTVDB | TheTVDB, AniDB)

  • Prefs[summary ] = AniDB, TheTVDB (Default: TheTVDB, AniDB)
    Prefs[EpisodeLanguagePriority] = en, x-jat, ja (Default: x-jat, en, ja)
    Prefs[SerieLanguagePriority ] = en, x-jat, ja (Default: x-jat, en, ja)
    Prefs[posters ] = tvdb4, TheTVDB, TheMovieDb, FanartTV, AniDB (still default value)
  • Plex match to an id (AniDBgenerally, or TVDB if forced or multiple seasons), language doesn’t matter. tvdb info is matched to AniDB
  • x-jat should be replaced soon with ‘main’ to account for korean and chinese anime

The series summary comes from AniDB as expected [https://anidb.net/perl-bin/animedb.pl?show=anime&aid=9314]

The episode summary comes from TheTVDB as expected since AniDB has no episode summary for it (rarely does) [ https://anidb.net/perl-bin/animedb.pl?show=ep&eid=140948]

Please read the series log HAMA generated as it would have shown that clearly AniDB had no summary by saying Inside: ‘[‘TheTVDB’]’ rather than Inside: ‘[‘TheTVDB’, ‘AniDB’]’

Your movie is matched to TheTVDB series so working as designed

Ah. I completely misread the readme file for Hama. I tend to take instructions a bit too literally, so when it says to provide the “root_folder…” I thought the file had to literally be named that. That’s my bad. I believe these should be the files you’re looking for then?

root.agent.log (377.2 KB)
Dragon Ball Z - Kami to Kami.agent-search.log (15.8 KB)
Dragon Ball Z - Kami to Kami.agent-update.log (152.2 KB)

I also completely forgot about the ‘posters’ value, so my bad on that too.

Should the “AnimeLists” in this ‘studio’ value be changed to “MyAnimeList” like in other values? I just noticed while replying and thought it might help to explain why I had the wrong Studio name pop up for the movie entry.
'studio'%20value

So, here’s my final question: is there a way for the movie to match to the AniDB entry? It looks like the Creditless Ending (S3 on AniDB so S00E03 should be the correct numbering, right?) is being registered as “The Tree of Might” despite that not even being a part of Dragon Ball Z: Kami to Kami’s AniDB page.

Thanks for the help.

The plug-in works pretty well for me, picking up material that didn’t show up with the standard TV Series scanner.

I have one show that is not behaving as expected: Anime: Nodame Cantabile: Finale

I can’t match it to this anidb record, and instead matches to the overall series and creates duplicate versions of original series episodes: Nodame Cantabile

I guess it is a naming issue, but I can’t figure out the correct naming structure. Can anyone help and advise?

EDIT: Hmmm, if I fix match and search specifically for “Nodame Cantabile: Finale [main(x-jat)] [anidb-7019]73” I can select it, but it still matches with the regular Nodame Cantabile from 2007…

Is it possible to get age ratings from a different source than TVDB? I’ve been adding my anime to my library and it’s been a pretty smooth process so far, but I’ve noticed the age ratings being weird for some shows.

Welcome to the NHK is rated TV-PG, for example. MyAnimelist has this show as R+. It’s not the end of the world, but as this library most likely will be accessed by a couple of young cousins of mine, I’d prefer not having to correct this manually.

I am having a problem with the latest season of Attack on Titan. On AniDB, this season is listed as Shingeki no Kyojin Season 3 (2019).

I have each season stored in a folder as named by AniDB with an anidb2.id file with the appropriate id so that they all get grouped together in Plex and mapped to the TVDB season.

Shingeki no Kyojin
Shingeki no Kyojin Season 2
Shingeki no Kyojin Season 3
Shingeki no Kyojin Season 3 (2019)

For the first 3 this is working fine, and I properly see them in Plex mapped to the correct TVDB seasons. The newest season is showing up as its own entry Shingeki no Kyojin Season 3 (2019)

Would this be an issue with the HAMA agent or the Absolute Series Scanner (or both)?

I’ve usually been able to work out any kinks myself but I can’t seem to figure out how to get this one to work.

Anidb2 tagging mode uses the scudlee list to map anidb to thetvdb and translate it into Plex as a single entry for a series. An entry hasn’t been added yet to the scudlee list for AoT S3 Part2/2019 (anidb ID 14444), so it can’t map it properly and defaults back to just adding to Plex using the matched anidb data, which is considered a separate entity, rather than mapping it to thetvdb entry you currently have in Plex for the rest of the series.

You can wait for it to be added to the scudlee list, or manually create a text file in the directory named “anime-list-custom.xml” and add this info to the file:

<?xml version="1.0" encoding="utf-8"?>
<anime-list>
  <anime anidbid="14444" tvdbid="267440" defaulttvdbseason="3" episodeoffset="12">
    <name>Shingeki no Kyojin Season 3 (2019)</name>
  </anime>
</anime-list>

Since it already has been added to Plex, to get it to redetect after doing one of the above (once it has been added to scudlee or you add it yourself using the custom xml file), you’ll need to Plex Dance the directory to get it to be re-added correctly now.

@deusxanime Thanks! That’s exactly what I needed. Working perfectly now.

Hi,

I have just done a fresh install and installed the Hama Bundle, Series scanner and the folders.
I have the agent running on another server and compared the install but cant seem to find whats wrong

Created Folders - https://gyazo.com/2b53c166dabb229b30c7ddf4a8b65eed

I am able to select the scanner on my anime folder but it does not seem to match any data or artwork example here - https://gyazo.com/ba955f4e951db4f165a47e5e8d1c9bef

Logs attached

root.agent.log (1.4 MB)
root.scanner.log (311 Bytes)
_root_A -Anime.filelist.log (10.1 KB)
_root_A -Anime.scanner.log (10.9 KB)
com.plexapp.agents.hama.log (381.1 KB)
com.plexapp.system.log (34.6 KB)

*I also tried a complete de-install re-install of plex. including the registry but still no joy.

I’m having the same issues as @letthiswork Except I was not on a fresh install, it just suddenly stopped working.

It will not match anything. Searching a match does not give any results back. I can force a match using anidb-id. But then it does not fetch any artwork etc (so I guess its using the local cache?)

I’ve checked the hama.log from the person above me and they seem to be related. Here’s an example.

2019-05-01 21:20:05,698 (7fe4337fe700) :  CRITICAL (agentkit:1014) - Exception in the search function of agent named 'HamaTV', called with keyword arguments {'show': 'Shingeki no Kyojin Season 3 (2019)', 'id': '74714', 'year': '2019'} (most recent call last):
  File "/usr/lib/plexmediaserver/Resources/Plug-ins-cc260c476/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/api/agentkit.py", line 1007, in _search
    agent.search(*f_args, **f_kwargs)
  File "/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-ins/Hama.bundle/Contents/Code/__init__.py", line 151, in search
    def search (self, results,  media, lang, manual):  Search (results,  media, lang, manual, False)
  File "/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-ins/Hama.bundle/Contents/Code/__init__.py", line 100, in Search
    if movie or max(map(int, media.seasons.keys()))<=1:  maxi, n =         AniDB.Search(results, media, lang, manual, movie)
  File "/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-ins/Hama.bundle/Contents/Code/AniDB.py", line 45, in Search
    for element in AniDBTitlesDB.xpath(u"/animetitles/anime/title[text()[contains(lower-case(.), '%s')]]" % orig_title.lower().replace("'", " ")):
AttributeError: 'str' object has no attribute 'xpath'

EDIT: Seems to be a known issue. https://github.com/ZeroQI/Hama.bundle/issues/302

That might make sense if they are saying its related to AniDB.

I installed a pure Anidb Agent which links to my AniDB acc and it also fails.

when i changed to TVDB it works straight away. But obviously the matches are terrible and i am missing like 50 titles lol

I got it to work using the fix they have there, HOWEVER, getting the “Absolute Series Scanner.py” from 5 days ago completely broke my scanning. It would give me the error message in my log “we got error scanning in [top folder]”. Nothing I did would fix this except reverting my “Absolute Series Scanner.py” back to the 2017 version that I had been using just fine. I only grabbed the update since I figured I might as well while updating the rest of the Agent. But yeah, if anyone tries that fix and new files won’t get detected, try reverting the scanner file itself to an older version. I have no idea what Zero changed that broke it for me and I have no idea how to contact Zero about this massive bug.

I’ve been struggling to get HAMA working for a while now without any luck. No episodes are matched and appending the anidb ID to the folder name (i.e. ‘Series_anidb-xxxxx’) doesn’t seem to work.

In the Plex Console, when attempting to match a series, there’s this error:

May 03, 2019 11:18:11.039 [0x7fdb5dffb700] Debug — HTTP 404 response from GET http://127.0.0.1:33915/system/agents/search?mediaType=2&id=17435&identifier=com.plexapp.agents.hama&duration=1405061&episodic=1&filename=%252Fmnt%252FDAS%252FAnime%252FCells%2520at%2520Work!%252FSeason%25201%252F[AnimeKaizoku]%2520Hataraku%2520Saibou%2520-%252013%2520[1080p][dedsec]%252Emkv&lang=en&openSubtitlesHash=2aef16f6d12182fe&plexHash=56df64bd1bd0297ad31d7ff8e1aa22bb1e203d96&episode=13&episodic=1&name=&season=1&show=Cells%20at%20Work!&year=&manual=1

May 03, 2019 11:18:11.039 [0x7fdb5dffb700] Debug — [com.plexapp.system] HTTP reply status 404, with 0 bytes of content.

May 03, 2019 11:18:11.043 [0x7fdb5d7fa700] Debug — HTTP 404 response from GET http://127.0.0.1:32400/system/agents/search?mediaType=2&id=17435&identifier=com.plexapp.agents.hama&duration=1405061&episodic=1&filename=%252Fmnt%252FDAS%252FAnime%252FCells%2520at%2520Work!%252FSeason%25201%252F[AnimeKaizoku]%2520Hataraku%2520Saibou%2520-%252013%2520[1080p][dedsec]%252Emkv&lang=en&openSubtitlesHash=2aef16f6d12182fe&plexHash=56df64bd1bd0297ad31d7ff8e1aa22bb1e203d96&episode=13&episodic=1&name=&season=1&show=Cells%20at%20Work!&year=&manual=1

May 03, 2019 11:18:11.043 [0x7fdb5d7fa700] Error — Error parsing content.
May 03, 2019 11:18:11.043 [0x7fdb5d7fa700] Error — Exception caught while attempting to match metadata on item 17435: Error parsing file
May 03, 2019 11:18:11.043 [0x7fdb5d7fa700] Error — XML was (0 bytes):


I’ve rechecked the folder structures and files (to my best understanding of the git readme), made sure that user plex is the owner of all files & folders in the ‘Plex Media Server’ folder, and I’m frankly out of ideas.
Any help would be much appreciated.

PS: If it matters, my Plex Server is running Ubuntu 18.04 and the latest version of Plex Media Server (Version 1.15.4.993)


Log Files:
com.plexapp.agents.hama.log (38.8 KB)
com.plexapp.system.log (45.8 KB)
root-mnt-DAS-Anime.filelist.log (6.8 KB)
root-mnt-DAS-Anime.scanner.log (521 Bytes)