[Rel] HTTP Anidb Metadata Agent (HAMA)

Hello ZeroQi, thanks for the great job! I tried it today with few episodes. Most of them show up correctly but one looks weird. I tried to change the series to 01,02,03… or E01, E02, E03… neither of them work. I also changed the folder name and didn’t success as well.
Folder name: 2017 Princess Principal.[BDRIP][1080P][1-12Fin+SP]
Files name: Princess.Principal.E01.[BDRIP][1080P][H264_FLAC_AC3x2]

Don’t know how to fix it or any place I can find a log to copy and past here?

Attached the screen captures here.

Thanks!


Try to rename the folder “Princess Principal [anidbid-13031]”

Still the same result :worried:

The problem is not in the naming. You may have missed something during the install of HAMA or in the settings of the Plex folder.

I’ve just used a dummy 12ep series and renamed exactly the way your files are named and it just worked at my side :

Archive%202018-10-09%2018-33-25

Plex%202018-10-09%2018-34-25

Plex%202018-10-09%2018-37-42

That was so strange. I double confirmed every setting and re-scan the folder but nothing changed, then I removed it from the library and add it again, guess what, it works now! Thanks a lot for the help!

Hi, doen’t find the info anywhere, how should I format the name of the anime file when there’s a version in it, for example : AnimeX - 01v2 - EpisodeName (AnidbCRC).extension

the regex in absolute series scanner give supported formats
Use square brackets as the conv=tent gets scrapped. use parenthesis for year
In this case: AnimeX - 01v2 - EpisodeName [AnidbCRC].extension

Thanks so I’ll keep the 00vX format format version file above 1, and keep parenthesis only for year purpose.

Since you’re here, I have 2 little extra questions :

  • #1 : Currently I have [anidbid-XXXX] tag in folder name for each anime (as Anime I mean as Anidb entries), in absolute scanner doc it says to use [anidb-XXXX] without the “id” part in the name, but while scanning with plex it shows [anidbid-XXXX], did I mess a bit by adding the “id”. Should I rename that way : [anidb-XXXX] ?
  • #2 : I was a bit concerned of using [anidb2-XXXX] instead of [anidb-XXXX] (type 2 vs type 1). Is TVDB mapping part in best effort mode, for example if I have 5 anime with 5 anidb entries but for an unknown reason it’s mapped as 4 season in TVDB and the fifth season doesn’t exist or as a separated series ? I currently have trouble with collection not building up as expected, I thought that maybe Type 2 scanning may be an interesting approach to aggregate entries in Plex.

it’s just stated : " * " [anidb2-xxxxx]" will find the season & eposide offset defiend in the ScudLee file and add into Plex with it’s corresponding TVDB series/season/episode numbers" but there’s no real mention of what happen if not all the episodes or a complete season in not in TVDB or in scudlle file

SOURCE_IDS             = cic(r'\[((?P<source>(anidb(|[2-4])|tvdb(|[2-5])|tmdb|tsdb|imdb|youtube(|2)))-(?P<id>[^\[\]]*)|(?P<yt>(PL[^\[\]]{16}|PL[^\[\]]{32}|(UU|FL|LP|RD|UC|HC)[^\[\]]{22})))\]')
SOURCE_ID_FILES        = ["anidb.id", "anidb2.id", "anidb3.id", "anidb4.id", "tvdb.id", "tvdb2.id", "tvdb3.id", "tvdb4.id", "tvdb5.id", "tmdb.id", "tsdb.id", "imdb.id", "youtube.id", "youtube2.id"]      #

#1 - i say in the documentation to do it one way and you do it another?
Do not put ‘id’ so use: [anidb-XXXX], like you do in [anidb2-XXXXX]…
where does it say while scanning with [anidbid -XXXX]? i cannot find anything of the sort in logs. Logs also indicate if it read the forced id or not so you could have checked this way.

#2 anidb2 use series using anidb numbering convention and display them like thetvdb. If there is a new season and it’s not yet in the tvdb ADD IT. The source code is open, 1000 lines for the scanner… the scanner will translate the a nidbid into a tvdb id offsetting the episode and seasons
if the tvdbid for that anidbid isn’t know it is going to stay a separate series, with metadata or not…
Anidb2 is a hack so you do not do the offset manually, relies on the mapping file and tvdb being accurate.

“I currently have trouble with collection not building up as expected”

  • How did you expect it to build?
  • What’s the collection field metadata source order string in agent settings?

Thanks for your feedback, " anidbid" came from when Plex is scrobbling the folder while (I assume) building the metadata, the shows name change temporary with [anidbid-XXXX] in the end, maybe I was drunk a lot. So I’ve renamed that way before RTFM the github page of abosolute scanner (my bad :p)

