Absolute Series Scanner (for anime mainly)

Am curently whatching Hero Academia, and the trakt unofficial app for plex, the HA is divided in two season but the numbering system of sub is not format for season, so trakt dont take it like second season, any idea how to change this. I also add all episodes to a season 2 folder but track still dont grab it at all.

@mrstabhappy : either scanner code buggy for everybody or you miss a runtime or have file right issues… Can’t help much if i can’t rfeproduce the issue…
@eskwire: season 1 13 eps season 2 25 eps… that is tvdb numbering. did you explicitely forced the tvdbid? if not trakt would use anidb numbering maibe and not get metadata for season 2…

@ZeroQI Will test it to see.

Accidentally posted on the HAMA page, so reposting here instead.

@ZeroQI First off, this scanner is awesome, and it has vastly improved my anime collection organization on Plex. However, I’m having trouble with tvdb4. I don’t seem to understand the XML file very well. I made an XML file for DBZ that looks like this but with proper line breaks, which this comment box doesn’t seem to allow:
`

<?xml version="1.0" encoding="utf-8"?> 01|001|107|Frieza Arc 02|108|194|Cell Arc 03|195|291|Buu Arc ` I placed it in my "Anime" folder that has all of the individual show folders. I appended the tvdb4 guid for Dragon Ball Z, but Plex keeps showing 9 seasons, which seems to indicate that it's skipping my custom mapping file and going straight to the master XML in the scanner folder. I also tried placing it in the Dragon Ball Z folder itself with all of the episodes, and this didn't change anything. I also tried messing with the formatting, like not including the XML version header, not having etc. but nothing seems to work. Do you have any idea what is wrong?

Anime/Dragon Ball Z [tvdb4-81472]/tvdb4.mapping (no .xml extension)
https://github.com/ZeroQI/Absolute-Series-Scanner/blob/master/tvdb4.mapping.xml for examples

@ZeroQI Thanks, but when I do this, once plex finishes scanning, it shows it as absolute, so episode 1-291, and isn’t split into arcs. I looked at the logs, but I don’t know what to paste, so I attached the log here. It should be the final bit. I’ve also attached the xml if you want to see it. I’ve changed both of the extensions to allow it to attach.

Scanner call - root: ā€˜/home/lalith/Anime’, path: ā€˜Attack on Titan [tvdb2-26740]’, dirs: ā€˜0’, files: ā€˜37’

Forced ID in serie folder name
folder_show: ā€˜Attack on Titan [tvdb2-26740]’, folder_season: ā€˜None’, tvdb mode: ā€˜2’, tvdb id: ā€˜26740’
TVDB season mode (2) enabled, serie url: ā€˜http://thetvdb.com/api/A27AD9BE0DA63333/series/26740/all/en.xml’
xml loading issue, Exception: ā€˜HTTP Error 404: Not Found’’

267440 is the tvdbid…

Scanner call - root: ā€˜/home/lalith/Anime’, path: ā€˜Dragon Ball Z [tvdb4-81472]’, dirs: ā€˜0’, files: ā€˜291’

