Series Better ABsolute Scanner (S - BABS)

absolute numbering means one season only, which you do not seem to want to follow

the logical choice seem to be the tvdb numbering but you don't want to rename the files...

 

The scanner can manage the episode and season number assignment so has the power to do what you want, if you rename SEASON 2 into "Season 2  Saga dell'ingresso nella Rotta Maggiore" for example...

the only issue is that the metadata agent is expecting season 1 only for absolute numbering so you will have no scraping for other seasons... I could possibly modify hama to support that (if episode not there, check next season for same ep number), but that's (to me) a weird query and to my knowledge you are the only one to wish such a thing...

1 Like

I just noticed that if you remove a folder that was in a library scanned with S-BABS it is not removed in PLEX when you update your library.Moved 2 folders out of my library and now need to remove library

and re-add it to appear correctly.

I can't confirm that. I recently switched my anime section to S-BABS, too, and hat to move out some folders and re-add them, so the tvdv.id file was correctly found. but each time plex removed those files correctly from the library.

(make sure, you still have other folders inside the library-folder. if those two are the only folders and you move them out, leaving an empty folder, plex thinks, the hdd is disconnected or something similar and won't remove the files from the library.)

I can't seem to get the split seasons with S-BABS+TVDB. I've created a tvdb.txt file and put 81797 (One Piece) inside and renamed it tvdb.id, too. I know I'm somewhere in S15 in One Piece and have more episodes past S15, according to tvdb website. When I use it, it identifies the episodes as S1 and the title for each episodes are the dates (that it aired?) and it keeps the episode number such as 498 (where I'm currently at). Right now I'm using S-BABS+Hama, it does the same thing as S-BABS+TVDB, but it has the correct episode titles. Though, I have some issues with Hama having trouble to identify some series such as JoJo's Bizarre Adeventure and Hellsing Ultimate. 

I would like to try and get the split seasons. If its not possible, I guess I'll keep using S-BABS+Hama.

if you use S-BABS with tvdbid file, then use the tvdbid agent as hama will not like the episodes in seasons

For HAMA:

   . "JoJo's Bizarre Adeventure" => "Jojo's Bizarre Adventure (2012)" [aid:9304], or "JoJo's Bizarre Adventure" [aid:788]? did you try to search the right serie or to put "aid:xxxxx" in the search with xxxxx being the anidbid ?

   . Hellsing Ultimate: did you leave the roman numbering in the file name? if so, it shouldn't pass the scanner.

Can you post in the right Hama thread the filenames and folder names for both series ?

I tried S-BABS+TVDB w/ tvdb.id file in folder and I still can't get the split seasons like it was shown in the first post with One Piece. I'm trying to do the same with JoJo since TVDB has JoJo split into 2 different seasons with JoJo 2012 and Stardust Crusaders, but again nothings happening with S-BABS+TVDB w/ tvdb.id file in folder. It just lumps Stardust Crusaders with season one, when it should be season 2. >_>

JoJo 2012 - [DmonHiro] Jojo's Bizarre Adventure - 01 - Dio,The Invader (BD, 720p) [70472769]

Stardust Crusaders - [Some-stuffs]_Jojo's_Bizarre_Adventure_Stardust_Crusaders_01_(1280x720_TS_AAC)_[2FAF8881]

Both seasons are in one Jojo folder, but in each season has their own folder within that Jojo folder and I have the tvdb.id in the root folder.So basically, inside my Jojo folder is 2012 and Stardust Crusader folders and a  tvdb.id file.

I tried S-BABS+TVDB w/ tvdb.id file in folder and I still can't get the split seasons like it was shown in the first post with One Piece. I'm trying to do the same with JoJo since TVDB has JoJo split into 2 different seasons with JoJo 2012 and Stardust Crusaders, but again nothings happening with S-BABS+TVDB w/ tvdb.id file in folder. It just lumps Stardust Crusaders with season one, when it should be season 2. >_>

JoJo 2012 - [DmonHiro] Jojo's Bizarre Adventure - 01 - Dio,The Invader (BD, 720p) [70472769]

Stardust Crusaders - [Some-stuffs]_Jojo's_Bizarre_Adventure_Stardust_Crusaders_01_(1280x720_TS_AAC)_[2FAF8881]

Both seasons are in one Jojo folder, but in each season has their own folder within that Jojo folder and I have the tvdb.id in the root folder.So basically, inside my Jojo folder is 2012 and Stardust Crusader folders and a  tvdb.id file.

