Repository navigation
yt-dlp: Expanded media tags support - #31
Merged
Merged
Conversation
We can use channel info as "artist" tag (like Chrome does), so it shows up in MPRIS for example. Also extract description in case some other app wants it.
Use Gio file APIs to fetch best quality thumbnail. Afterwards, create an image sample from downloaded data and add it to tags as preview image. This change allows MPRIS enhancer to use it as media artwork, which is the same as what Chrome browser shows in its own MPRIS implementation.
Have a separate function for it, so main extract function is cleaner
Since extraction tags are also added there, lets have all similar logic in single place
Allows apps to read "artist" tag on a queued item
Using "gst_tag_image_data_to_image_sample" makes few things easier and does not require us to parse the mimetype from URI, as it does this by checking the data instead. Fixes issue where preview image would not be generated for URIs that do not have file extension in them.
GStreamer supports "text/uri-list" as image sample (see gst_tag_image_data_to_image_sample docs), so lets avoid fetching image for each playlist item when parsing a playlist
When image sample holds an URI, we can use it as-is with MPRIS clients. In cases where media image gets updated, keep a reference on sample inside each track data. Use it to compare object pointers and determine whether art needs unpacking again.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add more media item tags support to yt-dlp based enhancer. Allows apps to access more video data such as: channel name, media description, genre and preview image.
In cases of playlist extraction, use preview image URI as a sample that contains "text/uri-list". This does not require us to do additional multiple requests to fetch each playlist item image and GStreamer officially supports (according to its documentation) URIs as image sample too.
Due to the above, also add sample artwork in the form of URI (instead of image data) handling in MPRIS, to make all this work together.