ankenyr / jellyfin-youtube-metadata-plugin

Youtube Metadata Plugin for Jellyfin
GNU Affero General Public License v3.0
510 stars 33 forks source link

request feature #12

Closed frezeen closed 4 years ago

frezeen commented 4 years ago

im here for to write my 2 cents about this one. compiled from repo on a rpi4 for docker jellyfin version 10.6.2 confirm plugin work without problems. tested with about 10+ videos downloaded with yuoutubedl. all good, no problems.

i have a request only, can the plugin autocatch the video ID from .json files created from youtubedl? its a pain to manually add the id in downloaded files name everytime

thanks for all

ankenyr commented 4 years ago

It should pull in the metadata from the json file already, why would it need the ID from the Jason file? Would it be to subsequently query the YouTube API for possibly fresher metadata?

On Sun, Aug 16, 2020, 4:57 PM frezeen notifications@github.com wrote:

im here for to write my 2 cents about this one. compiled from repo on a rpi4 for docker , jellyfin versione 10.6.2 confirm plugin work without problems. tested with about 10+ videos downloaded with yuoutubedl. all good, no problems.

i have a request only, can the plugin autocatch the video ID from .json files created from youtubedl? its a pain to manually add the id in downloaded files name thanks for all

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ankenyr/jellyfin-youtube-metadata-plugin/issues/12, or unsubscribe https://github.com/notifications/unsubscribe-auth/AALYWLQDHYCOLISTYZHE3N3SBBXAJANCNFSM4QBCYV3A .

frezeen commented 4 years ago

if i dont raname with [ID numer].mp4 , plugin dont add metadata. image is not added to library, is it becouse Jason dont have image info maybe? question is: can i avoid to rename downloaded files with ID in name file everytime? i think best logic is: ask Jason for ID, rename file with [ID], query youtube for updated metadata + image or more best is ask Jason for ID and query youtube without need rename file. rename file broken youtubedl-material db for example.

ankenyr commented 4 years ago

If your mp4 file and .json file have the same name without the extensions, it should get the metadata from the json file.

frezeen commented 4 years ago

i dont know whats the problem is but it dont work for me