To your answers :

  • you say “if the tvdbid for that anidbid isn’t know it is going to stay a separate series, with metadata or not…” So if my series is added before any cross reference between TVDB and anidb is made, it’ll stays the way it is, even with a metadata refresh ? I’ve never commit changes on Scudlee list, I’m more a TheXem contributor, I’ll look into it.

To your questions :

  • Regarding collections, maybe my bad renaming with anidbid did something unexpected. I’ll give another shot after renaming all folder from [anidbid-XXXX] to [anidb-XXXX], and give you specific case if the situation is the same.
  • currently, my collection field metadata source order string in agent settings is : “Local, AnimeLists, AniDB, TheMovieDb, TheTVDB”

if you have a grouping folder, that should therefore be set as collection

yea but can I put anime folders into a dedicated collection folder to generate a collection ?

So far it only worked when I mixed files into the same folder, but not Anime folders into a collection folder like this :

  • Witch Craft works Collection
    • Witch Craft Works [anidb-9496]
      • Witch Craft Works - 01v2 - Takamiya-kun and the Fire Witch [SallySubs][Blu-ray][1080p][2BD167AB].mkv
      • Witch Craft Works - 02v2 - Takamiya-kun and the Witches` Agenda [SallySubs][Blu-ray][1080p][15F50762].mkv
      • Witch Craft Works - XXX
      • Witch Craft Works - YYY
    • Witch Craft Works Takamiya-kun to Imouto no Warudakumi [anidb-10397]
      • Witch Craft Works (2015) - 1 - OAD - [a07c470f].mp4

did I miss something ?

Yeah, agent logs…
That is what “Local” in collection agent settings does if more than one folder is in the grouping folder… So if not working i need logs…
something which Plex series scanner does not support, it groups all in one series “Witch Craft works Collection” so it is messy, please ensure you use the Absolute Series Scanner

oh, so it should works that way ? mmmmh Absolute Series Scanner is set as agent in my anime plex library “pourtant”.

Once my renaming is completely done (which is still in progress due to temp ban from anidb API because database leech :p) , my volume extended and all good, I’ll rebuild a Library folder from scratch, and put only as a start the folder hierarchy I used in the example above and if not showing as expected will give you the logs. I still suspect that this “anidbid” thing may have done worse than good, need to rename things right before retesting collection building from Local.

Is this something that I can do? Or only ZeroQI?

Hi Zero,

Having some trouble with a couple of recent shows not being assigned when a new episode is added to an existing show/folder.

It’s likely this issue could be solved by adding anidb tags to the folders but I don’t do this currently and it’s never been a problem before once I’ve made a manual match. Though it might be worth noting I have recently updated HAMA from an older version.

The two shows in question that I am having this issue with are:
Rerided: Tokigoe no Derrida (a13254)
Ulysses: Jeanne d`Arc to Renkin no Kishi (a13498)

Both shows act a little different:

When a new episode of Rerided is found it is being added as an unmatched show. When manually matching, the anidb is listed as “RErideD-刻越えのデリダ-” with a score of 73. Accepting the match automagically adds the new episode in with the rest. Until next time.

When a new episode of Ulysses is found it is added as a new show with the same name and art as the existing show. Basically creating a duplicate entry. I think this is because it is makes a new show based on the tvdb match (score of 100) where I have manually matched the first episode to the anidb ID with a score of 79. My preference is to use anidb, regardless of score, but I can’t find anyway to enforce this option as a default. As with Rerided, once I fix match to the anidb entry it is added to the existing show as expected.

Other than those two, every other show is working just fine! I presume my problem lies in the matching logic. Rerided doesn’t auto match because the episode description can’t get a reliable match due to the foreign characters and Ulysses is auto matching to another show due to the 100 score. While both shows are ignoring the fact that I’ve already told them which show to match with.

Anyhow, as always, thanks for your awesome work :slight_smile:

@ kattara what is that written in reference to?
@ acidion

  • Automatic matching needs score of 80 or more
  • you must have eps in subfolders or something to make the eps not part or the already created series. Where are the series specific scanner logs ?
  • hama search anidb if single season tvdb otherwise
  • ‘Rerided Derrida, Who Leaps Through Time’ or ‘Rerided:Tokigoe no Derrida’ would solve the issue. according to AniDB xml backed up here you named your folder poorly.
    https://raw.githubusercontent.com/ScudLee/anime-lists/master/animetitles.xml

<anime aid=“13254”> <title type=“main” xml:lang=“x-jat”>Rerided: Tokigoe no Derrida</title> <title type=“official” xml:lang=“en”>Rerided: Derrida, Who Leaps Through Time</title> <title type=“official” xml:lang=“ja”>RErideD-刻越えのデリダ-</title> <title type=“syn” xml:lang=“ja”>プロジェクトD</title> </anime>