Forced ID in serie folder name
folder_show: ā€˜Dragon Ball Z [tvdb4-81472]’, folder_season: ā€˜None’, tvdb mode: ā€˜4’, tvdb id: ā€˜81472’
TVDB season mode (4) enabled, tvdb4 mapping url: ā€˜http://rawgit.com/ZeroQI/Absolute-Series-Scanner/master/tvdb4.mapping.xml’
unknown_series_length: False, tvdb_mapping: {1: (1, 1), 2: (1, 2), 3: (1, 3), 4: (1, 4), 5: (1, 5), 6: (1, 6), 7: (1, 7), 8: (1, 8), 9: (1, 9), 10: (1, 10), 11: (1, 11), 12: (1, 12), 13: (1, 13), 14: (1, 14), 15: (1, 15), 16: (1, 16), 17: (1, 17), 18: (1, 18), 19: (1, 19), 20: (1, 20), 21: (1, 21), 22: (1, 22), 23: (1, 23), 24: (1, 24), 25: (1, 25), 26: (1, 26), 27: (1, 27), 28: (1, 28), 29: (1, 29), 30: (1, 30), 31: (1, 31), 32: (1, 32), 33: (1, 33), 34: (1, 34), 35: (1, 35), 36: (1, 36), 37: (1, 37), 38: (1, 38), 39: (1, 39), 40: (2, 40), 41: (2, 41), 42: (2, 42), 43: (2, 43), 44: (2, 44), 45: (2, 45), 46: (2, 46), 47: (2, 47), 48: (2, 48), 49: (2, 49), 50: (2, 50), 51: (2, 51), 52: (2, 52), 53: (2, 53), 54: (2, 54), 55: (2, 55), 56: (2, 56), 57: (2, 57), 58: (2, 58), 59: (2, 59), 60: (2, 60), 61: (2, 61), 62: (2, 62), 63: (2, 63), 64: (2, 64), 65: (2, 65), 66: (2, 66), 67: (2, 67), 68: (2, 68), 69: (2, 69), 70: (2, 70), 71: (2, 71), 72: (2, 72), 73: (2, 73), 74: (2, 74), 75: (3, 75), 76: (3, 76), 77: (3, 77), 78: (3, 78), 79: (3, 79), 80: (3, 80), 81: (3, 81), 82: (3, 82), 83: (3, 83), 84: (3, 84), 85: (3, 85), 86: (3, 86), 87: (3, 87), 88: (3, 88), 89: (3, 89), 90: (3, 90), 91: (3, 91), 92: (3, 92), 93: (3, 93), 94: (3, 94), 95: (3, 95), 96: (3, 96), 97: (3, 97), 98: (3, 98), 99: (3, 99), 100: (3, 100), 101: (3, 101), 102: (3, 102), 103: (3, 103), 104: (3, 104), 105: (3, 105), 106: (3, 106), 107: (3, 107), 108: (4, 108), 109: (4, 109), 110: (4, 110), 111: (4, 111), 112: (4, 112), 113: (4, 113), 114: (4, 114), 115: (4, 115), 116: (4, 116), 117: (4, 117), 118: (4, 118), 119: (4, 119), 120: (4, 120), 121: (4, 121), 122: (4, 122), 123: (4, 123), 124: (4, 124), 125: (4, 125), 126: (4, 126), 127: (4, 127), 128: (4, 128), 129: (4, 129), 130: (4, 130), 131: (4, 131), 132: (4, 132), 133: (4, 133), 134: (4, 134), 135: (4, 135), 136: (4, 136), 137: (4, 137), 138: (4, 138), 139: (4, 139), 140: (5, 140), 141: (5, 141), 142: (5, 142), 143: (5, 143), 144: (5, 144), 145: (5, 145), 146: (5, 146), 147: (5, 147), 148: (5, 148), 149: (5, 149), 150: (5, 150), 151: (5, 151), 152: (5, 152), 153: (5, 153), 154: (5, 154), 155: (5, 155), 156: (5, 156), 157: (5, 157), 158: (5, 158), 159: (5, 159), 160: (5, 160), 161: (5, 161), 162: (5, 162), 163: (5, 163), 164: (5, 164), 165: (5, 165), 166: (6, 166), 167: (6, 167), 168: (6, 168), 169: (6, 169), 170: (6, 170), 171: (6, 171), 172: (6, 172), 173: (6, 173), 174: (6, 174), 175: (6, 175), 176: (6, 176), 177: (6, 177), 178: (6, 178), 179: (6, 179), 180: (6, 180), 181: (6, 181), 182: (6, 182), 183: (6, 183), 184: (6, 184), 185: (6, 185), 186: (6, 186), 187: (6, 187), 188: (6, 188), 189: (6, 189), 190: (6, 190), 191: (6, 191), 192: (6, 192), 193: (6, 193), 194: (6, 194), 195: (7, 195), 196: (7, 196), 197: (7, 197), 198: (7, 198), 199: (7, 199), 200: (7, 200), 201: (7, 201), 202: (7, 202), 203: (7, 203), 204: (7, 204), 205: (7, 205), 206: (7, 206), 207: (7, 207), 208: (7, 208), 209: (7, 209), 210: (7, 210), 211: (7, 211), 212: (7, 212), 213: (7, 213), 214: (7, 214), 215: (7, 215), 216: (7, 216), 217: (7, 217), 218: (7, 218), 219: (7, 219), 220: (8, 220), 221: (8, 221), 222: (8, 222), 223: (8, 223), 224: (8, 224), 225: (8, 225), 226: (8, 226), 227: (8, 227), 228: (8, 228), 229: (8, 229), 230: (8, 230), 231: (8, 231), 232: (8, 232), 233: (8, 233), 234: (8, 234), 235: (8, 235), 236: (8, 236), 237: (8, 237), 238: (8, 238), 239: (8, 239), 240: (8, 240), 241: (8, 241), 242: (8, 242), 243: (8, 243), 244: (8, 244), 245: (8, 245), 246: (8, 246), 247: (8, 247), 248: (8, 248), 249: (8, 249), 250: (8, 250), 251: (8, 251), 252: (8, 252), 253: (8, 253), 254: (9, 254), 255: (9, 255), 256: (9, 256), 257: (9, 257), 258: (9, 258), 259: (9, 259), 260: (9, 260), 261: (9, 261), 262: (9, 262), 263: (9, 263), 264: (9, 264), 265: (9, 265), 266: (9, 266), 267: (9, 267), 268: (9, 268), 269: (9, 269), 270: (9, 270), 271: (9, 271), 272: (9, 272), 273: (9, 273), 274: (9, 274), 275: (9, 275), 276: (9, 276), 277: (9, 277), 278: (9, 278), 279: (9, 279), 280: (9, 280), 281: (9, 281), 282: (9, 282), 283: (9, 283), 284: (9, 284), 285: (9, 285), 286: (9, 286), 287: (9, 287), 288: (9, 288), 289: (9, 289), 290: (9, 290), 291: (9, 291)}

