Absolute Series Scanner (for anime mainly)

if i make it part of unsupported appstore, the updates should happen automatically. the agent can only write in data folder...

chrno, can you rename to __init__.py and replace the agent file this attachement, delete all logs, then restart and force refresh all metadata and include the logs like you did ?

Should be solved and there is a safety net... i tried to include tvdb summaries for multiple seasons (dragon ball) but doesn't seem to be working just yet

Really love this and it worked great in my test folder. However, when I tried to apply it to my existing total Anime library, then alternatively creating a new one it would crash my Plex server =S

Admittedly I am trying to add a rather large collection but it is not a problem I have had before. Is anyone else having the same issue? I am using Windows 7.

Doing 400+ anime series no pb for me and first tester so not aware of issues…

Check scanner log for error and paste. You might have to change path in Log function of scanner with absolute path for scanner log custom. Also include hama logs. Use latest zip in thread plus replace agent code.py with one above…

My default language is set to enlgish in the scanner. I created a second lib to test HAMA + your scanner compared to HAMA + babs. My original lib is doing the same now with some series showing up as blank.

I will replace and create new logs tonight when I get home and give provide feedback once done.

the agent itself only show english as language when creating a category, but if you go in the agent settings(plex settings, agents, series > hama tv > settings), there is 3 languages to specify the language for the title and episodes.

That means the title was replaced by the metadata agent by an empty string and i can see it in logs, i just can't see why only one title was detected among the 3 (+main title if not in the list of 3). had an issue in the code with the main title used as fallback BUT issue was not showing up for me since i use main title x-jat (romaji) then english... all titles were always showing. if selecting really weird languages this possibly could happen... Issue was corrected but still doesn't explain... i need you to check scanner logs and agent logs and make sure custom logs are created and attach all. i will correct the issue

For your original folder, set the agent back to what it was (if not hama) and do a full refresh.

Make sure during upgrading that you copied the DefaultPrefs.json and that it didn't come from an early version, that could explain

Woohoo seems the .py file you posted earlier did the trick. I only replaced that file without doing anything else. Forced a refersh and everything is now working fine again for both libraries HAMA + BABAS and HAMA + Absolute Series Scanner. Thanks alot.

Ons your earlier question the custom logs weren't getting created to i hard coded the path to be "c:\Users\username\AppData\Local\Plex Media Server\Logs\" and then the logs were created. I use Windows 8.1 x64.

I have one more question I have some series that I have in orignal language and then the same anime in english dub (girlfriend wants to watch it but refuses to read subtitles go figure). The folder structure is Naruto Shippuuden and Naruto Shippuuden English. It adds both folders to plex but only pulls down data for the originally name series. Is there a way to have it pull metadata for the Naruto Shippuuden English one aswell but keep it two seperate entries on plex?

humm do a custom search but likely will group them (you can then ungroup them)

if grouped, when playing you will have a choice of file (like when you have 2 resolutions in the same folder). would be interested in the answer

Can you paste the first group of variables in the  Plex Media Scanner Custom.log ? it look like the below

Synology:

================================================================================
os.uname():   'LinuxNAS3.2.40#15 SMP Sun Nov 17 00:44:13 CET 2013x86_64'
Sys.platform: 'linux2'
os.name:      'posix'
os.getcwd:    '/volume1/homes/plex'

For  FreeNAS 9.2

================================================================================
os.uname():   'FreeBSDplexmediaserver_19.1-RELEASEFreeBSD 9.2-RELEASE-p4 #0 r262572+17a4d3d: Wed Apr 23 10:09:38 PDT 2014     root@build3.ixsystems.com:/tank/home/jkh/build/9.2.1/freenas/os-base/amd64/fusion/jkh/9.2.1/freenas/FreeBSD/src/sys/FREENAS.amd64amd64'
Sys.platform: 'freebsd9'
os.name:      'posix'
os.getcwd:    '/'

I am trying to get the custom log working for every type of system and that helps. also improvement ideas are welcome.

Just out of curiosity, how well is Absolute Series Scanner rating compared to BABS? number of series and episodes detected by both please ?
I had one good guy that helped me, but the data was squeaky clean while i wrote it to detect really bad naming and things babs woulnd't have picked on like openings...

My Plex Media Scanner Custom.log does not have that at the top. I cannot tell you why though. I have attached the log file as well as the scanner file so you can see what i changed, well only added the log path otherwise it doesn't get created.

