ZeroQI / Absolute-Series-Scanner

Seasons, absolute mode, Subfolders...
999 stars 155 forks source link

Matching multiple files as alternate formats #466

Closed locke4 closed 10 months ago

locke4 commented 10 months ago

Platform

Operating system and version: Plex running in docker, container based on ubuntu jammy jellyfish Plex version: Version 1.32.6.7557

Expected Behavior

Running scanner to find youtube files in the following directory structure, expect to find Plex entry per video file (as they are uniquely named):

/videos /Technology Connections [UCy0tKL1T7wFoYcxCe0xjN6Q] ____/Thermostats Cooler than you think! [ZZC0SP02PqY].mkv ____/Exploring the World of E-Ink [dhRgw0HfrYU].mkv ____/DVD+R and DVD-R; What was that about [e1mJv9pxm7M].mkv

Current Behavior

All three video files are matched as alternate versions of "Thermostats Cooler than you think! [ZZC0SP02PqY].mkv". The other two files do not have Plex entries. Highlighted pertinent entries from log. If I had to guess, it's the fact that all of them have the same date modified on my filesystem (2021-02-11) which is causing them to be merged into one video file by the scanner, despite them having different titles.

Screenshot of Plex

season: 2021, episode: 2021-02-1103, filename: /youtube/video/Technology Connections [UCy0tKL1T7wFoYcxCe0xjN6Q]/Thermostats Cooler than you think! [ZZC0SP02PqY].mkv,
season: 2021, episode: 2021-02-1102, filename: /youtube/video/Technology Connections [UCy0tKL1T7wFoYcxCe0xjN6Q]/Exploring the World of E-Ink [dhRgw0HfrYU].mkv,
season: 2021, episode: 2021-02-11, filename: /youtube/video/Technology Connections [UCy0tKL1T7wFoYcxCe0xjN6Q]/DVD+R and DVD-R; What was that about [e1mJv9pxm7M].mkv,
season: 2018, episode: 2018-04-22, filename: /youtube/video/Technology Connections [UCy0tKL1T7wFoYcxCe0xjN6Q]/These Are Not Pixels Revisited [Ea6tw-gulnQ].mkv,

"Technology Connections [youtube-UCy0tKL1T7wFoYcxCe0xjN6Q]" s2021e2021-02-11                         "Youtube Date" "Thermostats Cooler than you think! [ZZC0SP02PqY].mkv" "Thermostats Cooler than you think! [ZZC0SP02PqY].mkv"
"Technology Connections [youtube-UCy0tKL1T7wFoYcxCe0xjN6Q]" s2021e2021-02-11                         "Youtube Date" "Exploring the World of E-Ink [dhRgw0HfrYU].mkv" "Exploring the World of E-Ink [dhRgw0HfrYU].mkv"
"Technology Connections [youtube-UCy0tKL1T7wFoYcxCe0xjN6Q]" s2021e2021-02-11                         "Youtube Date" "DVD+R and DVD-R; What was that about [e1mJv9pxm7M].mkv" "DVD+R and DVD-R; What was that about [e1mJv9pxm7M].mkv"

Technology Connections [UCy0tKL1T7wFoYcxCe0xjN6Q].filelist.log Technology Connections [UCy0tKL1T7wFoYcxCe0xjN6Q].scanner.log

Steps to Reproduce

  1. Download the above 3 videos from Technology Connections or create 3 files with same date modified
  2. Put them in one directory
  3. Create library in Plex for that directory with series scanner.

Additional information

Also using this with the youtube agent but can't see any problems with the metadata.

ZeroQI commented 10 months ago

https://www.reddit.com/r/PleX/comments/12alhj1/datebased_tv_episodes_with_two_from_the_same_day/?rdt=64257

As you can see the episode number was amended to not be duplicated but Plex still merged them...

This is a Plex issue for date based shows released on the same date, in which case one ep per day... Unsure how to raise it to Plex

https://github.com/ZeroQI/YouTube-Agent.bundle/issues/84

Using Playlist Id would fix If channel id and multiple release in rge same day I cannot see how to fix