seem to use online mapping ok… This line failed
if os.path.isfile(os.path.join(root, path, ā€œtvdb4.mappingā€)): tvdb4_mapping_content = open(os.path.join(root, path, ā€œtvdb4.mappingā€)).read().strip()
Is the file ā€œ/home/lalith/Anime/Dragon Ball Z [tvdb4-81472]/tvdb4.mappingā€ exactly ? no xml, no txt, the file you attached without the .txt ?

@ZeroQI yup, exactly like that.

Hi,

I’d like to use the Absolute Series Scanner to organise my classic Doctor Who DVDs by serial. I’d like to just check that this is possible and that I’ve understood correctly how to do it. I think that the best thing for me to use is the tvdb4 mapping.

What I plan to do is:

  • Put my files into a folder named ā€œDoctor Who [tvdb4-76107]ā€ with names like ā€œDoctor Who s12e11.m4vā€
  • Add a file to that folder called tvdb4.mapping, with content like:
... 12|11|16|Genesis of the Daleks ...

Is that likely to work? Am I naming the files correctly or do they need to be something like ā€œDoctor Who [tvdb4-76107-s12e11].m4vā€? If I want the serials sorted chronologically, do I need to put the serial number in the mapping file?

Thanks,

–
Simon

tvdb4 use absolute numbering episodes and give them seasons
try tvdb5 mode i did for star wars anime, same predicament

Thanks!

I do want to group them into them seasons, but instead of the seasons TVDB use I’d like to group them by serial, as described at https://en.wikipedia.org/wiki/List_of_Doctor_Who_serials. So ā€œGenesis of the Daleksā€, which is formed of episodes 11-16 of season 12, would be ā€œSeasonā€ 78.

TVDB doesn’t have an absolute order for Doctor Who episodes. Will that be a problem?

Thanks,

–
Simon

Hi ZeroQI,

thanks for the awesome agent and scanner, any chance to get it into Unsupported Appstore 2.x ? (WebTools), will making updating etc. alot easier for all us non-tekkies.

Kind Regards,
/Lars

unsupported appstore is only for agents
Hama URL is already supported BTW but need agent datafolder creation manually.
The beta version does support auto agent data folders creation but need to iron some kinks out since i group scanner and agent logs together

@percysnoodle : if you use season per arc, that’s tvdb4 mode aim but uses absolute numbering. Has a bypass when no numbering present in thetvdb (but if ONE has it not matching will fail). Try to see if mapping file actually can remap seasons metadata like ep summary on the fly and create mapping file to change tvdb numbered Doctor Who serie episodes into arc labeled tvdb4. Should be working in theory and if does, can add it to our online tvdb4 Arc mappings. file need to be called ā€œtvdb4.mappingā€ and ā€œtvdb4.idā€ in series folder.

@ZeroQI great, I’ll try that. I’ve got two parent folders, ā€œDoctor Who (1963) [tvdb4-76107]ā€ and ā€œDoctor Who (2005) [tvdb4-78804]ā€. I’ve put the attached mapping file in the first one. I wasn’t sure from the documentation where I should put the overrides - at the moment, the files in the folders are named e.g. ā€œDoctor Who (1963) s12e11 [tvdb4-76107-s78e01].m4vā€ and ā€œDoctor Who (2005) s04e10 [tvdb4-76107-s160e11].m4vā€ - is that the right place to put that information?