With regards to One Piece, my folder structure is: One Piece\[File Name], where [File Name] is [yibis]_One_Piece_[nnn]_[720p][checksum].  The tvdb.id file reads the same as yours (81797).  The fact that it identifies episodes as air-dates could also mean that it's just waiting for the metadata to download (I've found One Piece to take a long while to update).  Since the naming part is controlled by the agent, could you post the log file for the TVDB metadata agent (see here if you're unsure where log files are located).  Another issue mentioned by a user (evarjdrp) was that he/she had a newline character at the end of the tvdb.id file, causing issues due to OS differences[1] (his was created with a newline character in Windows, then moved to Linux).  He posted a fix, and I've updated the file in the first post to reflect the modification (which basically just removes all newline characters).  A copy of the fix is also included in this post.  So perhaps try that as well.

In terms of Jojo's Bizarre Adventure, the file naming being used might be causing you issues.  In order for Stardust Crusaders to appear as Season 2, it needs to identify the series as being Jojo's Bizarre Adventure, and the filename needs to have the absolute numbering scheme as shown in TVDB (i.e. 27 for Stardust Crusaders 01).  From the example above, that doesn't seem to be the case (so a tvdb.id file will be more a hindrance than a help).  What you can do is not have the tvdb.id file, and use the following structure and naming scheme:

Jojo's Bizarre Adventure\Season 01\[File name for episode 1 of Jojo's Bizarre Adventure]

Jojo's Bizarre Adventure\Season 02\[File name for episode 1 of Stardust Crusaders] (because the TVDB agent only cares about the number at the end, the actual filename shouldn't matter - tested with Gunslinger Girl on my media).

Yeah, I guess One Piece does take awhile to get the metadata. I left it alone while I went out and came back to three separate One Piece series lol. But it eventually sorted itself out and now I have the split seasons in One Piece. And worked out Jojo as per your suggestion. Thanks.

I've got a series that I noticed stopped getting scanned at some point, although others seem to work fine. Creating a second library and having the stock Plex Scanner run through it it does show up, so the files are at least accessible. I then tested against BABS and it also found it, but if possible I rather keep the series structure since at a few hundred episodes a single series setup is a bit unruly for my taste :P

Path is [LIBRARY]\Soredemo Sekai wa Utsukushii\[HorribleSubs] Soredemo Sekai wa Utsukushii - 01 .mkv

I'm not seeing the right scanner log in the Logs folder in appdata (only shows the updates to one of my libraries, and not this one).

absolute numbering means one season only, which you do not seem to want to follow

the logical choice seem to be the tvdb numbering but you don't want to rename the files...

 

The scanner can manage the episode and season number assignment so has the power to do what you want, if you rename SEASON 2 into "Season 2  Saga dell'ingresso nella Rotta Maggiore" for example...

the only issue is that the metadata agent is expecting season 1 only for absolute numbering so you will have no scraping for other seasons... I could possibly modify hama to support that (if episode not there, check next season for same ep number), but that's (to me) a weird query and to my knowledge you are the only one to wish such a thing...

I do some test and I solved my problem, with S - BABS+TVDB with the same tvdb.id in each folder of every season folder. something like this

\Cartoon\One Piece\Season 1 vdb.id

\Cartoon\One Piece\Season 2 vdb.id

\Cartoon\One Piece\Season 3 vdb.id

\Cartoon\One Piece\Season 4 vdb.id

the last thing that i wish is:

now every season starts from relative episode number 1. I would like to see the absolute episode number.

for example, now if i go on plex inside season 5 the first episode will be the number 1. I would like to see as first episode not 1 but 61 (61 it's the absolute episode number of the first episode of season 5).

it's possible? to do it i which file I need to modify, the scanner S-BABS or the TVDB agent?

thanks

the scanner decide the episode number, so you need to use the absolute episode number instead of the episode number apparently.

In GetEpisodesBySeriesID function, replace:

      episode_dict[int(absolute_num)] = [season_num, episode_num]

By:

      episode_dict[int(absolute_num)] = [season_num, absolute_num]

But since the ep number doesn't match you need to edit the agent to read correctly the absolute episode id, btu thetvdb carry the absolute episode id  so it should be easy, replace:

episode_num = el_text(episode_el, 'EpisodeNumber')

With:

episode_num = el_text(episode_el, 'absolute_number')

I give no warranty the above works and please don't ask me if it fails. i do my own scanner and agent, and provide support for it, but will give little time for queries like this. it was intriguing, but i cannot for the life of me fathom why going down this convoluted way. i would have renamed the episode title in the agent to show the absolute number...

you want season but also absolute numbering.... If the issue is too many eps showing in a single season in long series, keep the default behaviour by letting plex cut every 100 episodes by choping the workaround to prevent it in BABS...

the scanner decide the episode number, so you need to use the absolute episode number instead of the episode number apparently.

In GetEpisodesBySeriesID function, replace:

      episode_dict[int(absolute_num)] = [season_num, episode_num]

By:

      episode_dict[int(absolute_num)] = [season_num, absolute_num]

But since the ep number doesn't match you need to edit the agent to read correctly the absolute episode id, btu thetvdb carry the absolute episode id  so it should be easy, replace:

episode_num = el_text(episode_el, 'EpisodeNumber')

With:

episode_num = el_text(episode_el, 'absolute_number')

I give no warranty the above works and please don't ask me if it fails. i do my own scanner and agent, and provide support for it, but will give little time for queries like this. it was intriguing, but i cannot for the life of me fathom why going down this convoluted way. i would have renamed the episode title in the agent to show the absolute number...

you want season but also absolute numbering.... If the issue is too many eps showing in a single season in long series, keep the default behaviour by letting plex cut every 100 episodes by choping the workaround to prevent it in BABS...

I created a modified TVDB agent version so plex don't overwrite my change.

thanks a lot for the support, now everything is as i want ;)