locke4 commented 10 months ago

The reason I thought it was this scanner was that if I switch to another series scanner the issue goes away (but I wanted them ordered by year like ASS does, and the youtube-agent doesn't seem to play nice with any other scanners). It seems like this scanner not working correctly is a symptom of Plex then.

I'll try out playlist ID, I was also testing putting the published date in the video (they weren't actually released on the same day) and also trying [youtube2] GUID.

ZeroQI commented 10 months ago

Are you saying the other series scanner uses date based files as well but show different episodes for the same date?

locke4 commented 10 months ago

No, my issue with the other series scanners is that they don't group by date, just by an arbitrary number. So they never come across this bug.

The youtube2 mode worked better for me than playlist_id by the way. For new downloads, I'm going to also make sure the YYYY-MM-DD format is included in the title ({title} {YYYY-MM-DD} [youtube2-{channel_id}].[ext]. It seems like this bug is easy to work around once you pointed me in the right direction so I can close this issue, thanks!

Side note, it turned out I was typing the format of "youtube2" incorrectly. I think the documentation in the readme could be clearer. I checked the regex string in Python and saw what I needed to use. I was originally using [youtube2][Channel_id] as I assumed it would match anything like "youtube" in the title but I can see reading the example that channel_id is equivalent to the anidb number so should have been [youtube2-channel_id]. An extra example for youtube would be helpful but appreciate it's probably me reading the docs incorrectly.

ZeroQI commented 10 months ago

I apologize, but do find the description for the forced ID clear:

You can specify the guid to use the following way:

In Series folder name by adding " [guid_type-id_number]" at the end (like "Oruchuban Ebichu [anidb-150]")

locke4 commented 10 months ago

Unfortunately the youtube2 tag seems to create a new issue. It looks like Plex auto-generates the directory of the subtitle file and it's always pointing the transcoder to the directory which doesn't have the "youtube2-" part of the tag. This causes the transcoder to crash with a "can't find file" error.

Oct 22, 2023 15:24:57.779 [22382324669240] DEBUG - [Req#2fbdb/Transcode] [Universal] Using local file path instead of URL: /youtube/video/Technology Connections [youtube2-UCy0tKL1T7wFoYcxCe0xjN6Q]/A record player that can play CDs The Fisher DAC-145 [bxN2JSMpvCo].mkv
Oct 22, 2023 15:24:57.781 [22382341499704] DEBUG - [Req#2fd25] Calculated media file path for path [file:///youtube/video/Technology%20Connections%20[UCy0tKL1T7wFoYcxCe0xjN6Q]/A%20record%20player%20that%20can%20play%20CDs%20The%20Fisher%20DAC-145%20[bxN2JSMpvCo].en.vtt]: ["/youtube/video/Technology Connections [UCy0tKL1T7wFoYcxCe0xjN6Q]/A record player that can play CDs The Fisher DAC-145 [bxN2JSMpvCo].en.vtt"]
Oct 22, 2023 15:24:57.781 [22382341499704] ERROR - Couldn't find the file to stream: /youtube/video/Technology Connections [UCy0tKL1T7wFoYcxCe0xjN6Q]/A record player that can play CDs The Fisher DAC-145 [bxN2JSMpvCo].en.vtt

Any tips on where I should look to fix this? Renaming back to not include the [youtube-] tag seems to fix it. I was hoping it might be a cache error but after clearing plug-in support cache and Plex cache, refreshing metadata, recreating library etc. nothing seems to fix it.

ZeroQI commented 10 months ago

Subtitles are not managed by the scanner or agent to my knowledge, so dunno what to tell you...

locke4 commented 10 months ago

That's a shame. I'm assuming it's some incompatibility with plex's API for generating the subtitle directory from the XML populated by this scanner.

It seems just adding this scanner is enough to drop subtitle support. If I don't use this scanner, subtitles work fine and if I don't use youtube2- then they work fine too with this scanner but then I get the original bug of two files to one XML record. I'd be interested if anyone does have youtube2- working with subtitles!