Thanks for all your help so far!

So…I’m pullin’ my hair out here, trying to get Plex to love Dragon Ball Z. :cry:

I’ve tried all sorts of sorting with different folder names and different file names, but I just can’t get the show to appear how I want.

This is what I want:

Show: Dragon Ball Z
Seasons: All 9
Episodes: Actually named

I can get the first 2 parts…but then the episodes don’t have names. If I want episodes to actually have names, I just have to throw it all into Dragon Ball Z [anidb-1530] and just have one massive season (yuck!).

I guess…looking through the readme, I’m confused on how I should actually be sorting the episodes and what guid_type to use.

Any pointers?

Edit: I can also get it to pull titles for only season 1, but not 2 through 9.

Never mind! tvdb4 guid_type OP, I guess. Figured it out… :sweat_smile:

@xnaas said:
Never mind! tvdb4 guid_type OP, I guess. Figured it out… :sweat_smile:

Well, I may have gotten too excited. tvdb4 was not the fix for Dragon Ball Super. Drat. :tongue:

Edit: It’s organizing it to the seasons defined in http://rawgit.com/ZeroQI/Absolute-Series-Scanner/master/tvdb4.mapping.xml but it’s not pulling any episode names.

Edit 2: Dragon Ball Super Naming Issues? Ā· Issue #104 Ā· ZeroQI/Absolute-Series-Scanner Ā· GitHub

@ZeroQI I’ve tried with the information in the filenames as described above, but it hasn’t sorted the episodes into serial (they’re sorted by series) and it hasn’t downloaded any metadata for them. I’m not sure I’m putting that information in the right place - where should it go?

I attach my custom scanner logs in case that helps.

Thanks again!

–
Simon

@percysnoodle Thanks, that helped a lot actually. Looks like it never worked, i rewrote it need to check and will release ammended beta version tonight

@percysnoodle : thanks that helped figuring it never worked since i wrote it… Fixed it now, will release on github beta branch now

    elif tvdb_mode=="4" and folder_season==None:  #1-folders nothing to do, 2-local, 3-online
      url = ASS_MAPPING_URL
      try:
        if   os.path.isfile(os.path.join(root, path, "tvdb4.mapping")):  tvdb4_mapping_content ,url = open(os.path.join(root, path, "tvdb4.mapping")).read().strip(), temp;        Log.info("TVDB4 local file missing: '%s'" % temp)
        else:
          url                   = ASS_MAPPING_URL
          tvdb4_anime           = etree.fromstring( urlopen(url).read().strip() )
          tvdb4_mapping_content = tvdb4_anime.xpath("/tvdb4entries/anime[@tvdbid='%s']" % tvdb_guid)[0].text.strip()
        Log.info("TVDB season mode (%s) enabled, tvdb4 mapping url: '%s'" % (tvdb_mode, url))
        for line in filter(None, tvdb4_mapping_content.replace("\r","

ā€œ).split(ā€
ā€œ)):
season = line.strip().split(ā€|")
for absolute_episode in range(int(season[1]), int(season[2])+1): tvdb_mapping[absolute_episode] = (int(season[0]), int(absolute_episode))
if ā€œ(unknown length)ā€ in season[3].lower(): unknown_series_length = True
except Exception as e:
tvdb_mapping, tvdb4_mapping_content = {}, ā€œā€
if str(e) == ā€œlist index out of rangeā€: Log.error(ā€œtvdbid: ā€˜%s’ not found in online season mapping fileā€ % tvdb_guid)
else: Log.error(ā€œError opening remote tvdb4.mapping.xml, Exception: ā€˜%sā€™ā€ % e)

EX when remote from GitHub: https://github.com/ZeroQI/Absolute-Series-Scanner/blob/master/tvdb4.mapping.xml

<anime tvdbid="303730" name="Active Raid">
01|001|012|Active Raid 1st Cour
02|013|024|Active Raid 2nd Cour
</anime>

When local: tvdb4.mapping

01|001|012|Active Raid 1st Cour
02|013|024|Active Raid 2nd Co

I’ve replaced my copy of Absolute Series Scanner.py with the one at https://raw.githubusercontent.com/ZeroQI/Absolute-Series-Scanner/Beta/Scanners/Series/Absolute%20Series%20Scanner.py

I’m getting the same results as before, but this time there are no log files. Was that the right file to use?

Thanks,

–
Simon