PS: I tried to check if tvdb.id exist with this code but without success, because my var "the_dir" is wrong. but this isn't essential. I'll set my custom agent manually when I need. thank you again

        try:
          the_dir = os.path.dirname(files[0])
          if os.path.exists(the_dir + '//' + 'tvdb.id'):
            episode_num = el_text(episode_el, 'absolute_number')
          else:
            episode_num = el_text(episode_el, 'EpisodeNumber')
        except:
          pass

Both instructions for the if are the same and can’t figure what you are trying to do. …

I've got a series that I noticed stopped getting scanned at some point, although others seem to work fine. Creating a second library and having the stock Plex Scanner run through it it does show up, so the files are at least accessible. I then tested against BABS and it also found it, but if possible I rather keep the series structure since at a few hundred episodes a single series setup is a bit unruly for my taste :P

Path is [LIBRARY]\Soredemo Sekai wa Utsukushii\[HorribleSubs] Soredemo Sekai wa Utsukushii - 01 .mkv

I'm not seeing the right scanner log in the Logs folder in appdata (only shows the updates to one of my libraries, and not this one).

 
Anyone have pointers on where I can find a more useful log or how I should go about debugging? I'm plenty experienced in half a dozen languages but I've not played much with Python so any pointers on where to start my hunt would be greatly appreciated before I just go my usual overkill route and learn the syntax first.

Try absolute series scanner I wrote it manages additional logs including files not scanned

Both instructions for the if are the same and can't figure what you are trying to do. ..

with this code inside the TVDB agent, i'm tryng to check if exist tvdb.id file, so if exist episode number is absolute_number, else is the relative EpisodeNumber

try:
          the_dir = os.path.dirname(files[0])
          if os.path.exists(the_dir + '//' + 'tvdb.id'):
            episode_num = el_text(episode_el, 'absolute_number')
          else:
            episode_num = el_text(episode_el, 'EpisodeNumber')
        except:
          pass

my apologies, i just saw the difference.

  try:
    the_dir = os.path.dirname(files[0])	     		      
    if os.path.exists(the_dir + '//' + 'tvdb.id'):
      fo = open(os.path.realpath(the_dir + '//' + 'tvdb.id'),'rb') 
      tvdb_id = fo.readline()
      # Added per evardjp's comment - this fixes issues when working in Windows and a newline is added
      tvdb_id = tvdb_id.replace("
","").replace("\r","").replace(" ","")
      episode_dict = GetEpisodesBySeriesID(tvdb_id)
      sortToSeasons = True
  except:
    pass

if the file exists, calls the mapping function. that's where i would flex it since the variables are define there

modify to the line episode_num = el_text(episode_el,'absolute_number')

def GetEpisodesBySeriesID( seriesID):
   # Convenience function
  el_text = lambda element, xp: element.xpath(xp)[0].text if element.xpath(xp)[0].text else '' 

Get the show’s zipped data

zip_url = TVDB_ZIP_URL % (Dict[‘ZIP_MIRROR’], seriesID, lang)
zip_data = cStringIO.StringIO(GetResultFromNetwork(zip_url).read())
with zipfile.ZipFile(zip_data) as zip_archive:
zip_archive_mem = cStringIO.StringIO(zip_archive.read(lang+’.xml’))

zip_archive_mem = zip_archive_mem.read()

#Test to make sure file is correct
#f = open(’//media//IDRIVE//en.xml’, ‘w’)
#f.write(zip_archive_mem)

#zip_archive = Archive.Zip(zip_data)

Extract the XML files from the archive. Work around corrupt XML.

root_el = etree.fromstring(fixBrokenXml(zip_archive_mem))
series_el = root_el.xpath(‘Episode’)

Get list of all episodes and match their season/episode number to absolute number

#Store the results in a dict so we can look for the season/episode for a particular absolute number
episode_dict = dict()
for episode_el in series_el:
absolute_num = el_text(episode_el, ‘absolute_number’)
season_num = el_text(episode_el, ‘SeasonNumber’)
episode_num = el_text(episode_el,‘absolute_number’) # was EpisodeNumber
#We only store the episode in dictionary if it has an absolute number
if absolute_num.isdigit():
episode_dict[int(absolute_num)] = [season_num, episode_num]

return episode_dict

good luck

sorry ZeroQI but I think you are speaking about S-BABS scanner file. I would insert the tvdb.id check inside the agent TVDB

the agent will use the episode and season the scanner passed along... you need to map that to the data (by considering every season from 1 the season 1)

i try to explain better.

in S-BABS you told me to replace in GetEpisodesBySeriesID function:

episode_dict[int(absolute_num)] = [season_num, absolute_num]

and because the ep number doesn't match, to edit the agent to read correctly the absolute episode id with this code:

episode_num = el_text(episode_el, 'absolute_number')

so everything is OK.

Now I would add a check in the agent to verfy if the tvdb.id file exist the agent use the absolute_number. if tvdb.id file doesn't exist the agent will use the default EpisodeNumber