<anime aid=“13498”> <title type=“main” xml:lang=“x-jat”>Ulysses: Jeanne d`Arc to Renkin no Kishi</title> <title type=“official” xml:lang=“en”>Ulysses: Jeanne d`Arc and the Alchemist Knight</title> <title type=“official” xml:lang=“ja”>ユリシーズ ジャンヌ・ダルクと錬金の騎士</title> </anime>

  • You are meant to use anidb title with an AniDB agent. I made the code the most resilient i could, but ultimately, it would have been shorten to rename the folder than writing this post.
  • You could ask AniDB to accept “Rerided” an “Ulysses” as short titles, that would make your naming right.

Hey Zero,

All eps are definately in the main folder. There are no sub folders.

The file names are different from the folder name because I took the title from anidb and replaced the colon with a hyphen. I prefer to leave the file names as they come as renaming them all is much more work.

Sorry for not attaching logs. I will attach the logs this time for Ulysses as it seems to be behaving oddly for me. Looking at the search log I can see the keyword matches 4 out of 5 words and scores it at 79. So, as you pointed out, it wont auto match on a score less than <80. Which isn’t a problem for me if I can manually match it after the fact.

Ulysses- Jeanne d’Arc and the Alchemist Knight.agent-search.log (89.7 KB)
Ulysses- Jeanne d’Arc and the Alchemist Knight.agent-update.log (239.4 KB)

So here is what it has been doing in Plex since my original post.

The 2nd with 2 episodes is after I last manually rematched. The 1st is the last auto match it performed and the 3rd is this week’s episode which is now not matching at all. As I wrote previsously, I was seeing a score of 100 with TVdb when manually matching but now I don’t see it. Something seems to have changed.

Thanks to your input I have fixed the issue with Rerided. Yes it was poor naming on my part. I had named the folder ‘Rerided’. Renaming it to ‘RErideD Tokigoe no Derrida’ has fixed the issue and it now matches with a score of 98. So that’s good :slight_smile:

However, I would have still expected new episodes added to the folder to match with what I’ve already told it to use when I matched the first episode manually, which was the main point of my original post. Is this expectation wrong?

With Ulysses I don’t see how I can name the folder any better based on the keywords I see in the search log. Any thoughts? the d’Arc portion keyword as ‘darc’ is likely having some impact here.

Hi, I’m having a problem with Anime called Haikyuu when using Hama. I’ve tried different namings, checked permissions and tried another release of that anime. I have PMS on my NAS and to test I also installed it to Windows, however the same problem persists, which is that it scans the files fine, however no metadata gets added. When checking the logs I see this recurring on both my NAS and Windows:

2018-11-18 21:12:25,773 (8c7c) : CRITICAL (core:574) - Exception in the update function of agent named ‘HamaTV’, called with guid ‘com.plexapp.agents.hama://tvdb-278157?lang=en’ (most recent call last):
File “C:\Program Files (x86)\Plex\Plex Media Server\Resources\Plug-ins-ecd600442\Framework.bundle\Contents\Resources\Versions\2\Python\Framework\api\agentkit.py”, line 1076, in update
agent.update(obj, media, lang, **kwargs)
File "C:\Users\Janne\AppData\Local\Plex Media Server\Plug-ins\Hama.bundle\Contents\Code_init
.py", line 141, in update
def update (self, metadata, media, lang, force ): Update (metadata, media, lang, force, False)
File “C:\Users\Janne\AppData\Local\Plex Media Server\Plug-ins\Hama.bundle\Contents\Code_init_.py”, line 125, in Update
if common.AdjustMapping(source, mappingList, dict_TheTVDB):
File “C:\Users\Janne\AppData\Local\Plex Media Server\Plug-ins\Hama.bundle\Contents\Code\common.py”, line 845, in AdjustMapping
if str(season) in dict_TheTVDB[‘seasons’]: new_seasons[str(season + adjustment)] = dict_TheTVDB[‘seasons’].pop(str(season))
File “C:\Program Files (x86)\Plex\Plex Media Server\Resources\Plug-ins-ecd600442\Framework.bundle\Contents\Resources\Versions\2\Python\Framework\code\sandbox.py”, line 108, in
getitem = lambda x, y: x.getitem(y),
KeyError: ‘13332’

Not sure if I have fucked up something, but the rest of the current 500+ Anime series I have are getting their metadata fine, just this is causing trouble.

you really did a great job, congratulations.
I have two question.
1 - If you want the title of the anime to be like the original title, just put x-jat? Because for example, Koe in the katachi here appears as A Silent Voice
2 - What to do with animes with more than 100 episodes? LOGH here only shows until episode 100

Anyway, great work.