ZeroQI / Absolute-Series-Scanner

Seasons, absolute mode, Subfolders...
1.01k stars 155 forks source link

Help with Youtube Syntax #496

Open Zhiro90 opened 3 months ago

Zhiro90 commented 3 months ago

Hi! I didn’t want to open an issue, but after reading the README, several closed issues, and some Reddit threads, I haven’t found a way to display my YouTube series as desired (ot even sure if it’s possible tbh). Archiving playlists has been working great for years without any issues. My questions are regarding the channel archival. I would like to know the folder syntax to these.

Channel mode: Sort episodes by release date, seasons by release year.
Channel mode: Sort episodes by release date without grouping by seasons.
Bonus! Playlists mode: Invert the order.

I appreciate any help you can provide!

ZeroQI commented 3 months ago

You cannot have series without season in Plex, but can hide season folders if there is only one in library settings

Try [youtube2-xxxxxx] for using years as seasons

I did set up playlist to have last published episode last, if you bothered to use youtubedl command given so the file date/time is replaced by the youtube publication date/time, as playlist could be in reverse order sometime

Zhiro90 commented 3 months ago

Thank you for your quick answers!

1

Try [youtube2-xxxxxx] for using years as seasons

This creates seasons based on file creation date instead of release date, if I recall correctly this happens if the scanner can't find the release date on the filename, am I right? what's the correct syntax for date on filename? currently i have yyyymmdd at the beginning.

  1. You cannot have series without season in Plex, but can hide season folders if there is only one in library settings

Noted, not possible

  1. I did set up playlist to have last published episode last, if you bothered to use youtubedl command given so the file date/time is replaced by the youtube publication date/time, as playlist could be in reverse order sometime

Please can you point me to the right command? sorry to bother you

ZeroQI commented 3 months ago

In youtube agent readme the youtubedl command

ZeroQI commented 3 months ago

Date based numbering is buggy, if you have two releases the same day it craps itself... Fdate base regex are towards the top of the source code, comment will give the format it expects

Zhiro90 commented 3 months ago

Thank you.

Date based numbering is buggy, if you have two releases the same day it craps itself... Fdate base regex are towards the top of the source code, comment will give the format it expects

Went to the source and found these two:

