[Rel] HTTP Anidb Metadata Agent (HAMA)

@deusxanime %vdh seems to give me horizontal res instead of vertical…example 1920x1080 = 1920. weird

IF U(4320) DO ADD ‘[4320p]’
IF U(2160) DO ADD ‘[2160p]’
IF U(1080) DO ADD ‘[1080p]’
IF U(720) DO ADD ‘[720p]’
IF U(576) DO ADD ‘[576p]’
IF U(480) DO ADD ‘[480p]’
IF U(360) DO ADD ‘[360p]’
IF U(240) DO ADD ‘[240p]’
IF U(!4320);U(!2160);U(!1080);U(!720);U(!576);U(!480);U(!360);U(!240) DO ADD ‘[%res]’

works like a dream though.

Thanks for fixing the recent metadata issues.

I have a couple of other issues that I notice on some of the series in my library.

The first problem is this:

Matching mostly works fine, but something must be going wrong when fetching the titles for the series. HAMA is set to prioritize x-jat titles (which equals anidb’s “Main title”, right?), but the title gets set to what seem to be one of the titles from the “Synonym”-pool that anidb has. This should not be normal behaviour, right?

For example:

“Juuni Kokuki” becomes “12 Kokuki”
and
“Air” becomes “Air TV”
and
“Psycho-Pass 2” becomes “PP2”
and
“Aa! Megami-sama! Sorezore no Tsubasa” becomes “Ah! My Goddess: Sorezore no Tsubasa”

The second problem is this:

Something weird happens with some of my episode files, especially double-episodes. Some files get separated out into their own season folders with parts of the file name as name. My naming convention goes like this (and I know it is not “recommended” standard, but bear with me):

“One Piece - E10 (2000-01-19) [480p_NA_MP3_2ch_XviD][K-F&AKUPX]”
gets identified as
“One Piece\Season 2000\01-19)”

In this case, shouldn’t the matching system be content once it sees the episode number, and not meddle with the other information behind it? Why would it not match this as episode 10, but instead change it into a NON-EXISTENT episode (which it calls “01-19 )” in season folder “2000”)? I would think “E10” would be higher priority than other numbers separated in parentheses?

Here is an excerpt from the scanner log:

“One Piece (1999) [anidb-69]” s0001e009 “One Piece - E09 (2000-01-12) [480p_NA_MP3_2ch_XviD][K-F&AKUPX].avi” “(2000-01-12)”
“One Piece (1999) [anidb-69]” s2000e001 “One Piece - E10 (2000-01-19) [480p_NA_MP3_2ch_XviD][K-F&AKUPX].avi” “5” “01-19 )”

It continues bugged all the way to episode 77, in which case it becomes normal again…

and example of double episode:

“One Piece (1999) [anidb-69]” s2005e002 “One Piece - E227-E228 (2005-03-27) [480p_HDTV_MP3_2ch_XviD][GeruSama.com].avi” “5” “03-27 )”

It is just so weird that it is inconsistent, as most episodes works fine, but some do not (E10-E76 + double episodes).

Hama prioritise from a list of 3 title language the user chooses. What did you select in agent settings that are visible also when creating the library?

Link to the anidb xml would have been nice. Hama logs would have been nice.

Please tell me what i need to change in the readme troubleshooting section that would have compelled you to attach logs on the first post, because i don’t see how i can make it any clearer. Links in my signature

Convention: a way in which something is usually done.

Please do not call your own naming template a convention as it is mostly unique to you, therefore not usual and no release group i believe even used parenthesis to put dates or other things but the year and that is part of the title.

Parenthesis are not scrubbed out and you confuse my algorythm since it build a list of files in the folders and would have removed hyphens to check for number part of titles to skip them. Your dates rule out buckets of ep numbers as it adds buckets of numbers and trigger a regex for old american anime without ep numbers but with year…

I cannot reproduce your library in the absence of filelist but won’t even try as you naming is seriously attrocious. Put dates and everything irrelevant in brackets.

May try to edit regex order to have proper regex catch it properly but afraid of wide scope changes like this

Hi.

Hama prioritise from a list of 3 title language the user chooses. What did you select in agent settings that are visible also when creating the library?

It is set as:

Title priority 1: X-jat
Title priority 2: Main
Title priority 3: En
Episode title priority 1: X-jat
Episode title priority 2: En

Link to the anidb xml would have been nice. Hama logs would have been nice.

Followed the troubleshooting steps and recreated the library. Logs are now attached.

Please tell me what i need to change in the readme troubleshooting section that would have compelled you to attach logs on the first post, because i don’t see how i can make it any clearer. Links in my signature
Convention: a way in which something is usually done.
Please do not call your own naming template a convention as it is mostly unique to you, therefore not usual and no release group i believe even used parenthesis to put dates or other things but the year and that is part of the title.

It was late and english is not my main language. :confused:
Parenthesis with date is sometimes used in episode titles on daily and weekly releases. Maybe not with anime, but it is not unusual with TV-episodes.

