jellyfin-youtube-metadata-plugin
jellyfin-youtube-metadata-plugin copied to clipboard
YouTube episode ordering not correctly labeled
Jellyfin:10.8.1 YoutubeMetaData: 1.0.3.7
I was downloading playlist using TheFrenchGhosty's archivist (no comments) script and I was having issues getting the videos in the correct order. For example downloading this playlist and then moving it into a jellyfin shows library using the following directory structure:
Youtube
└── Angory Tom
├── Warhammer Total War - Warlord Tom vs King Ben - (Angory Tom)\
├── 20170209 - Total War - Warhammer - First Blood! - Part #2\
├── 20170209 - Total War - Warhammer - First Blood! - Part #2 [VtiI1QL0K0A]description
├── 20170209 - Total War - Warhammer - First Blood! - Part #2 [VtiI1QL0K0A].info.json
├── 20170209 - Total War - Warhammer - First Blood! - Part #2 [VtiI1QL0K0A].mkv
├── 20170209 - Total War - Warhammer - First Blood! - Part #2 [VtiI1QL0K0A].webp
├── 20170212 - Total War - Warhammer - How to be a Warlord - Part #3
├── ...
├── ...
Gives the following in jellyfin:
Where every episode is listed as "1" instead of the order they appear in the playlist.
Can you try running the scheduled event "YouTubeMetadata" found in the scheduled events section of the admin panel manually? That should renumber them.
On Sat, Jul 2, 2022, 2:47 PM Alex @.***> wrote:
Jellyfin:10.8.1 YoutubeMetaData: 1.0.3.7
I was downloading playlist using TheFrenchGhosty's archivist (no comments) script and I was having issues getting the videos in the correct order. For example downloading this playlist https://www.youtube.com/playlist?list=PLkG-zhy1pVunIm7wdYvIXDPuYjA_iltO8 and then moving it into a jellyfin shows library using the following directory structure:
Youtube
└── Angory Tom ├── Warhammer Total War - Warlord Tom vs King Ben - (Angory Tom)\ ├── 20170209 - Total War - Warhammer - First Blood! - Part #2\ ├── 20170209 - Total War - Warhammer - First Blood! - Part #2 [VtiI1QL0K0A]description ├── 20170209 - Total War - Warhammer - First Blood! - Part #2 [VtiI1QL0K0A].info.json ├── 20170209 - Total War - Warhammer - First Blood! - Part #2 [VtiI1QL0K0A].mkv ├── 20170209 - Total War - Warhammer - First Blood! - Part #2 [VtiI1QL0K0A].webp ├── 20170212 - Total War - Warhammer - How to be a Warlord - Part #3 ├── ... ├── ...
Gives the following in jellyfin:
[image: image] https://user-images.githubusercontent.com/28536677/177016962-acb2500f-295f-455c-aff7-fcae2e188fba.png
Where every episode is listed as "1" instead of the order they appear in the playlist.
— Reply to this email directly, view it on GitHub https://github.com/ankenyr/jellyfin-youtube-metadata-plugin/issues/57, or unsubscribe https://github.com/notifications/unsubscribe-auth/AALYWLS4DLXHUWS5PWXBJZ3VSC2GVANCNFSM52PU66TA . You are receiving this because you are subscribed to this thread.Message ID: @.***>
Same issue :/ I do want to note that I don't have yt-dlp on my server. I am just relying on the local metadata.
Another thing I want to note, they appear in the correct order. Just the episode number is off.
Can you turn on debug logging and see if the logs tell us anything?
On Sun, Jul 3, 2022, 5:35 AM Alex @.***> wrote:
Another thing I want to note, they appear in the correct order. Just the episode number is off.
— Reply to this email directly, view it on GitHub https://github.com/ankenyr/jellyfin-youtube-metadata-plugin/issues/57#issuecomment-1173075302, or unsubscribe https://github.com/notifications/unsubscribe-auth/AALYWLRW3XRM3RFNCE4BOC3VSGCJZANCNFSM52PU66TA . You are receiving this because you commented.Message ID: @.***>
[2022-07-03 12:17:01.896 -04:00] [INF] [50] Emby.Server.Implementations.IO.LibraryMonitor: "Angory Tom" ("/media/youtube/Angory Tom") will be refreshed.
[2022-07-03 12:17:04.200 -04:00] [ERR] [55] MediaBrowser.Providers.TV.SeriesMetadataService: Error in "YoutubeMetadata"
System.IO.FileNotFoundException: youtube-dl not found on path!
at NYoutubeDL.Services.PreparationService.SetupPrepare(YoutubeDL ydl)
at NYoutubeDL.Services.InfoService.GetDownloadInfoAsync(YoutubeDL ydl, CancellationToken cancellationToken)
at NYoutubeDL.Services.PreparationService.PrepareDownloadAsync(YoutubeDL ydl, CancellationToken cancellationToken)
at NYoutubeDL.Services.DownloadService.DownloadAsync(YoutubeDL ydl, CancellationToken cancellationToken)
at NYoutubeDL.Services.DownloadService.DownloadAsync(YoutubeDL ydl, String url, CancellationToken cancellationToken)
at NYoutubeDL.YoutubeDL.DownloadAsync(String videoUrl)
at Jellyfin.Plugin.YoutubeMetadata.Utils.SearchChannel(String query, IServerApplicationPaths appPaths, CancellationToken cancellationToken)
at Jellyfin.Plugin.YoutubeMetadata.Providers.YTDLSeriesProvider.GetAndCacheMetadata(String name, IServerApplicationPaths appPaths, CancellationToken cancellationToken)
at Jellyfin.Plugin.YoutubeMetadata.Providers.YTDLSeriesProvider.GetMetadata(SeriesInfo info, CancellationToken cancellationToken)
at MediaBrowser.Providers.Manager.MetadataService`2.ExecuteRemoteProviders(MetadataResult`1 temp, String logName, TIdType id, IEnumerable`1 providers, CancellationToken cancellationToken)
[2022-07-03 12:17:04.208 -04:00] [ERR] [55] MediaBrowser.Providers.Manager.ProviderManager: "YTDLSeriesImageProvider" failed in GetImageInfos for type "Series" at "/media/youtube/Angory Tom"
System.IO.FileNotFoundException: youtube-dl not found on path!
at NYoutubeDL.Services.PreparationService.SetupPrepare(YoutubeDL ydl)
at NYoutubeDL.Services.InfoService.GetDownloadInfoAsync(YoutubeDL ydl, CancellationToken cancellationToken)
at NYoutubeDL.Services.PreparationService.PrepareDownloadAsync(YoutubeDL ydl, CancellationToken cancellationToken)
at NYoutubeDL.Services.DownloadService.DownloadAsync(YoutubeDL ydl, CancellationToken cancellationToken)
at NYoutubeDL.Services.DownloadService.DownloadAsync(YoutubeDL ydl, String url, CancellationToken cancellationToken)
at NYoutubeDL.YoutubeDL.DownloadAsync(String videoUrl)
at Jellyfin.Plugin.YoutubeMetadata.Utils.YTDLMetadata(String id, IServerApplicationPaths appPaths, CancellationToken cancellationToken)
at Jellyfin.Plugin.YoutubeMetadata.Providers.YoutubeDL.YTDLSeriesImageProvider.GetImages(BaseItem item, CancellationToken cancellationToken)
at MediaBrowser.Providers.Manager.ProviderManager.GetImages(BaseItem item, IRemoteImageProvider provider, String preferredLanguage, Boolean includeAllLanguages, CancellationToken cancellationToken, Nullable`1 type)
[2022-07-03 12:17:06.753 -04:00] [WRN] [94] Jellyfin.Server.Middleware.ResponseTimeMiddleware: Slow HTTP Response from "http://192.168.10.18:8096/Items/e3b37c7ee3c9a3f40db3e80c9e174ae6/Images/Backdrop?fillHeight=267&fillWidth=474&quality=96&tag=ad0e1a68fb91acb8b4f9e6a29b5a00ce" to "192.168.10.19" in 0:00:46.612073 with Status Code 200
[2022-07-03 12:17:12.279 -04:00] [ERR] [62] MediaBrowser.Providers.TV.SeriesMetadataService: Error in "YoutubeMetadata"
System.IO.FileNotFoundException: youtube-dl not found on path!
at NYoutubeDL.Services.PreparationService.SetupPrepare(YoutubeDL ydl)
at NYoutubeDL.Services.InfoService.GetDownloadInfoAsync(YoutubeDL ydl, CancellationToken cancellationToken)
at NYoutubeDL.Services.PreparationService.PrepareDownloadAsync(YoutubeDL ydl, CancellationToken cancellationToken)
at NYoutubeDL.Services.DownloadService.DownloadAsync(YoutubeDL ydl, CancellationToken cancellationToken)
at NYoutubeDL.Services.DownloadService.DownloadAsync(YoutubeDL ydl, String url, CancellationToken cancellationToken)
at NYoutubeDL.YoutubeDL.DownloadAsync(String videoUrl)
at Jellyfin.Plugin.YoutubeMetadata.Utils.SearchChannel(String query, IServerApplicationPaths appPaths, CancellationToken cancellationToken)
at Jellyfin.Plugin.YoutubeMetadata.Providers.YTDLSeriesProvider.GetAndCacheMetadata(String name, IServerApplicationPaths appPaths, CancellationToken cancellationToken)
at Jellyfin.Plugin.YoutubeMetadata.Providers.YTDLSeriesProvider.GetMetadata(SeriesInfo info, CancellationToken cancellationToken)
at MediaBrowser.Providers.Manager.MetadataService`2.ExecuteRemoteProviders(MetadataResult`1 temp, String logName, TIdType id, IEnumerable`1 providers, CancellationToken cancellationToken)
[2022-07-03 12:17:12.287 -04:00] [ERR] [62] MediaBrowser.Providers.Manager.ProviderManager: "YTDLSeriesImageProvider" failed in GetImageInfos for type "Series" at "/media/youtube/Angory Tom"
System.IO.FileNotFoundException: youtube-dl not found on path!
at NYoutubeDL.Services.PreparationService.SetupPrepare(YoutubeDL ydl)
at NYoutubeDL.Services.InfoService.GetDownloadInfoAsync(YoutubeDL ydl, CancellationToken cancellationToken)
at NYoutubeDL.Services.PreparationService.PrepareDownloadAsync(YoutubeDL ydl, CancellationToken cancellationToken)
at NYoutubeDL.Services.DownloadService.DownloadAsync(YoutubeDL ydl, CancellationToken cancellationToken)
at NYoutubeDL.Services.DownloadService.DownloadAsync(YoutubeDL ydl, String url, CancellationToken cancellationToken)
at NYoutubeDL.YoutubeDL.DownloadAsync(String videoUrl)
at Jellyfin.Plugin.YoutubeMetadata.Utils.YTDLMetadata(String id, IServerApplicationPaths appPaths, CancellationToken cancellationToken)
at Jellyfin.Plugin.YoutubeMetadata.Providers.YoutubeDL.YTDLSeriesImageProvider.GetImages(BaseItem item, CancellationToken cancellationToken)
at MediaBrowser.Providers.Manager.ProviderManager.GetImages(BaseItem item, IRemoteImageProvider provider, String preferredLanguage, Boolean includeAllLanguages, CancellationToken cancellationToken, Nullable`1 type)
[2022-07-03 12:17:57.957 -04:00] [ERR] [50] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: ffmpeg image extraction failed for "file:\"/media/youtube/Angory Tom/Book Wars - Versus Campaign - Warhammer Total War 2 - (Angory Tom)/20180203 - TOMB KINGS - BOOK WARS Versus Campaign - Part 1/20180203 - TOMB KINGS - BOOK WARS Versus Campaign - Part 1 [eAdKHEs-KXY].mkv\""
[2022-07-03 12:17:57.957 -04:00] [ERR] [50] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: I-frame image extraction failed, will attempt standard way. Input: "file:\"/media/youtube/Angory Tom/Book Wars - Versus Campaign - Warhammer Total War 2 - (Angory Tom)/20180203 - TOMB KINGS - BOOK WARS Versus Campaign - Part 1/20180203 - TOMB KINGS - BOOK WARS Versus Campaign - Part 1 [eAdKHEs-KXY].mkv\""
MediaBrowser.Common.FfmpegException: ffmpeg image extraction failed for file:"/media/youtube/Angory Tom/Book Wars - Versus Campaign - Warhammer Total War 2 - (Angory Tom)/20180203 - TOMB KINGS - BOOK WARS Versus Campaign - Part 1/20180203 - TOMB KINGS - BOOK WARS Versus Campaign - Part 1 [eAdKHEs-KXY].mkv"
at MediaBrowser.MediaEncoding.Encoder.MediaEncoder.ExtractImageInternal(String inputPath, String container, MediaStream videoStream, Nullable`1 imageStreamIndex, Nullable`1 threedFormat, Nullable`1 offset, Boolean useIFrame, Nullable`1 targetFormat, CancellationToken cancellationToken)
at MediaBrowser.MediaEncoding.Encoder.MediaEncoder.ExtractImage(String inputFile, String container, MediaStream videoStream, Nullable`1 imageStreamIndex, MediaSourceInfo mediaSource, Boolean isAudio, Nullable`1 threedFormat, Nullable`1 offset, Nullable`1 targetFormat, CancellationToken cancellationToken)
[2022-07-03 12:18:09.064 -04:00] [INF] [32] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: Killing ffmpeg process
[2022-07-03 12:18:09.064 -04:00] [ERR] [32] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: ffmpeg image extraction failed for "file:\"/media/youtube/Angory Tom/Book Wars - Versus Campaign - Warhammer Total War 2 - (Angory Tom)/20180203 - TOMB KINGS - BOOK WARS Versus Campaign - Part 1/20180203 - TOMB KINGS - BOOK WARS Versus Campaign - Part 1 [eAdKHEs-KXY].mkv\""
[2022-07-03 12:18:09.065 -04:00] [ERR] [32] Emby.Server.Implementations.MediaEncoder.EncodingManager: Error extracting chapter images for "/media/youtube/Angory Tom/Book Wars - Versus Campaign - Warhammer Total War 2 - (Angory Tom)/20180203 - TOMB KINGS - BOOK WARS Versus Campaign - Part 1/20180203 - TOMB KINGS - BOOK WARS Versus Campaign - Part 1 [eAdKHEs-KXY].mkv"
MediaBrowser.Common.FfmpegException: ffmpeg image extraction failed for file:"/media/youtube/Angory Tom/Book Wars - Versus Campaign - Warhammer Total War 2 - (Angory Tom)/20180203 - TOMB KINGS - BOOK WARS Versus Campaign - Part 1/20180203 - TOMB KINGS - BOOK WARS Versus Campaign - Part 1 [eAdKHEs-KXY].mkv"
at MediaBrowser.MediaEncoding.Encoder.MediaEncoder.ExtractImageInternal(String inputPath, String container, MediaStream videoStream, Nullable`1 imageStreamIndex, Nullable`1 threedFormat, Nullable`1 offset, Boolean useIFrame, Nullable`1 targetFormat, CancellationToken cancellationToken)
at MediaBrowser.MediaEncoding.Encoder.MediaEncoder.ExtractImage(String inputFile, String container, MediaStream videoStream, Nullable`1 imageStreamIndex, MediaSourceInfo mediaSource, Boolean isAudio, Nullable`1 threedFormat, Nullable`1 offset, Nullable`1 targetFormat, CancellationToken cancellationToken)
at Emby.Server.Implementations.MediaEncoder.EncodingManager.RefreshChapterImages(Video video, IDirectoryService directoryService, IReadOnlyList`1 chapters, Boolean extractImages, Boolean saveChapters, CancellationToken cancellationToken)
[2022-07-03 12:18:10.077 -04:00] [ERR] [32] MediaBrowser.Providers.Manager.ProviderManager: "YTDLImageProvider" failed in GetImageInfos for type "Episode" at "/media/youtube/Angory Tom/Book Wars - Versus Campaign - Warhammer Total War 2 - (Angory Tom)/20180203 - TOMB KINGS - BOOK WARS Versus Campaign - Part 1/20180203 - TOMB KINGS - BOOK WARS Versus Campaign - Part 1 [eAdKHEs-KXY].mkv"
System.IO.FileNotFoundException: youtube-dl not found on path!
at NYoutubeDL.Services.PreparationService.SetupPrepare(YoutubeDL ydl)
at NYoutubeDL.Services.InfoService.GetDownloadInfoAsync(YoutubeDL ydl, CancellationToken cancellationToken)
at NYoutubeDL.Services.PreparationService.PrepareDownloadAsync(YoutubeDL ydl, CancellationToken cancellationToken)
at NYoutubeDL.Services.DownloadService.DownloadAsync(YoutubeDL ydl, CancellationToken cancellationToken)
at NYoutubeDL.Services.DownloadService.DownloadAsync(YoutubeDL ydl, String url, CancellationToken cancellationToken)
at NYoutubeDL.YoutubeDL.DownloadAsync(String videoUrl)
at Jellyfin.Plugin.YoutubeMetadata.Utils.YTDLMetadata(String id, IServerApplicationPaths appPaths, CancellationToken cancellationToken)
at Jellyfin.Plugin.YoutubeMetadata.Providers.YoutubeDL.YTDLImageProvider.GetImages(BaseItem item, CancellationToken cancellationToken)
at MediaBrowser.Providers.Manager.ProviderManager.GetImages(BaseItem item, IRemoteImageProvider provider, String preferredLanguage, Boolean includeAllLanguages, CancellationToken cancellationToken, Nullable`1 type)
[2022-07-03 12:18:13.993 -04:00] [WRN] [55] Jellyfin.Server.Middleware.ResponseTimeMiddleware: Slow HTTP Response from "http://192.168.10.18:8096/Items/3cb58d5f3ac9a39207de44a29e798a12/Images/Primary?fillHeight=446&fillWidth=297&quality=96&tag=ab6f236eaa286d9c77993811f857eec3" to "192.168.10.19" in 0:01:44.9245991 with Status Code 200
[2022-07-03 12:18:14.201 -04:00] [ERR] [32] MediaBrowser.Providers.TV.SeriesMetadataService: Error in "YoutubeMetadata"
System.IO.FileNotFoundException: youtube-dl not found on path!
at NYoutubeDL.Services.PreparationService.SetupPrepare(YoutubeDL ydl)
at NYoutubeDL.Services.InfoService.GetDownloadInfoAsync(YoutubeDL ydl, CancellationToken cancellationToken)
at NYoutubeDL.Services.PreparationService.PrepareDownloadAsync(YoutubeDL ydl, CancellationToken cancellationToken)
at NYoutubeDL.Services.DownloadService.DownloadAsync(YoutubeDL ydl, CancellationToken cancellationToken)
at NYoutubeDL.Services.DownloadService.DownloadAsync(YoutubeDL ydl, String url, CancellationToken cancellationToken)
at NYoutubeDL.YoutubeDL.DownloadAsync(String videoUrl)
at Jellyfin.Plugin.YoutubeMetadata.Utils.SearchChannel(String query, IServerApplicationPaths appPaths, CancellationToken cancellationToken)
at Jellyfin.Plugin.YoutubeMetadata.Providers.YTDLSeriesProvider.GetAndCacheMetadata(String name, IServerApplicationPaths appPaths, CancellationToken cancellationToken)
at Jellyfin.Plugin.YoutubeMetadata.Providers.YTDLSeriesProvider.GetMetadata(SeriesInfo info, CancellationToken cancellationToken)
at MediaBrowser.Providers.Manager.MetadataService`2.ExecuteRemoteProviders(MetadataResult`1 temp, String logName, TIdType id, IEnumerable`1 providers, CancellationToken cancellationToken)
[2022-07-03 12:18:14.219 -04:00] [ERR] [32] MediaBrowser.Providers.Manager.ProviderManager: "YTDLSeriesImageProvider" failed in GetImageInfos for type "Series" at "/media/youtube/Angory Tom"
System.IO.FileNotFoundException: youtube-dl not found on path!
at NYoutubeDL.Services.PreparationService.SetupPrepare(YoutubeDL ydl)
at NYoutubeDL.Services.InfoService.GetDownloadInfoAsync(YoutubeDL ydl, CancellationToken cancellationToken)
at NYoutubeDL.Services.PreparationService.PrepareDownloadAsync(YoutubeDL ydl, CancellationToken cancellationToken)
at NYoutubeDL.Services.DownloadService.DownloadAsync(YoutubeDL ydl, CancellationToken cancellationToken)
at NYoutubeDL.Services.DownloadService.DownloadAsync(YoutubeDL ydl, String url, CancellationToken cancellationToken)
at NYoutubeDL.YoutubeDL.DownloadAsync(String videoUrl)
at Jellyfin.Plugin.YoutubeMetadata.Utils.YTDLMetadata(String id, IServerApplicationPaths appPaths, CancellationToken cancellationToken)
at Jellyfin.Plugin.YoutubeMetadata.Providers.YoutubeDL.YTDLSeriesImageProvider.GetImages(BaseItem item, CancellationToken cancellationToken)
at MediaBrowser.Providers.Manager.ProviderManager.GetImages(BaseItem item, IRemoteImageProvider provider, String preferredLanguage, Boolean includeAllLanguages, CancellationToken cancellationToken, Nullable`1 type)
[2022-07-03 12:21:12.321 -04:00] [INF] [94] Emby.Server.Implementations.IO.LibraryMonitor: "TOMB KINGS - BOOK WARS Versus Campaign - Part 1" ("/media/youtube/Angory Tom/Book Wars - Versus Campaign - Warhammer Total War 2 - (Angory Tom)/20180203 - TOMB KINGS - BOOK WARS Versus Campaign - Part 1/20180203 - TOMB KINGS - BOOK WARS Versus Campaign - Part 1 [eAdKHEs-KXY].mkv") will be refreshed.
[2022-07-03 12:21:12.322 -04:00] [INF] [94] Emby.Server.Implementations.IO.LibraryMonitor: "20180203 - TOMB KINGS - BOOK WARS Versus Campaign - Part 1" ("/media/youtube/Angory Tom/Book Wars - Versus Campaign - Warhammer Total War 2 - (Angory Tom)/20180203 - TOMB KINGS - BOOK WARS Versus Campaign - Part 1") will be refreshed.
[2022-07-03 12:21:12.322 -04:00] [INF] [94] Emby.Server.Implementations.IO.LibraryMonitor: "Book Wars - Versus Campaign - Warhammer Total War 2 - (Angory Tom)" ("/media/youtube/Angory Tom/Book Wars - Versus Campaign - Warhammer Total War 2 - (Angory Tom)") will be refreshed.
[2022-07-03 12:21:14.525 -04:00] [INF] [94] Emby.Server.Implementations.ScheduledTasks.TaskManager: Executing "YoutubeMetadata"
[2022-07-03 12:21:14.579 -04:00] [INF] [94] Emby.Server.Implementations.ScheduledTasks.TaskManager: "YoutubeMetadata" Completed after 0 minute(s) and 0 seconds
[2022-07-03 12:21:14.711 -04:00] [INF] [94] Emby.Server.Implementations.ScheduledTasks.TaskManager: ExecuteQueuedTasks
I am having a similar problem with the episodes not ordering correctly. I think it is because it is sorting them based on alphabetical order. https://github.com/ankenyr/jellyfin-youtube-metadata-plugin/blob/d98d101be7aa1e6087d4b6c1fc05c2d36cbf808f/Jellyfin.Plugin.YoutubeMetadata/EpisodeIndexer.cs#L87
Is there a way to order them by date %(upload_date)s
or do they need to be in a folder in themselves? I would prefer not because I do use the media deletion plugin to delete older videos I do not want to keep after I have watched them.
"%(uploader)s/%(uploader)s - %(upload_date)s - %(title)s/%(uploader)s - %(upload_date)s - %(title)s [%(id)s].%(ext)s"
Log Output
[20:44:04] [DBG] [96] Jellyfin.Plugin.YoutubeMetadata.EpisodeIndexer: Indexing show Gamer Meld
[20:44:04] [DBG] [96] Jellyfin.Plugin.YoutubeMetadata.EpisodeIndexer: Indexing season Season 1 as index 1
[20:44:04] [DBG] [96] Jellyfin.Plugin.YoutubeMetadata.EpisodeIndexer: Epsiode AMD CONFIRMS Insane Specs For RX 7000 GPUs! should now be index 1
[20:44:04] [DBG] [96] Jellyfin.Plugin.YoutubeMetadata.EpisodeIndexer: Epsiode AMD Has A HUGE Surprise For Nvidia! should now be index 2
[20:44:04] [DBG] [96] Jellyfin.Plugin.YoutubeMetadata.EpisodeIndexer: Epsiode Do NOT Buy Nvidia’s New GPU! should now be index 3
[20:44:04] [DBG] [96] Jellyfin.Plugin.YoutubeMetadata.EpisodeIndexer: Epsiode Nvidia And AMD Just Did The UNTHINKABLE! should now be index 4
[20:44:04] [DBG] [96] Jellyfin.Plugin.YoutubeMetadata.EpisodeIndexer: Epsiode Nvidia And AMD Won’t Like THIS! should now be index 5
[20:44:04] [DBG] [96] Jellyfin.Plugin.YoutubeMetadata.EpisodeIndexer: Epsiode Nvidia’s NEW GPU Is Even WORSE Than We Thought! should now be index 6
File Structure
@wjbridge I'll correct the title. Because my episodes are in the correct order they are just not labeled properly (e.g. every episode is labeled as 1). Although this may be related if the episode number is in the info.json file and youtubemetadata is not using it.
I uploaded another playlist and it's having the weird issue of some episodes being labeled and others all being 1. Will give more info and images later today.
@alexpattyn Thanks for the response. I have seen that problem with all being labeled as 1
. I am going to try to do more testing today.
So I am getting this on my server also, weird. I swear it was working. @wjbridge you need to look a bit further down. The one you link to is for the seasons https://github.com/ankenyr/jellyfin-youtube-metadata-plugin/blob/d98d101be7aa1e6087d4b6c1fc05c2d36cbf808f/Jellyfin.Plugin.YoutubeMetadata/EpisodeIndexer.cs#L106
I am using Name
for sorting which iirc is the file name. This was with the assumption that the naming in the file system using the method I use to name will always have them in their natural order due to the date being at the beginning.
I will need to see why there was a regression here. Testing should be added here. Honestly if anyone knows a good way to do an integration test for this plugin I would love to hear.
@ankenyr glad this is reproducible on your system at least. But I agree that just sorting it using the Name
should be good enough if using the defaults from TheFrenchGhostys scripts.
I have another playlist uploaded and I get the following:
Where multiple are listed as episode 1, and others just have the default file name. More interestingly when I go into Findroid that same playlist looks like this:
So for some reason Findroid sees some of the episodes numbered correctly (while the others are still 1).
We may be able to use playlist_index
from info.json to number the episodes.
I would need to know more about that piece inside the info.json before I could use it. The edge case I have is what happens when some old video that may have not bee archived appears. A lot of my content gets strikes even though they are fair use.
Gotcha, its best to keep the current implementation.
Like this one
CGP_Grey - 20140212 - The_Law_You_Won_t_Be_Told [uqH_Y1TupoQ].info.json
The playlist_index
shows 122
but I would expect it to be around 40. Is that possibly counting down where the latest video is 0?
Looking at the info.json files I have it seems to be counting up (first video = 1 last = end). But if it isn't robust then it may just cause more problems than it is worth.
So I am getting this on my server also, weird. I swear it was working. @wjbridge you need to look a bit further down. The one you link to is for the seasons
https://github.com/ankenyr/jellyfin-youtube-metadata-plugin/blob/d98d101be7aa1e6087d4b6c1fc05c2d36cbf808f/Jellyfin.Plugin.YoutubeMetadata/EpisodeIndexer.cs#L106
I am using
Name
for sorting which iirc is the file name. This was with the assumption that the naming in the file system using the method I use to name will always have them in their natural order due to the date being at the beginning.I will need to see why there was a regression here. Testing should be added here. Honestly if anyone knows a good way to do an integration test for this plugin I would love to hear.
You are absolutely right. My C# is rusty lol
I tried to use the video_autonumber
from yt-dlp
but I am not getting sequential numbers from each playlist. The behavior I am seeing from the following file names:
[17:40:42] [DBG] [38] Jellyfin.Plugin.YoutubeMetadata.EpisodeIndexer: Indexing show NetworkChuck
[17:40:42] [DBG] [38] Jellyfin.Plugin.YoutubeMetadata.EpisodeIndexer: Indexing season Season 01 as index 1
[17:40:42] [DBG] [38] Jellyfin.Plugin.YoutubeMetadata.EpisodeIndexer: Epsiode ditch Google!! (build your own PRIVATE search engine) should now be index 1
[17:40:42] [DBG] [38] Jellyfin.Plugin.YoutubeMetadata.EpisodeIndexer: Epsiode i KILLED my Linux computer!! (to teach you something) should now be index 2
[17:40:42] [DBG] [38] Jellyfin.Plugin.YoutubeMetadata.EpisodeIndexer: Epsiode let’s play with a ZERO-DAY vulnerability “follina” should now be index 3
[17:40:42] [DBG] [38] Jellyfin.Plugin.YoutubeMetadata.EpisodeIndexer: Epsiode the $0.30 Hacking Lab should now be index 4
[17:40:42] [DBG] [38] Jellyfin.Plugin.YoutubeMetadata.EpisodeIndexer: Epsiode you need to HACK faster!! (Linux Terminal hacks YOU NEED!!) should now be index 5
It is stripping out the entire first part NetworkChuck - S01EXX -
and sorting it based on alphabetical name. Does the x.Name
,y.Name
, and episode.Name
represent the title of the video or the filename of the video? Based on what I am seeing, it looks to be the title of the video not filename. I have tried different combinations of filenames but it is consistently ordered the same.
Maybe it should be episode.FileNameWithoutExtension
?https://github.com/jellyfin/jellyfin/blob/79f39f7336646758f1797f6fa8c1f7e16c59dfdf/MediaBrowser.Controller/Entities/BaseItem.cs#L366
For those of you having this issue. Can you look in the series (channel) metadata for the presence or absence of the channel id?
For a channel of mine that was having this issue, that was missing and it is what I key off of to determine if a show is controlled by my plugin.
@ankenyr I also had some issues with the title not carrying over (it just stays as the filename). But it also appears to be an issue with a missing ID:
This appears to be an issue for all my videos more or less.
Can you try and do a full scan replacing all metadata and supply the logs from that?
Looks like yt-dlp is not installed. In this case it isn't going to get anything for you.
[2022-07-09 16:32:41.991 -04:00] [ERR] [29] MediaBrowser.Providers.TV.SeriesMetadataService: Error in "YoutubeMetadata"
System.IO.FileNotFoundException: youtube-dl not found on path!
at NYoutubeDL.Services.PreparationService.SetupPrepare(YoutubeDL ydl)
at NYoutubeDL.Services.InfoService.GetDownloadInfoAsync(YoutubeDL ydl, CancellationToken cancellationToken)
at NYoutubeDL.Services.PreparationService.PrepareDownloadAsync(YoutubeDL ydl, CancellationToken cancellationToken)
at NYoutubeDL.Services.DownloadService.DownloadAsync(YoutubeDL ydl, CancellationToken cancellationToken)
at NYoutubeDL.Services.DownloadService.DownloadAsync(YoutubeDL ydl, String url, CancellationToken cancellationToken)
at NYoutubeDL.YoutubeDL.DownloadAsync(String videoUrl)
at Jellyfin.Plugin.YoutubeMetadata.Utils.SearchChannel(String query, IServerApplicationPaths appPaths, CancellationToken cancellationToken)
at Jellyfin.Plugin.YoutubeMetadata.Providers.YTDLSeriesProvider.GetAndCacheMetadata(String name, IServerApplicationPaths appPaths, CancellationToken cancellationToken)
at Jellyfin.Plugin.YoutubeMetadata.Providers.YTDLSeriesProvider.GetMetadata(SeriesInfo info, CancellationToken cancellationToken)
at MediaBrowser.Providers.Manager.MetadataService`2.ExecuteRemoteProviders(MetadataResult`1 temp, String logName, TIdType id, IEnumerable`1 providers, CancellationToken cancellationToken)
I am hoping I am providing the right information @ankenyr. Let me know if not. This is log output of a show being sorted by version 1.0.3.8
.
Problem
[20:49:34] [DBG] [22] Jellyfin.Plugin.YoutubeMetadata.EpisodeIndexer: Indexing show Linus Tech Tips
[20:49:34] [DBG] [22] Jellyfin.Plugin.YoutubeMetadata.EpisodeIndexer: Indexing season Season 2022 as index 1
[20:49:34] [DBG] [22] Jellyfin.Plugin.YoutubeMetadata.EpisodeIndexer: Epsiode I Await Sony’s Cease and Desist should now be index 1
[20:49:34] [DBG] [22] Jellyfin.Plugin.YoutubeMetadata.EpisodeIndexer: Epsiode I saved the best for last should now be index 2
[20:49:34] [DBG] [22] Jellyfin.Plugin.YoutubeMetadata.EpisodeIndexer: Epsiode Take down this video, Nintendo. I dare you. should now be index 3
[20:49:34] [DBG] [22] Jellyfin.Plugin.YoutubeMetadata.EpisodeIndexer: Epsiode The Mac Studio Rival that has it all? #SHORTS #macstudio should now be index 4
[20:49:34] [DBG] [22] Jellyfin.Plugin.YoutubeMetadata.EpisodeIndexer: Epsiode This Budget Gaming PC Is AWESOME should now be index 5
[20:49:34] [DBG] [22] Jellyfin.Plugin.YoutubeMetadata.EpisodeIndexer: Epsiode This can't be legal... #SHORTS #steamdeck #nintendoswitch should now be index 6
[20:49:34] [DBG] [22] Jellyfin.Plugin.YoutubeMetadata.EpisodeIndexer: Epsiode You’re cooling your PC wrong. should now be index 7
Actual Date of Episodes (don't match)
External Ids of series is populated
Investigation / Experiment I did experiment and replaced the following lines, compiled the plugin, and ran the indexer again.
episodes.Sort(delegate (BaseItem x, BaseItem y)
{
if (x.FileNameWithoutExtension == null && y.FileNameWithoutExtension == null) return 0;
else if (x.FileNameWithoutExtension == null) return -1;
else if (y.FileNameWithoutExtension == null) return 1;
else return x.FileNameWithoutExtension.CompareTo(y.FileNameWithoutExtension);
});
The date ordering is now correct (matches the file names).
[20:57:15] [DBG] [8] Jellyfin.Plugin.YoutubeMetadata.EpisodeIndexer: Indexing show Linus Tech Tips
[20:57:15] [DBG] [8] Jellyfin.Plugin.YoutubeMetadata.EpisodeIndexer: Indexing season Season 2022 as index 1
[20:57:15] [DBG] [8] Jellyfin.Plugin.YoutubeMetadata.EpisodeIndexer: Epsiode Linus_Tech_Tips - 20220704 - I_Await_Sony_s_Cease_and_Desist [0Hr8aqGp5mk] should now be index 1
[20:57:15] [DBG] [8] Jellyfin.Plugin.YoutubeMetadata.EpisodeIndexer: Epsiode Linus_Tech_Tips - 20220705 - This_Budget_Gaming_PC_Is_AWESOME [fuiAJFf0EJI] should now be index 2
[20:57:15] [DBG] [8] Jellyfin.Plugin.YoutubeMetadata.EpisodeIndexer: Epsiode Linus_Tech_Tips - 20220706 - I_saved_the_best_for_last [pyVZ05SO0Ic] should now be index 3
[20:57:15] [DBG] [8] Jellyfin.Plugin.YoutubeMetadata.EpisodeIndexer: Epsiode Linus_Tech_Tips - 20220707 - Take_down_this_video_Nintendo._I_dare_you. [oIYvPNtWZ34] should now be index 4
[20:57:15] [DBG] [8] Jellyfin.Plugin.YoutubeMetadata.EpisodeIndexer: Epsiode Linus_Tech_Tips - 20220707 - This_can_t_be_legal..._SHORTS_steamdeck_nintendoswitch [y5IqC6G974A] should now be index 5
[20:57:15] [DBG] [8] Jellyfin.Plugin.YoutubeMetadata.EpisodeIndexer: Epsiode Linus_Tech_Tips - 20220709 - The_Mac_Studio_Rival_that_has_it_all_SHORTS_macstudio [S1FHTrA89Ns] should now be index 6
[20:57:15] [DBG] [8] Jellyfin.Plugin.YoutubeMetadata.EpisodeIndexer: Epsiode Linus_Tech_Tips - 20220709 - You_re_cooling_your_PC_wrong. [T1ZnAwUg9CU] should now be index 7
I did notice the "sort title" in the metadata for each episode but I don't think it is being used in the plugin?? and don't even know how it gets populated / parsed.
I have noticed on a couple of shows it is not loading the main picture of the series
but the id is populated for the series
Are there any other metadata agents enabled? Can you show me what your library config looks like?
On Sat, Jul 9, 2022, 6:05 PM wjbridge @.***> wrote:
I am hoping I am providing the right information @ankenyr https://github.com/ankenyr. Let me know if not. This is log output of a show being sorted by version 1.0.3.8.
Problem
[20:49:34] [DBG] [22] Jellyfin.Plugin.YoutubeMetadata.EpisodeIndexer: Indexing show Linus Tech Tips
[20:49:34] [DBG] [22] Jellyfin.Plugin.YoutubeMetadata.EpisodeIndexer: Indexing season Season 2022 as index 1
[20:49:34] [DBG] [22] Jellyfin.Plugin.YoutubeMetadata.EpisodeIndexer: Epsiode I Await Sony’s Cease and Desist should now be index 1
[20:49:34] [DBG] [22] Jellyfin.Plugin.YoutubeMetadata.EpisodeIndexer: Epsiode I saved the best for last should now be index 2
[20:49:34] [DBG] [22] Jellyfin.Plugin.YoutubeMetadata.EpisodeIndexer: Epsiode Take down this video, Nintendo. I dare you. should now be index 3
[20:49:34] [DBG] [22] Jellyfin.Plugin.YoutubeMetadata.EpisodeIndexer: Epsiode The Mac Studio Rival that has it all? #SHORTS #macstudio should now be index 4
[20:49:34] [DBG] [22] Jellyfin.Plugin.YoutubeMetadata.EpisodeIndexer: Epsiode This Budget Gaming PC Is AWESOME should now be index 5
[20:49:34] [DBG] [22] Jellyfin.Plugin.YoutubeMetadata.EpisodeIndexer: Epsiode This can't be legal... #SHORTS #steamdeck #nintendoswitch should now be index 6
[20:49:34] [DBG] [22] Jellyfin.Plugin.YoutubeMetadata.EpisodeIndexer: Epsiode You’re cooling your PC wrong. should now be index 7
Actual Date of Episodes (don't match) [image: image] https://user-images.githubusercontent.com/5856635/178127242-800b4d7d-3ec4-4fb8-a344-2f933a209b9f.png
External Ids of series is populated [image: image] https://user-images.githubusercontent.com/5856635/178127260-699b7f54-3c27-4350-9a6a-43ee0bb51048.png
Investigation / Experiment I did experiment and replaced the following lines, compiled the plugin, and ran the indexer again.
episodes.Sort(delegate (BaseItem x, BaseItem y)
{
if (x.FileNameWithoutExtension == null && y.FileNameWithoutExtension == null) return 0; else if (x.FileNameWithoutExtension == null) return -1; else if (y.FileNameWithoutExtension == null) return 1; else return x.FileNameWithoutExtension.CompareTo(y.FileNameWithoutExtension);
});
The date ordering is now correct (matches the file names).
[20:57:15] [DBG] [8] Jellyfin.Plugin.YoutubeMetadata.EpisodeIndexer: Indexing show Linus Tech Tips
[20:57:15] [DBG] [8] Jellyfin.Plugin.YoutubeMetadata.EpisodeIndexer: Indexing season Season 2022 as index 1
[20:57:15] [DBG] [8] Jellyfin.Plugin.YoutubeMetadata.EpisodeIndexer: Epsiode Linus_Tech_Tips - 20220704 - I_Await_Sony_s_Cease_and_Desist [0Hr8aqGp5mk] should now be index 1
[20:57:15] [DBG] [8] Jellyfin.Plugin.YoutubeMetadata.EpisodeIndexer: Epsiode Linus_Tech_Tips - 20220705 - This_Budget_Gaming_PC_Is_AWESOME [fuiAJFf0EJI] should now be index 2
[20:57:15] [DBG] [8] Jellyfin.Plugin.YoutubeMetadata.EpisodeIndexer: Epsiode Linus_Tech_Tips - 20220706 - I_saved_the_best_for_last [pyVZ05SO0Ic] should now be index 3
[20:57:15] [DBG] [8] Jellyfin.Plugin.YoutubeMetadata.EpisodeIndexer: Epsiode Linus_Tech_Tips - 20220707 - Take_down_this_video_Nintendo._I_dare_you. [oIYvPNtWZ34] should now be index 4
[20:57:15] [DBG] [8] Jellyfin.Plugin.YoutubeMetadata.EpisodeIndexer: Epsiode Linus_Tech_Tips - 20220707 - This_can_t_be_legal..._SHORTS_steamdeck_nintendoswitch [y5IqC6G974A] should now be index 5
[20:57:15] [DBG] [8] Jellyfin.Plugin.YoutubeMetadata.EpisodeIndexer: Epsiode Linus_Tech_Tips - 20220709 - The_Mac_Studio_Rival_that_has_it_all_SHORTS_macstudio [S1FHTrA89Ns] should now be index 6
[20:57:15] [DBG] [8] Jellyfin.Plugin.YoutubeMetadata.EpisodeIndexer: Epsiode Linus_Tech_Tips - 20220709 - You_re_cooling_your_PC_wrong. [T1ZnAwUg9CU] should now be index 7
I did notice the "sort title" in the metadata for each episode but I don't think it is being used in the plugin?? and don't even know how it gets populated / parsed. [image: image] https://user-images.githubusercontent.com/5856635/178127432-8492ad82-6406-4f3b-b481-791e5a833ed3.png
I have noticed on a couple of shows it is not loading the main picture of the series [image: image] https://user-images.githubusercontent.com/5856635/178127365-acd73127-01e1-4ee6-b158-0657794f5815.png
but the id is populated for the series [image: image] https://user-images.githubusercontent.com/5856635/178127379-c5521128-8765-4683-a1b2-ac9558f2e0e0.png
— Reply to this email directly, view it on GitHub https://github.com/ankenyr/jellyfin-youtube-metadata-plugin/issues/57#issuecomment-1179631798, or unsubscribe https://github.com/notifications/unsubscribe-auth/AALYWLT2GCHNHKSWCNCHXMTVTIOT3ANCNFSM52PU66TA . You are receiving this because you were mentioned.Message ID: @.***>
Nope, see below. If there is a better way to share the library config. Let me know :)
https://github.com/ankenyr/jellyfin-youtube-metadata-plugin/blob/master/Jellyfin.Plugin.YoutubeMetadata/Utils.cs#L245 is where I set the sort name.
The code snippet you have is possibly correct but only for file names in the same structure as you an I. There is a pending issue desiring for Tube Archivist compatibility. Their naming is a lot different. Sorting is essentially based on the premiere date. So the snippet should look more like
episodes.Sort(delegate (BaseItem x, BaseItem y)
{
if (x.PremiereDate == null && y.PremiereDate == null) return 0;
else if (x.PremiereDate == null) return -1;
else if (y.PremiereDate == null) return 1;
else return x.PremiereDate .CompareTo(y.PremiereDate );
});
Thanks for referencing that code! So basically what I proposed would solve the problem for you and me but not for Tube Archivist compatibility. I am assuming that there will be some configuration options for both scenarios at some point?
I am assuming that the ForcedSortName
is used when filtering the videos based on date? I tried to change the code as you mentioned but got the following error. I am not knowledgeable enough in C#. Is there anything you would like me to test?
Jellyfin.Plugin.YoutubeMetadata\EpisodeIndexer.cs(106,52): error CS7036: There is no argument given that corresponds to the required formal paramete
r 'comparisonType' of 'MemoryExtensions.CompareTo(ReadOnlySpan<char>, ReadOnlySpan<char>, StringComparison)'
One other use case also is that I don't keep all the youtube shows I get. I use this docker image for obtaining the youtube videos. One problem is that when youtube videos get deleted (i.e. watched and 7 days later) the indexer will index the new videos again. Since I have "watched" S01E0X it will not mark it as unwatch because that episode number was already used. I am trying to think of solutions to this problem.
EDIT: I think I solved the error but I am not a C# master :)
episodes.Sort(delegate (BaseItem x, BaseItem y)
{
if (!x.PremiereDate.HasValue && !y.PremiereDate.HasValue) return 0;
else if (!x.PremiereDate.HasValue) return -1;
else if (!y.PremiereDate.HasValue) return 1;
else return DateTime.Compare(x.PremiereDate.Value, y.PremiereDate.Value);
});
The solution would work if switched to comparing premiere date for both. The code snippet was just an example. Comparisons of dates work different from comparing strings as you see from the error. Off hand I didn't know the exact syntax so I just switched the variables to give an idea. Sorry that was not clear.
Deletion of media is not something I will be considering as a feature. It breaks a lot of conventions in my perspective. A possible solution would be to make the files empty but named the same. That frees up storage if that is your concern. If you want to discuss this further please open a different issue as to not pollute this one.
On Sun, Jul 10, 2022, 11:03 AM wjbridge @.***> wrote:
So basically what I proposed would solve the problem for you and me but not for Tube Archivist compatibility. I am assuming that there will be some configuration options for both scenarios at some point?
I am assuming that the ForcedSortName is used when filtering the videos based on date? I tried to change the code as you mentioned but got the following error. I am not knowledgeable enough in C#. Is there anything you would like me to test?
Jellyfin.Plugin.YoutubeMetadata\EpisodeIndexer.cs(106,52): error CS7036: There is no argument given that corresponds to the required formal paramete r 'comparisonType' of 'MemoryExtensions.CompareTo(ReadOnlySpan
, ReadOnlySpan , StringComparison)' One other use case also is that I don't keep all the youtube shows I get. I use this docker image https://github.com/Jeeaaasus/youtube-dl for obtaining the youtube videos. One problem is that when youtube videos get deleted (i.e. watched and 7 days later) the indexer will index the new videos again. Since I have "watched" S01E06 it will not mark it as unwatch because that episode number was already used. I am trying to think of solutions to this problem.
— Reply to this email directly, view it on GitHub https://github.com/ankenyr/jellyfin-youtube-metadata-plugin/issues/57#issuecomment-1179772805, or unsubscribe https://github.com/notifications/unsubscribe-auth/AALYWLSM47EQGXIXWW7OGX3VTMF57ANCNFSM52PU66TA . You are receiving this because you were mentioned.Message ID: @.***>
I think I solved the error but I am not a C# pro :). Sorry about mixing issues. You are absolutely right got carried away there. If I may ask, what is the plan going forward to fix the order of episodes? As demonstrated, it does not order them based on date or filename until I change the code. I know this solution won't work for Tube Archivist
at this time but wondered if you had a plan or anything I could help / assist you.
episodes.Sort(delegate (BaseItem x, BaseItem y)
{
if (!x.PremiereDate.HasValue && !y.PremiereDate.HasValue) return 0;
else if (!x.PremiereDate.HasValue) return -1;
else if (!y.PremiereDate.HasValue) return 1;
else return DateTime.Compare(x.PremiereDate.Value, y.PremiereDate.Value);
});