DATE_RX = [ cic(ur'(?P<year>(19[0-9][0-9]|20[0-3][0-9]))[\-\.\/\_](?P<month>(0[1-9]|1[0-2]))\2(?P<day>(0[1-9]|[12][0-9]|3[01]))'), #2024-05-21, 2024/25/31, 2024.05.31 cic(ur'(?P<day>(0[1-9]|[12][0-9]|3[01]))[ \-\.\/\_](?P<month>(0[1-9]|1[0-2]))\2(?P<year>(19[0-9][0-9]|20[0-3][0-9]))')] #21-05-2024, 21/05/2024, 21.05.2024


for rx in DATE_RX: match = rx.search(file) # file starts with "yyyy-mm-dd" "yyyy.mm.dd" "yyyy mm dd" or "yyyymmdd" if match:

Used those formats on my file names and still the same result (seasons grouped by file date). Used youtube-, youtube2- and only the channel ID.

In youtube agent readme the youtubedl command

Found the sample code as:

youtube-dl -v --dateafter 20081004 --download-archive /volume1/Youtube/.Downloaded -i -o "/volume1/Youtube/%(uploader)s [%(channel_id)s]/%(playlist_index)s - %(title)s [%(id)s].%(ext)s" -f bestvideo+bestaudio -ci --batch-file=/volume1/Youtube/Channels_to_DL.txt

which doesn't include a date in the output, so the results are still the same

ZeroQI commented 3 months ago

Custom scznner logs needed at this point, in logs subfolder named after the library name

Zhiro90 commented 3 months ago

scanner.log:

============================================================================================================================================================= Call: "Plex", path: "underland [youtube2-UCyw2MJ0aRF9ckJx2hSFhKOg]", folder_show: "underland [youtube2-UCyw2MJ0aRF9ckJx2hSFhKOg]", dirs (0), files (4)


============================================================================================================================================================= Forced ID (series folder) - source: "youtube2", id: "UCyw2MJ0aRF9ckJx2hSFhKOg" season: 2019, episode: 03170656, filename: \Zhiro-DSK\P\Z\Video\Youtube\Youtube Series\underland [youtube2-UCyw2MJ0aRF9ckJx2hSFhKOg]\2006_12_07 - Underland - Duality ( slipknot cover ) [N11S01IZ40o].mkv, season: 2024, episode: 05031406, filename: \Zhiro-DSK\P\Z\Video\Youtube\Youtube Series\underland [youtube2-UCyw2MJ0aRF9ckJx2hSFhKOg]\2008_0709 - Underland - Pantera cover - Cowboys from Hell #panteracoversfromhell [JnOGdO-wH8].mkv, season: 2019, episode: 07161028, filename: \Zhiro-DSK\P\Z\Video\Youtube\Youtube Series\underland [youtube2-UCyw2MJ0aRF9ckJx2hSFhKOg]\2009_02_02 - Underland - Damage Inc - Metallica cover [mWQkG1hc2Po].mkv, season: 2019, episode: 07200427, filename: \Zhiro-DSK\P\Z\Video\Youtube\Youtube Series\underland [youtube2-UCyw2MJ0aRF9ckJx2hSFhKOg]\2009_02_03 - Underland Stayin Alive Baby Got Back [zyP0eWTznO8].mkv, season: 2024, keys(1): ['05031406'] "underland [youtube2-UCyw2MJ0aRF9ckJx2hSFhKOg]" s2024e 5031406 "Youtube Date" "2008_0709 - Underland - Pantera cover - Cowboys from Hell #panteracoversfromhell [JnOGdO-wH8].mkv" "2008_0709 - Underland - Pantera cover - Cowboys from Hell #panteracoversfromhell [JnOGdO-wH8].mkv" season: 2019, keys(3): ['07200427', '03170656', '07161028'] "underland [youtube2-UCyw2MJ0aRF9ckJx2hSFhKOg]" s2019e 7200427 "Youtube Date" "2009_02_03 - Underland Stayin Alive Baby Got Back [zyP0eWTznO8].mkv" "2009_02_03 - Underland Stayin Alive Baby Got Back [zyP0eWTznO8].mkv" "underland [youtube2-UCyw2MJ0aRF9ckJx2hSFhKOg]" s2019e 3170656 "Youtube Date" "2006_12_07 - Underland - Duality ( slipknot cover ) [N11S01IZ40o].mkv" "2006_12_07 - Underland - Duality ( slipknot cover ) [N11S01IZ40o].mkv" "underland [youtube2-UCyw2MJ0aRF9ckJx2hSFhKOg]" s2019e 7161028 "Youtube Date" "2009_02_02 - Underland - Damage Inc - Metallica cover [mWQkG1hc2Po].mkv" "2009_02_02 - Underland - Damage Inc - Metallica cover [mWQkG1hc2Po].mkv"

ZeroQI commented 3 months ago

Apologies, youtube2 mode use the file year for the season and the rest of the date for the episode number, so you are better using youtube mode

        for rx in DATE_RX:
          match = rx.search(file)  # file starts with "yyyy-mm-dd" "yyyy.mm.dd" "yyyy mm dd" or "yyyymmdd"
          if match:
            if source=='youtube2': 
              filedate        = time.gmtime(os.path.getmtime(filename))
              season, episode = match.group('year'), '{:>02}{:>02}{:>02}{:>02}'.format(match.group('month'), match.group('day'), filedate[3], filedate[4])
            else:
              season, episode = match.group('year'), '{}-{:>02}-{:>02}'.format(match.group('year'), match.group('month'), match.group('day'))
            break

You will need to change the folder content or the results will be cached and not changing even if the filename would have changed since the content itself didn't... Attach the log file after renaming to youtube mode instead of youtube2, and rescanning after changing folder content

Zhiro90 commented 3 months ago

moved files around, changed to youtube- and rescanned. same thing, here's the log

============================================================================================================================================================= Call: "Plex", path: "underland [youtube-UCyw2MJ0aRF9ckJx2hSFhKOg]", folder_show: "underland [youtube-UCyw2MJ0aRF9ckJx2hSFhKOg]", dirs (0), files (4)


============================================================================================================================================================= Forced ID (series folder) - source: "youtube", id: "UCyw2MJ0aRF9ckJx2hSFhKOg" season: 2019, episode: 2019-03-17, filename: \Zhiro-DSK\P\Z\Video\Youtube\Youtube Series\underland [youtube-UCyw2MJ0aRF9ckJx2hSFhKOg]\2006_12_07 - Underland - Duality ( slipknot cover ) [N11S01IZ40o].mkv, season: 2024, episode: 2024-05-03, filename: \Zhiro-DSK\P\Z\Video\Youtube\Youtube Series\underland [youtube-UCyw2MJ0aRF9ckJx2hSFhKOg]\2008_0709 - Underland - Pantera cover - Cowboys from Hell #panteracoversfromhell [JnOGdO-wH8].mkv, season: 2019, episode: 2019-07-16, filename: \Zhiro-DSK\P\Z\Video\Youtube\Youtube Series\underland [youtube-UCyw2MJ0aRF9ckJx2hSFhKOg]\2009_02_02 - Underland - Damage Inc - Metallica cover [mWQkG1hc2Po].mkv, season: 2019, episode: 2019-07-20, filename: \Zhiro-DSK\P\Z\Video\Youtube\Youtube Series\underland [youtube-UCyw2MJ0aRF9ckJx2hSFhKOg]\2009_02_03 - Underland Stayin Alive Baby Got Back [zyP0eWTznO8].mkv, season: 2024, keys(1): ['2024-05-03'] "underland [youtube-UCyw2MJ0aRF9ckJx2hSFhKOg]" s2024e2024-05-03 "Youtube Date" "2008_0709 - Underland - Pantera cover - Cowboys from Hell #panteracoversfromhell [JnOGdO-wH8].mkv" "2008_0709 - Underland - Pantera cover - Cowboys from Hell #panteracoversfromhell [JnOGdO-wH8].mkv" season: 2019, keys(3): ['2019-03-17', '2019-07-20', '2019-07-16'] "underland [youtube-UCyw2MJ0aRF9ckJx2hSFhKOg]" s2019e2019-03-17 "Youtube Date" "2006_12_07 - Underland - Duality ( slipknot cover ) [N11S01IZ40o].mkv" "2006_12_07 - Underland - Duality ( slipknot cover ) [N11S01IZ40o].mkv" "underland [youtube-UCyw2MJ0aRF9ckJx2hSFhKOg]" s2019e2019-07-20 "Youtube Date" "2009_02_03 - Underland Stayin Alive Baby Got Back [zyP0eWTznO8].mkv" "2009_02_03 - Underland Stayin Alive Baby Got Back [zyP0eWTznO8].mkv" "underland [youtube-UCyw2MJ0aRF9ckJx2hSFhKOg]" s2019e2019-07-16 "Youtube Date" "2009_02_02 - Underland - Damage Inc - Metallica cover [mWQkG1hc2Po].mkv" "2009_02_02 - Underland - Damage Inc - Metallica cover [mWQkG1hc2Po].mkv"

Zhiro90 commented 3 months ago

and this one,using only the channel id

============================================================================================================================================================= Call: "Plex", path: "underland [UCyw2MJ0aRF9ckJx2hSFhKOg]", folder_show: "underland [UCyw2MJ0aRF9ckJx2hSFhKOg]", dirs (0), files (4)


============================================================================================================================================================= Forced ID (series folder) - source: "youtube", id: "UCyw2MJ0aRF9ckJx2hSFhKOg" season: 2019, episode: 2019-03-17, filename: \Zhiro-DSK\P\Z\Video\Youtube\Youtube Series\underland [UCyw2MJ0aRF9ckJx2hSFhKOg]\2006_12_07 - Underland - Duality ( slipknot cover ) [N11S01IZ40o].mkv, season: 2024, episode: 2024-05-03, filename: \Zhiro-DSK\P\Z\Video\Youtube\Youtube Series\underland [UCyw2MJ0aRF9ckJx2hSFhKOg]\2008_0709 - Underland - Pantera cover - Cowboys from Hell #panteracoversfromhell [JnOGdO-wH8].mkv, season: 2019, episode: 2019-07-16, filename: \Zhiro-DSK\P\Z\Video\Youtube\Youtube Series\underland [UCyw2MJ0aRF9ckJx2hSFhKOg]\2009_02_02 - Underland - Damage Inc - Metallica cover [mWQkG1hc2Po].mkv, season: 2019, episode: 2019-07-20, filename: \Zhiro-DSK\P\Z\Video\Youtube\Youtube Series\underland [UCyw2MJ0aRF9ckJx2hSFhKOg]\2009_02_03 - Underland Stayin Alive Baby Got Back [zyP0eWTznO8].mkv, season: 2024, keys(1): ['2024-05-03'] "underland [youtube-UCyw2MJ0aRF9ckJx2hSFhKOg]" s2024e2024-05-03 "Youtube Date" "2008_0709 - Underland - Pantera cover - Cowboys from Hell #panteracoversfromhell [JnOGdO-wH8].mkv" "2008_0709 - Underland - Pantera cover - Cowboys from Hell #panteracoversfromhell [JnOGdO-wH8].mkv" season: 2019, keys(3): ['2019-03-17', '2019-07-20', '2019-07-16'] "underland [youtube-UCyw2MJ0aRF9ckJx2hSFhKOg]" s2019e2019-03-17 "Youtube Date" "2006_12_07 - Underland - Duality ( slipknot cover ) [N11S01IZ40o].mkv" "2006_12_07 - Underland - Duality ( slipknot cover ) [N11S01IZ40o].mkv" "underland [youtube-UCyw2MJ0aRF9ckJx2hSFhKOg]" s2019e2019-07-20 "Youtube Date" "2009_02_03 - Underland Stayin Alive Baby Got Back [zyP0eWTznO8].mkv" "2009_02_03 - Underland Stayin Alive Baby Got Back [zyP0eWTznO8].mkv" "underland [youtube-UCyw2MJ0aRF9ckJx2hSFhKOg]" s2019e2019-07-16 "Youtube Date" "2009_02_02 - Underland - Damage Inc - Metallica cover [mWQkG1hc2Po].mkv" "2009_02_02 - Underland - Damage Inc - Metallica cover [mWQkG1hc2Po].mkv"

ZeroQI commented 3 months ago

Something is broken: s2019e2019-03-17, s2019e2019-07-20, s2019e2019-07-16 but that's what is coded https://github.com/ZeroQI/Absolute-Series-Scanner/blob/master/Scanners/Series/Absolute%20Series%20Scanner.py#L1051C15-L1051C142 try instead: season, episode = match.group('year'), '{:>02}{:>02}'.format(match.group('month'), match.group('day'))

Zhiro90 commented 3 months ago

Sorry for taking so long! chaned the line. It now is (with context) :

if source=='youtube2': filedate = time.gmtime(os.path.getmtime(filename)) season, episode = match.group('year'), '{:>02}{:>02}{:>02}{:>02}'.format(match.group('month'), match.group('day'), filedate[3], filedate[4]) else: season, episode = match.group('year'), '{:>02}{:>02}'.format(match.group('month'), match.group('day')) break

Results are the same, log:

============================================================================================================================================================= Call: "Plex", path: "underland [UCyw2MJ0aRF9ckJx2hSFhKOg]", folder_show: "underland [UCyw2MJ0aRF9ckJx2hSFhKOg]", dirs (0), files (4)


============================================================================================================================================================= Forced ID (series folder) - source: "youtube", id: "UCyw2MJ0aRF9ckJx2hSFhKOg" season: 2019, episode: 2019-03-17, filename: \Zhiro-DSK\P\Z\Video\Youtube\Youtube Series\underland [UCyw2MJ0aRF9ckJx2hSFhKOg]\2006_12_07 - Underland - Duality ( slipknot cover ) [N11S01IZ40o].mkv, season: 2024, episode: 2024-05-03, filename: \Zhiro-DSK\P\Z\Video\Youtube\Youtube Series\underland [UCyw2MJ0aRF9ckJx2hSFhKOg]\2008_0709 - Underland - Pantera cover - Cowboys from Hell #panteracoversfromhell [JnOGdO-wH8].mkv, season: 2019, episode: 2019-07-16, filename: \Zhiro-DSK\P\Z\Video\Youtube\Youtube Series\underland [UCyw2MJ0aRF9ckJx2hSFhKOg]\2009_02_02 - Underland - Damage Inc - Metallica cover [mWQkG1hc2Po].mkv, season: 2019, episode: 2019-07-20, filename: \Zhiro-DSK\P\Z\Video\Youtube\Youtube Series\underland [UCyw2MJ0aRF9ckJx2hSFhKOg]\2009_02_03 - Underland Stayin Alive Baby Got Back [zyP0eWTznO8].mkv, season: 2024, keys(1): ['2024-05-03'] "underland [youtube-UCyw2MJ0aRF9ckJx2hSFhKOg]" s2024e2024-05-03 "Youtube Date" "2008_0709 - Underland - Pantera cover - Cowboys from Hell #panteracoversfromhell [JnOGdO-wH8].mkv" "2008_0709 - Underland - Pantera cover - Cowboys from Hell #panteracoversfromhell [JnOGdO-wH8].mkv" season: 2019, keys(3): ['2019-03-17', '2019-07-20', '2019-07-16'] "underland [youtube-UCyw2MJ0aRF9ckJx2hSFhKOg]" s2019e2019-03-17 "Youtube Date" "2006_12_07 - Underland - Duality ( slipknot cover ) [N11S01IZ40o].mkv" "2006_12_07 - Underland - Duality ( slipknot cover ) [N11S01IZ40o].mkv" "underland [youtube-UCyw2MJ0aRF9ckJx2hSFhKOg]" s2019e2019-07-20 "Youtube Date" "2009_02_03 - Underland Stayin Alive Baby Got Back [zyP0eWTznO8].mkv" "2009_02_03 - Underland Stayin Alive Baby Got Back [zyP0eWTznO8].mkv" "underland [youtube-UCyw2MJ0aRF9ckJx2hSFhKOg]" s2019e2019-07-16 "Youtube Date" "2009_02_02 - Underland - Damage Inc - Metallica cover [mWQkG1hc2Po].mkv" "2009_02_02 - Underland - Damage Inc - Metallica cover [mWQkG1hc2Po].mkv"