Parenthesis are not scrubbed out and you confuse my algorythm since it build a list of files in the folders and would have removed hyphens to check for number part of titles to skip them. Your dates rule out buckets of ep numbers as it adds buckets of numbers and trigger a regex for old american anime without ep numbers but with year…
I cannot reproduce your library in the absence of filelist but won’t even try as you naming is seriously attrocious. Put dates and everything irrelevant in brackets.

Last time I checked, everything after the episode number was considered “Optional information” in Plex, so why prioritize\parse numbers from the optional information if qualified data (episode number) already exists? And why would it parse so inconsistently between the episodes? E01-E09 is fine, but E10-E76 triggers differently.

Hi, am french so english is not my mother tongue neither.
Your phrasing was actually correct enough but i am annoyed when people don’t read the readme…
You were right, something is off in the title selected, it seem to take the (last x-jat) “syn” each time…
Hama logs provided don’t contain logs for the series names, but could reproduce the issue. Weird thing is, it’s been broken in years never noticed once after i had a look at the code…

new priority is main or official title in first language, and lower priority titles if 0 found next language. fix uploaded to github
main title often x-jat so both should be near identical

Uploaded fix there, pleqse test. That fix has far reaching consequences, thanks for reporting it.

https://github.com/ZeroQI/Hama.bundle/blob/master/Contents/Code/init.py

Now for the scanner, it search for numbers left to right and cross reference the supposed ep number with a cleaned string containing all filenames for the folder, and if 1 multiple is found it skips.
String already scrubebd of parenthesis so seem like s00e0x trigger the safety meant for nubers in titles
Did change regex as normal ep should have been caught in earlier regex and push the security occurence by 1 and seem stable

Please update the scanner to the following pull request and attach the custom scanner log. Please report any issues

In both tbdb2 and tvdb4 i am having issues with season posters not pulling on Dragon Ball Z (may be others…this is the one i’m testing) The episodes are absolute numbered and there is no issue with the naming of the episodes or in pullin posters for the main show…music pulls as well.! Attached is also the hama log but i’m not seeing any issues there. Folders are setup properly in DATA and i can see the posters in the folders…but they don’t push to plex

Also if you change the main poster all of the seasons posters change with it

Hiya, known plex issue on latest Plex Media Server: https://github.com/ZeroQI/Hama.bundle/issues/98
PMS 1.2.7 is not affected apparently

@ZeroQI said:
Hiya, known plex issue on latest Plex Media Server: Plex Server v1.3.x & 3rd Party Agents · Issue #98 · ZeroQI/Hama.bundle · GitHub
PMS 1.2.7 is not affected apparently

Understood thanks…no i just need to find a new source of metadata on naruto kai :frowning: tvdb deleted it

Naruto kai is a fanedit so will be tricky to find in any database

yep…tvdb is unyielding when it comes to their rules…

@mcrommert if plex showed the metadata information (ep title, summary, etc…) through HAMA at some point, go into the agent data folder and fish out saved tvdb xml and attach it here, and attach custom posters showing naruto kai if any as well. i could find a workaround using already in place call for that one serie as it is an exception, but i need the data or there is no point. no file no fix

@ZeroQI unfortunately this was before i started using hama (very recently started using it) and it was through tvdb…i’m currently building it manually into nfo’s through trakt info (still has the old tvdb info) and using nfo agent to pull…thank you for your help though…i also reverted to 1.2.7 and everything is looking great

I recently started to use ASS and Hama, and unfortunately, something seems to be wrong, as the agent can’t manage to get the data for Kill La Kill episodes past the first one. As far as I can tell, the error is not on anidb’s site, as the data is there, both in the xml file for Kill La Kill and on the website. From what I can tell in the log file, there is some sort of exception, but I don’t know enough python (and Plex agents/scanners) to understand^^" I have now seen that it also happens with other series, but not always after the first episode.
The logs are in this dropbox share, as my laptop seems to sometimes have problems with some website elements, like the file upload of this forum :frowning: Dropbox - File Deleted

@felix@wiegand.name uploaded fix on github

@ZeroQI It looks like it works perfectly now. Thank you for the quick fix! =D

Where is the download? I see no attachments or anything

My signature or github. Please read the readme and its install procedure.

I had to recreate my Plex server and I’m running into an unusual problem. Almost every show is being displayed as episode 501. Looking through the log, it appears to be pulling in information this way.

Any way to fix this?

I’d like to note I have the newest scanner+agent as of 1/22/2017.

@clowncracker reproduced it, a bad algorythm was missing no failsafe, all good now, uploaded fix to github master. Thanks for reporting, was indeed a wide reaching bug but not showing on my test files weirdly enough…

I’m still having issues getting everything working correctly. Looking through the log, it looks like it’s still pulling episode 501 (even though in the server, most are working correctly). However, I am having issues where I specify certain file names (ex: One Piece [tvdb4-81797]). These are still not loading correctly.

I’ve attached my current log, file list should be the same as my previous post.