[2020-08-18 01:36:02.530 +02:00] [INF] [36] MediaBrowser.Providers.Manager.ProviderManager: OnRefreshStart "20d817cb6cb1ce4d601f6f1f88e48405" [2020-08-18 01:36:02.599 +02:00] [INF] [36] Jellyfin.Plugin.YoutubeMetadata.Providers.YoutubeLocalImageProvider: /data/video/Youtube/Lewis Capaldi - Someone You Loved.mp4 [2020-08-18 01:36:02.685 +02:00] [INF] [27] Jellyfin.Plugin.YoutubeMetadata.Providers.YoutubeMetadataProvider: [2020-08-18 01:36:02.685 +02:00] [INF] [27] Jellyfin.Plugin.YoutubeMetadata.Providers.YoutubeMetadataProvider: Youtube ID not found in filename of title: Lewis Capaldi - Someone You Loved [2020-08-18 01:36:02.687 +02:00] [INF] [27] Jellyfin.Plugin.YoutubeMetadata.Providers.YoutubeLocalProvider: Could not find "/data/video/Youtube/Lewis Capaldi - Someone You Loved.mp4" [2020-08-18 01:36:02.756 +02:00] [ERR] [25] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: ffmpeg image extraction failed for file:"/data/video/Youtube/Lewis Capaldi - Someone You Loved.mp4" [2020-08-18 01:36:02.759 +02:00] [ERR] [25] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: I-frame image extraction failed, will attempt standard way. Input: "file:\"/data/video/Youtube/Lewis Capaldi - Someone You Loved.mp4\"" System.Exception: ffmpeg image extraction failed for file:"/data/video/Youtube/Lewis Capaldi - Someone You Loved.mp4" at MediaBrowser.MediaEncoding.Encoder.MediaEncoder.ExtractImageInternal(String inputPath, String container, MediaStream videoStream, Nullable1 imageStreamIndex, Nullable1 threedFormat, Nullable1 offset, Boolean useIFrame, CancellationToken cancellationToken) at MediaBrowser.MediaEncoding.Encoder.MediaEncoder.ExtractImage(String[] inputFiles, String container, MediaStream videoStream, Nullable1 imageStreamIndex, MediaProtocol protocol, Boolean isAudio, Nullable1 threedFormat, Nullable1 offset, CancellationToken cancellationToken) [2020-08-18 01:36:02.842 +02:00] [ERR] [27] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: ffmpeg image extraction failed for file:"/data/video/Youtube/Lewis Capaldi - Someone You Loved.mp4" [2020-08-18 01:36:02.846 +02:00] [ERR] [27] MediaBrowser.Providers.Movies.MovieMetadataService: Error in "Screen Grabber" System.Exception: ffmpeg image extraction failed for file:"/data/video/Youtube/Lewis Capaldi - Someone You Loved.mp4" at MediaBrowser.MediaEncoding.Encoder.MediaEncoder.ExtractImageInternal(String inputPath, String container, MediaStream videoStream, Nullable1 imageStreamIndex, Nullable1 threedFormat, Nullable1 offset, Boolean useIFrame, CancellationToken cancellationToken) at MediaBrowser.MediaEncoding.Encoder.MediaEncoder.ExtractImage(String[] inputFiles, String container, MediaStream videoStream, Nullable1 imageStreamIndex, MediaProtocol protocol, Boolean isAudio, Nullable1 threedFormat, Nullable1 offset, CancellationToken cancellationToken) at MediaBrowser.Providers.MediaInfo.VideoImageProvider.GetVideoImage(Video item, CancellationToken cancellationToken) at MediaBrowser.Providers.Manager.ItemImageProvider.RefreshFromProvider(BaseItem item, IDynamicImageProvider provider, ImageRefreshOptions refreshOptions, TypeOptions savedOptions, LibraryOptions libraryOptions, ICollection`1 downloadedImages, RefreshResult result, CancellationToken cancellationToken) [2020-08-18 01:36:02.930 +02:00] [INF] [27] MediaBrowser.Providers.Manager.ProviderManager: OnRefreshComplete "20d817cb6cb1ce4d601f6f1f88e48405"

file names are how youtubedl-material use: Lewis Capaldi - Someone You Loved.mp4 Lewis Capaldi - Someone You Loved.info.json

try rename Lewis Capaldi - Someone You Loved.info.json in Lewis Capaldi - Someone You Loved with no success same log

ankenyr commented 4 years ago

I think this isn't to do with my plugin. Check out this issue on jellyfin https://github.com/jellyfin/jellyfin/issues/2355

You can see there is a line in your logs that has [ERR] on it and the message is talking about ffmpeg image extraction. It might be that my YouTube plugin is somehow triggering that an image should be extracted. I will try to verify this by grabbing an not and testing it. If I cannot reproduce it then i will likely close this issue assuming the issue above is more appropriate for the problem.

On Mon, Aug 17, 2020, 4:41 PM frezeen notifications@github.com wrote:

i dont know whats the problem is but i dont work for me

[2020-08-18 01:36:02.530 +02:00] [INF] [36] MediaBrowser.Providers.Manager.ProviderManager: OnRefreshStart "20d817cb6cb1ce4d601f6f1f88e48405" [2020-08-18 01:36:02.599 +02:00] [INF] [36] Jellyfin.Plugin.YoutubeMetadata.Providers.YoutubeLocalImageProvider: /data/video/Youtube/Lewis Capaldi - Someone You Loved.mp4 [2020-08-18 01:36:02.685 +02:00] [INF] [27] Jellyfin.Plugin.YoutubeMetadata.Providers.YoutubeMetadataProvider: [2020-08-18 01:36:02.685 +02:00] [INF] [27] Jellyfin.Plugin.YoutubeMetadata.Providers.YoutubeMetadataProvider: Youtube ID not found in filename of title: Lewis Capaldi - Someone You Loved [2020-08-18 01:36:02.687 +02:00] [INF] [27] Jellyfin.Plugin.YoutubeMetadata.Providers.YoutubeLocalProvider: Could not find "/data/video/Youtube/Lewis Capaldi - Someone You Loved.mp4" [2020-08-18 01:36:02.756 +02:00] [ERR] [25] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: ffmpeg image extraction failed for file:"/data/video/Youtube/Lewis Capaldi - Someone You Loved.mp4" [2020-08-18 01:36:02.759 +02:00] [ERR] [25] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: I-frame image extraction failed, will attempt standard way. Input: "file:"/data/video/Youtube/Lewis Capaldi - Someone You Loved.mp4"" System.Exception: ffmpeg image extraction failed for file:"/data/video/Youtube/Lewis Capaldi - Someone You Loved.mp4" at MediaBrowser.MediaEncoding.Encoder.MediaEncoder.ExtractImageInternal(String inputPath, String container, MediaStream videoStream, Nullable1 imageStreamIndex, Nullable1 threedFormat, Nullable1 offset, Boolean useIFrame, CancellationToken cancellationToken) at MediaBrowser.MediaEncoding.Encoder.MediaEncoder.ExtractImage(String[] inputFiles, String container, MediaStream videoStream, Nullable1 imageStreamIndex, MediaProtocol protocol, Boolean isAudio, Nullable1 threedFormat, Nullable1 offset, CancellationToken cancellationToken) [2020-08-18 01:36:02.842 +02:00] [ERR] [27] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: ffmpeg image extraction failed for file:"/data/video/Youtube/Lewis Capaldi - Someone You Loved.mp4" [2020-08-18 01:36:02.846 +02:00] [ERR] [27] MediaBrowser.Providers.Movies.MovieMetadataService: Error in "Screen Grabber" System.Exception: ffmpeg image extraction failed for file:"/data/video/Youtube/Lewis Capaldi - Someone You Loved.mp4" at MediaBrowser.MediaEncoding.Encoder.MediaEncoder.ExtractImageInternal(String inputPath, String container, MediaStream videoStream, Nullable1 imageStreamIndex, Nullable1 threedFormat, Nullable1 offset, Boolean useIFrame, CancellationToken cancellationToken) at MediaBrowser.MediaEncoding.Encoder.MediaEncoder.ExtractImage(String[] inputFiles, String container, MediaStream videoStream, Nullable1 imageStreamIndex, MediaProtocol protocol, Boolean isAudio, Nullable1 threedFormat, Nullable1 offset, CancellationToken cancellationToken) at MediaBrowser.Providers.MediaInfo.VideoImageProvider.GetVideoImage(Video item, CancellationToken cancellationToken) at MediaBrowser.Providers.Manager.ItemImageProvider.RefreshFromProvider(BaseItem item, IDynamicImageProvider provider, ImageRefreshOptions refreshOptions, TypeOptions savedOptions, LibraryOptions libraryOptions, ICollection`1 downloadedImages, RefreshResult result, CancellationToken cancellationToken) [2020-08-18 01:36:02.930 +02:00] [INF] [27] MediaBrowser.Providers.Manager.ProviderManager: OnRefreshComplete "20d817cb6cb1ce4d601f6f1f88e48405"