Now all the series are getting picked up, I will go through and compare the libs to see how it preforms compared to BABS. the folder I use to test with has 99 series/movies in. BABS lib shows 99 entries and Absolute lib shows 107. Ill split the lines to make it easier for me to keep track below. off the bat what i just quickly noticed is the following

  • This is in part cause by Naruto Shipuuden Enlish, with the folder its split by seasons. BABS creates one entry with all the seasons with in. Absolute creates an entry for each season
  • Bleach has the same structure Main folder with seasons subfolders. BABS creats one entry with all the seasons within, but it only pulls metadata and names episodes for season 1. Absolute creates one entry with 1 season with all the episodes within that 1 season and pulls metadata for all episodes unlike BABS. which is cool.
  • High School DxD 2012 (2 eps) I had to name the folder "High School DxD 2012 (aid=8925)" just so BABS would show it in plex. Absolute does not show this at all, but under "High School DxD" it shows a entry for season 1 and a entry for specials that BABS doesn't. I will rename "High School DxD 2012 (aid=8925) -> High School DxD 2012" and see if it picks up then under Absolute
  • This is just something I have noticed on both scanners. Valvrave the Liberator shows as Valvrave the Liberator in plex, but season 2 aka Valvrave the Liberator (2013) shows as Kakumeiki Valvrave (2013)

Thats just what I quickly saw. Once I go through it more, I will post more feedback. Once I have time I will install absolute on my media center pc that has the bulk of my anime on and see how it does.

I will also test the original anime and dub anime when I get a chance. Also I have no idea how to do a custom search, given I haven't really looked at how to do it either. But will give feedback on that as well when I have done it.

Rename with the following and it will work: High School DxD (2012)

http://anidb.net/perl-bin/animedb.pl?show=anime&aid=9949 the main title for this serie is "' Kakumeiki Valvrave (2013)'. you can change the title language in the agent settings

on the serie, click on the 3 dots then "fix incorrect match", and you can search the serie name manually

For now the scanner handle the seasons well but not the agent. am working on that now so we have scrapping on multiple seasons

Okay so I left the main folder as Naruto Shippuden English and just moved the episodes out of season folders and into the main folder. As predicted it merged the two Naruto Shippuden entries on plex. I selected split and the english one wasnt pulling down metadata. I then did a fix incorrect match, it then merged the two entries again. I split them for a second them and bam all the episodes are getting metadata for the both the original and the english dub folder. your a genius

Okay tested on a slightly bigger folder. 281 directories within the folder. I still need to go though and rename and so on, but just straight off the bat the hits are.

HAMA + BABS = 277

HAMA + Absolute = 284

Excellent :D

Jotaro0010: you can assign a different agent to a serie by using "fix incorrect matches". 

I have managed to pull the episode summary for other seasons from thetvdb, and season posters were already working apparently. 

However, the rest is missing: title, length, rating, date, etc.

Downloading the titles through anidb is a pain as i need to process the mapping file to get the anidb id for each separate serie, then process all.i can do it, but it's a mess...

Floatyman: any news????

Added imdbid loading from thetvdb info when not in mapping file, so more covers and fanart