file names are how youtubedl-material use: Lewis Capaldi - Someone You Loved.mp4 Lewis Capaldi - Someone You Loved.info.json

try rename Lewis Capaldi - Someone You Loved.info.json in Lewis Capaldi - Someone You Loved with no success

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/ankenyr/jellyfin-youtube-metadata-plugin/issues/12#issuecomment-675168743, or unsubscribe https://github.com/notifications/unsubscribe-auth/AALYWLTRPQ4A6TXLHV5ECT3SBG53BANCNFSM4QBCYV3A .

frezeen commented 4 years ago

Excuse me if I insist that error is becouse my ffmpeg in jellyfin cant manage av1 format , i dont know if is that the problem but, listen me please, and sorry again for this if i rename files: Lewis Capaldi - Someone You Loved.mp4 Lewis Capaldi - Someone You Loved THIS DONT WORK here the log: [12:28:01] [INF] [103] Jellyfin.Plugin.YoutubeMetadata.Providers.YoutubeLocalImageProvider: /data/video/Youtube/Lewis Capaldi - Someone You Loved.mp4 Unsupported codec with id 32797 for input stream 0 [12:28:01] [INF] [42] Jellyfin.Plugin.YoutubeMetadata.Providers.YoutubeMetadataProvider: [12:28:01] [INF] [42] Jellyfin.Plugin.YoutubeMetadata.Providers.YoutubeMetadataProvider: Youtube ID not found in filename of title: Lewis Capaldi - Someone You Loved [12:28:01] [INF] [42] Jellyfin.Plugin.YoutubeMetadata.Providers.YoutubeLocalProvider: Could not find /data/video/Youtube/Lewis Capaldi - Someone You Loved.mp4 [12:28:01] [ERR] [98] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: ffmpeg image extraction failed for file:"/data/video/Youtube/Lewis Capaldi - Someone You Loved.mp4" [12:28:01] [ERR] [98] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: I-frame image extraction failed, will attempt standard way. Input: file:"/data/video/Youtube/Lewis Capaldi - Someone You Loved.mp4" System.Exception: ffmpeg image extraction failed for file:"/data/video/Youtube/Lewis Capaldi - Someone You Loved.mp4" at MediaBrowser.MediaEncoding.Encoder.MediaEncoder.ExtractImageInternal(String inputPath, String container, MediaStream videoStream, Nullable1 imageStreamIndex, Nullable1 threedFormat, Nullable1 offset, Boolean useIFrame, CancellationToken cancellationToken) at MediaBrowser.MediaEncoding.Encoder.MediaEncoder.ExtractImage(String[] inputFiles, String container, MediaStream videoStream, Nullable1 imageStreamIndex, MediaProtocol protocol, Boolean isAudio, Nullable1 threedFormat, Nullable1 offset, CancellationToken cancellationToken) [12:28:01] [ERR] [98] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: ffmpeg image extraction failed for file:"/data/video/Youtube/Lewis Capaldi - Someone You Loved.mp4" [12:28:01] [ERR] [98] MediaBrowser.Providers.Movies.MovieMetadataService: Error in Screen Grabber System.Exception: ffmpeg image extraction failed for file:"/data/video/Youtube/Lewis Capaldi - Someone You Loved.mp4" at MediaBrowser.MediaEncoding.Encoder.MediaEncoder.ExtractImageInternal(String inputPath, String container, MediaStream videoStream, Nullable1 imageStreamIndex, Nullable1 threedFormat, Nullable1 offset, Boolean useIFrame, CancellationToken cancellationToken) at MediaBrowser.MediaEncoding.Encoder.MediaEncoder.ExtractImage(String[] inputFiles, String container, MediaStream videoStream, Nullable1 imageStreamIndex, MediaProtocol protocol, Boolean isAudio, Nullable1 threedFormat, Nullable1 offset, CancellationToken cancellationToken) at MediaBrowser.Providers.MediaInfo.VideoImageProvider.GetVideoImage(Video item, CancellationToken cancellationToken) at MediaBrowser.Providers.Manager.ItemImageProvider.RefreshFromProvider(BaseItem item, IDynamicImageProvider provider, ImageRefreshOptions refreshOptions, TypeOptions savedOptions, LibraryOptions libraryOptions, ICollection`1 downloadedImages, RefreshResult result, CancellationToken cancellationToken)

but if i delete jason and rename file: Lewis Capaldi - Someone You Loved [Jtauh8GcxBY].mp4

the log: [12:33:07] [INF] [33] Jellyfin.Plugin.YoutubeMetadata.Providers.YoutubeLocalImageProvider: /data/video/Youtube/Lewis Capaldi - Someone You Loved [Jtauh8GcxBY].mp4 [12:33:07] [INF] [33] MediaBrowser.Providers.Manager.ProviderManager: OnRefreshComplete 20d817cb6cb1ce4d601f6f1f88e48405 [12:33:07] [INF] [33] Jellyfin.Plugin.YoutubeMetadata.Providers.YoutubeLocalImageProvider: /data/video/Youtube/Lewis Capaldi - Someone You Loved [Jtauh8GcxBY].mp4 [12:33:15] [INF] [59] Jellyfin.Plugin.YoutubeMetadata.Providers.YoutubeLocalImageProvider: /data/video/Youtube/Lewis Capaldi - Someone You Loved [Jtauh8GcxBY].mp4 Unsupported codec with id 32797 for input stream 0 [12:33:15] [INF] [66] Jellyfin.Plugin.YoutubeMetadata.Providers.YoutubeMetadataProvider: Jtauh8GcxBY [12:33:15] [INF] [66] Jellyfin.Plugin.YoutubeMetadata.Providers.YoutubeMetadataProvider: [null] [12:33:15] [INF] [66] Jellyfin.Plugin.YoutubeMetadata.Providers.YoutubeMetadataProvider: Google.Apis.YouTube.v3.Data.Video [12:33:15] [INF] [66] Jellyfin.Plugin.YoutubeMetadata.Providers.YoutubeLocalProvider: Could not find /data/video/Youtube/Lewis Capaldi - Someone You Loved [Jtauh8GcxBY].mp4

and this one finally work. metadata + image is grabbed from Youtube dont know if this can help u, but i dont think image grabber error mean somethings. u know, u are the hero :)

edit: i have new info. if i use plugin with a supported video file i got this log: [13:31:26] [INF] [71] Jellyfin.Plugin.YoutubeMetadata.Providers.YoutubeLocalImageProvider: /data/video/Youtube/Marco Mengoni - Ti ho voluto bene veramente (Videoclip).mp4

metadata are OK but file image is not the youtube official, i think its a frame grabbed from video

if i understand something, your plugin, if found jason , grab a image from video file and metaddata from jason, if file video is unsupported got a lots errors and dont work while, if jason is missing and u put ID on file name, grab metadata and good image from youtube without problems.

can we use this logic: if jason present pick id and grab all from youtube and let this image from video grab process for who dont want to use the api key? i think u use grab image from video for discard use of api key.

ankenyr commented 4 years ago

The image being extracted is due to an image not being found for the youtube plugin. The providers (things that grab metadata) are setup as either local or remote providers. Local being grabbing information from files local to the server (NFO, JSON , etc) or remote in that they use an API.

Providers also, I believe, run in a loop where all applicable providers are run, with their level of priority, until all metadata is filled or it gets to the end.

In this case the local metadata provider is being run and it gets to the youtube plugin. It will look for the JSON file. Inside the json file it contains metadata pertaining to the video. It will also look for a file with the same name but ending in jpg and use that for the image.

Having the local metadata provider end up doing remote actions would break convention.

There are a couple of ways forward here. 1) wait for https://github.com/ankenyr/jellyfin-youtube-metadata-plugin/issues/6 and you can tell jellyfin to use a specific ID for a file to ID it. This will help for one offs but if your entire library is not working this won't scale 2) Fix your library by including the ID. For your downloaded files this could be done with a script and for future videos you can refer to the output template documentation from youtube-dl https://github.com/ytdl-org/youtube-dl#output-template