Yeah it seems to have been a Plex issue rather than a scanner issue so sorry for the misplaced blame (and I still can't fix it >< ). I have added around 300 with very few incorrect matches by doing it 10 at a time so it is a pain ><

The couple that combined themselves were:

Black Rock Shooter/Black Rock Shooter (2012)

Kyou no Go no Ni (2008)/Kyou no Go no Ni

Really love it though, works beautifully.

 I would love to be able to solve that for you, as i am not sure which cause the issue, but can say if the agent crash, plex should not, but hte metadata will stop at the problematic serie and possibly for all series to follow after that...

You could create a duplicate library item (to save what you did so far) pointing to the same folder to use my scanner and agent and give me:

You can zip them to add them to the reply.

To point the scanner to a folder to write logs, replace (example is for windows)

with open(filename, 'a') as file:

With: (Xxxxxx being the user name)

with open("c:\\Users\\Xxxxx\\AppData\\Local\\plex Media Server\\Logs\\" + filename, 'a') as file:

Small question, are you using the last version i posted ?

I have included the latest version which manages tvdb seasons episode summaries, english title, release date and rating. Useful for shows like Dragon ball, or others you have using TVDB numbering (seasons). first season for now stays with anidb informations

Error: UnboundLocalError: local variable 'ep' referenced before assignment __init__.py", line 601

Error: UnboundLocalError: local variable 'tvdb_table' referenced before assignment __init__.py", line 621

 in rare conditions. Solved with version attached. sorry for the 2 that downloaded the previous one today.

Please feedback your findings. i am split over managing the first season with tvdb numbering when more than a season is there...

Loading locally anidb XML when banned [cool for tests] now working

This should allow to configure the sweet spot

Firstly, thanks sooo much for this great scanner! This is the first time I was able to scan my full anime folder without many problems. Often I found other scanners would grab like half of my shows. Anyway some minor issues:

It sets one of my Anime shows as "     ". The show in question is "Elysium (2003)": http://anidb.net/perl-bin/animedb.pl?show=anime&aid=1340

It's an anime movie. The Custom log is below:

Plex Media Scanner Custom.log

================================================================================
Scan: (root: 'X:\Anime', path='Elysium (2003)', subdirs: [], language: 'en')
From folder, show: '  ', year: '2003'
show: '  ', year: 'None', season: '1', ep:   1 found using just_episode_re_search on cleaned string '   01' gotten from filename 'Elysium - [Hikari][DVD][EE21C6F8].avi'
================================================================================

I believe it's because you are filtering out the Release Groups, and one of the Release Groups have the same name as the show. Not too sure what the best way to make that right. I've just removed the release group "elysium" for now.

AbsoluteSeriesScanner.py

release_groups = [ ### Release groups (not in brackets or parenthesis)
"5BAnime-Koi_5D", "%5Banime-koi%5D", "Minitheatre.org", "minitheatre.org", "mtHD", "THORA", #
"(Vivid)", "Dn92", "kris1986k_vs_htt91", "Mthd", "mtHD BD Dual","Elysium", "encodebyjosh", #
]

Second... maybe not related to you... but perhaps now that you do the scanner to you can fix it... PLEX seems to always crash when scanning just 1 of my ep's: Fushigi Yuugi - 34v2 - [RG][DVD][F47186AE].ogm.

I've attached the log file below. It seems to try to do the ffmpeg on this ep. However this ep is not formated correctly and some of the info ffmpeg returns is garbage (negative bitrate, 0 duration, ect). The file is correct though (the HASH matches that on anidb... the group just encoded it poorly), the file does play as well.

Anyway, after it attempts to scan that file (to get the thumbnail pic for the ep I assume) it fails, and then the Scanner or Plex crashes and it doesn't continue past that ep. I understand it wont get any info for that ep, but what I would like is if it didn't crash, and just skipped the file if the info from ffmpeg is garbage. My log is below... like I said you might not be able to do anything for this, since I believe it's in the PLEX scanner code for the FFMPEG info grabbing. Currently I have to just move the file out when I scan. Else it would be nice if there was a "ignore list" in the scanner, so it would not add episodes in the ignore list. That would be nice so I could keep the file in the folder, but exclude some show's or episodes which I do not want PLEX to add.

Plex Media Scanner.log   (NOT your Custom Log file) -- this is the end of the log, nothing more past this. It just stops.

Jul 21, 2014 02:58:28:166 [4616] DEBUG - [ID 12200] Media part analysis: X:\Anime\Fushigi Yuugi (1995-1996)\Fushigi Yuugi - 34v2 - [RG][DVD][F47186AE].ogm
Jul 21, 2014 02:58:28:410 [4616] DEBUG - Opening input file: ufile:X:\Anime\Fushigi Yuugi (1995-1996)\Fushigi Yuugi - 34v2 - [RG][DVD][F47186AE].ogm
Jul 21, 2014 02:58:28:415 [4616] WARN - [FFMPEG] - Number of headers (2) mismatch for stream 1
Jul 21, 2014 02:58:28:420 [4616] INFO - Sample aspect ratio is 0:1
Jul 21, 2014 02:58:28:420 [4616] DEBUG -  * fb0d2c6bdf6ef06835de33bd6a23e41180b01ada [ogg mpeg4/vorbis] Duration: 0ms, 512x384 (1.333333) 23.976fps, bitrate=-2147483kbps, audio channels=2, optimizedForStreaming=0 (X:\Anime\Fushigi Yuugi (1995-1996)\Fushigi Yuugi - 34v2 - [RG][DVD][F47186AE].ogm)
Jul 21, 2014 02:58:28:422 [4616] ERROR - MediaInspectorMediaInfo: unable to cast '10494378629'
Jul 21, 2014 02:58:28:422 [4616] DEBUG - Enriching 1 video stream(s) with MediaInfo
Jul 21, 2014 02:58:28:422 [4616] DEBUG - Enriching 1 audio stream(s) with MediaInfo
Jul 21, 2014 02:58:28:422 [4616] DEBUG - Enriching 1 subtitle stream(s) with MediaInfo
Jul 21, 2014 02:58:28:422 [4616] INFO - Matched video stream: FFmpeg index 0 (id 0) -> MediaInfo stream index 0 (id 0)
Jul 21, 2014 02:58:28:422 [4616] INFO -  * MediaInfo: format=MPEG-4 Visual, bitrate=
Jul 21, 2014 02:58:28:422 [4616] INFO -  * FFmpeg: codec=mpeg4, bitrate=0
Jul 21, 2014 02:58:28:422 [4616] ERROR - MediaInspectorMediaInfo: unable to cast '10494378629'
 
I was one of the people who downloaded that previous one! HA. I'll redownload the one you just posted and try the scan with that. I notice you include the "\Plug-in Support\Data\com.plexapp.agents.hama\DataItems" in the zip's. Is this important to include as well when I do the scan? What do those files do?
 
Thanks again for the great Scanner and Media Agent.

Wow, now that’s a documented feedback…


These folders allow to do pic and XML caching… you will have issues when you don’t have them…


For your file use .plex ignore fileshttps://support.plex.tv/hc/en-us/articles/201375253-Excluding-Content-with-plexignore


For elision will check code and modify so it compare with parent before matching keyword

Thanks, yea the .plexignore file was exactly what I wanted. Thanks for sorting the Elysium out too. Scanned my Anime too many times, so my IP was banned. I'll have to continue tmmr. However 1 more error showed up in the HAMA logs. When you are banned, a ValueError is raised. A snippet of the HAMA log is below. Looks like the HTTP API returns the "Banned" and errors out later on when some of the values are not set.

2014-07-21 17:34:51,461 (f1c) :  INFO (logkit:16) - urlLoadXml - XML issue, result: Banned
2014-07-21 17:34:51,464 (f1c) :  ERROR (logkit:22) - parseAniDBXml - AniDB Serie XML: Exception raised
2014-07-21 17:34:51,467 (f1c) :  CRITICAL (core:572) - Exception in the update function of agent named 'HamaTV', called with guid 'com.plexapp.agents.hama://2535?lang=en' (most recent call last):
  File "C:\Users\Administrator\AppData\Local\Plex Media Server\Plug-ins\Framework.bundle\Contents\Resources\Versions\2\Python\Framework\api\agentkit.py", line 970, in _update
    agent.update(obj, media, lang, force)
  File "C:\Users\Administrator\AppData\Local\Plex Media Server\Plug-ins\Hama.bundle\Contents\Code\__init__.py", line 1028, in update
    def update(self, metadata, media, lang, force ): self.parseAniDBXml(metadata, media, lang, force,  False )
  File "C:\Users\Administrator\AppData\Local\Plex Media Server\Plug-ins\Hama.bundle\Contents\Code\__init__.py", line 601, in parseAniDBXml
    elif "s"+defaulttvdbseason+"e"+str(epNumVal) in tvdb_table: summary = tvdb_table ["s"+defaulttvdbseason+"e"+str(epNumVal)] ['Overview']
ValueError

2014-07-21 17:34:51,486 (f1c) :  DEBUG (model:218) - Serializing to C:\Users\Administrator\AppData\Local\Plex Media Server\Metadata\TV Shows\8\59a0ae3a5665c572565631eb61ea2e794b6e4ec.bundle\Contents\com.plexapp.agents.hama\Info.xml
2014-07-21 17:34:51,493 (f1c) :  DEBUG (runtime:918) - Response: [200] str, 16 bytes
2014-07-21 17:34:51,582 (1b0) :  DEBUG (networking:172) - Requesting ‘http://api.anidb.net:9001/httpapi?request=anime&client=hama&clientver=1&protover=1&aid=791
2014-07-21 17:34:51,798 (1e4) :  INFO (logkit:16) - urlLoadXml - XML issue, result: Banned
2014-07-21 17:34:51,799 (1e4) :  ERROR (logkit:22) - parseAniDBXml - AniDB Serie XML: Exception raised
2014-07-21 17:34:51,802 (1e4) :  CRITICAL (core:572) - Exception in the update function of agent named ‘HamaTV’, called with guid ‘com.plexapp.agents.hama://2837?lang=en’ (most recent call last):
  File “C:\Users\Administrator\AppData\Local\Plex Media Server\Plug-ins\Framework.bundle\Contents\Resources\Versions\2\Python\Framework\api\agentkit.py”, line 970, in update
    agent.update(obj, media, lang, force)
  File "C:\Users\Administrator\AppData\Local\Plex Media Server\Plug-ins\Hama.bundle\Contents\Code_init
.py", line 1028, in update
    def update(self, metadata, media, lang, force ): self.parseAniDBXml(metadata, media, lang, force,  False )
  File “C:\Users\Administrator\AppData\Local\Plex Media Server\Plug-ins\Hama.bundle\Contents\Code_init_.py”, line 601, in parseAniDBXml
    elif “s”+defaulttvdbseason+“e”+str(epNumVal) in tvdb_table: summary = tvdb_table [“s”+defaulttvdbseason+“e”+str(epNumVal)] [‘Overview’]
ValueError

2014-07-21 17:34:51,812 (1e4) :  DEBUG (model:218) - Serializing to C:\Users\Administrator\AppData\Local\Plex Media Server\Metadata\TV Shows\5\e3fec6f76ab68d2b9684b2249cef8a8bd543ca6.bundle\Contents\com.plexapp.agents.hama\Info.xml
2014-07-21 17:34:51,819 (1e4) :  DEBUG (runtime:918) - Response: [200] str, 16 bytes
2014-07-21 17:34:52,035 (1b0) :  INFO (logkit:16) - urlLoadXml - XML issue, result: Banned
2014-07-21 17:34:52,036 (1b0) :  ERROR (logkit:22) - parseAniDBXml - AniDB Serie XML: Exception raised
2014-07-21 17:34:52,038 (1b0) :  CRITICAL (core:572) - Exception in the update function of agent named ‘HamaTV’, called with guid ‘com.plexapp.agents.hama://791?lang=en’ (most recent call last):
  File “C:\Users\Administrator\AppData\Local\Plex Media Server\Plug-ins\Framework.bundle\Contents\Resources\Versions\2\Python\Framework\api\agentkit.py”, line 970, in update
    agent.update(obj, media, lang, force)
  File "C:\Users\Administrator\AppData\Local\Plex Media Server\Plug-ins\Hama.bundle\Contents\Code_init
.py", line 1028, in update
    def update(self, metadata, media, lang, force ): self.parseAniDBXml(metadata, media, lang, force,  False )
  File “C:\Users\Administrator\AppData\Local\Plex Media Server\Plug-ins\Hama.bundle\Contents\Code_init_.py”, line 601, in parseAniDBXml
    elif “s”+defaulttvdbseason+“e”+str(epNumVal) in tvdb_table: summary = tvdb_table [“s”+defaulttvdbseason+“e”+str(epNumVal)] [‘Overview’]
ValueError

Also this is run on a "Windows Server 2012 R2" machine. With that latest Scanner you just posted, it puts "C:\ASS.log" file in my root directory when it runs. The Custom log still appears in the AppData folder like it should though.

 I would love to be able to solve that for you, as i am not sure which cause the issue, but can say if the agent crash, plex should not, but hte metadata will stop at the problematic serie and possibly for all series to follow after that...

You could create a duplicate library item (to save what you did so far) pointing to the same folder to use my scanner and agent and give me:

You can zip them to add them to the reply.

To point the scanner to a folder to write logs, replace (example is for windows)

with open(filename, 'a') as file:

With: (Xxxxxx being the user name)

with open("c:\\Users\\Xxxxx\\AppData\\Local\\plex Media Server\\Logs\\" + filename, 'a') as file:

Small question, are you using the last version i posted ?

I have included the latest version which manages tvdb seasons episode summaries, english title, release date and rating. Useful for shows like Dragon ball, or others you have using TVDB numbering (seasons). first season for now stays with anidb informations

Thanks for the help and the offer of help. I am about to drop off the grid for a month and I don't have time to see to it at the moment. I look forward to seeing the improvements you make to the scanner and HAMA while I am out.