Repository navigation
[ytmusic] Parse metadata from music.youtube.com #622
Description
Activity
Give example URL
Thanks for the input, here wait till track number 3.
my full output template:
--output X:/ytdlp/%(artist)s %(album)s %(release_year)s/%(playlist_index)s %(artist)s %(track)s.%(ext)s
https://music.youtube.com/playlist?list=OLAK5uy_mRIIP5Yb0dvfvSWmIhYXicwNU0TKpN68wMultiple artist, not even listed on ytmusic site getting parsed.
Multiple artist, not even listed on ytmusic site getting parsed.
While yt-dlp accepts music URL, we actually parse data from youtube.com not ytmusic
The equivalent youtube page doesnt seem to contain this information - https://www.youtube.com/playlist?list=OLAK5uy_mRIIP5Yb0dvfvSWmIhYXicwNU0TKpN68w
Reacted by HodorReacted by Kostas- addedsite-enhancementFeature request for some websiteFeature request for some website
on Aug 4, 2021 - changed the title
[-][ytmusic]Parse only main album artist and album release year.[/-][+][ytmusic] Parse metadata from music.youtube.com[/+]on Aug 4, 2021 Any plans to add this feature? Would be really useful.
Reacted by Kostas, Yoann PAGEAUD and chilledfrogsDoes this metadata only show up for playlist ids starting with OLAK?
If so, I notice we could probably squeeze at least the page download in here:
yt-dlp/yt_dlp/extractor/youtube.py
Lines 4237 to 4251 in 2333ea1
if smuggled_data.get('is_music_url'): if item_id[:2] == 'VL': # Youtube music VL channels have an equivalent playlist item_id = item_id[2:] pre, tab, post, is_channel = 'https://www.youtube.com/playlist?list=%s' % item_id, '', '', False elif item_id[:2] == 'MP': # Youtube music albums (/channel/MP...) have a OLAK playlist that can be extracted from the webpage item_id = self._search_regex( r'\\x22audioPlaylistId\\x22:\\x22([0-9A-Za-z_-]+)\\x22', self._download_webpage('https://music.youtube.com/channel/%s' % item_id, item_id), 'playlist id') pre, tab, post, is_channel = 'https://www.youtube.com/playlist?list=%s' % item_id, '', '', False elif mobj['channel_type'] == 'browse': # Youtube music /browse/ should be changed to /channel/ pre = 'https://www.youtube.com/channel/%s' % item_id Reacted by Prit Kumar and Kostas@coletdjnz
Hey, sorry for the late reply been AFK lately. Thanks for your contribution to this issue!
I didn't see that those id's begin with OLAK until you mentioned this.
I checked some albums and indeed they all begin with OLAK!
Could you please elaborate a little more, how we could fix this issue with the information you provided? I can't really understand it from the snippet.
GreetingsI checked some albums and indeed they all begin with OLAK!
Cool, so that's one way we could detect to check for the extra metadata. Thanks.
Could you please elaborate a little more, how we could fix this issue with the information you provided? I can't really understand it from the snippet.
Don't worry about that, I'm just referencing ways we could implement this in code 😃
Another thing here is that the YouTube Music cover artwork should be used as the thumbnail, instead of the youtube.com 16:9 one
Reacted by pablogupi, Esokrates, github-account1111, Clément Nerma, sevi-kun, Flower, LX, pkpc99, D Trombett, mrbreitkreutz and 6 more@pukkandan I saw your comment in deepjyoti30/ytmdl#202 (comment) however, this is not reproducible anymore:
yt-dlp 7wtfhZwyrcc -O title= -O track= -O artist= -O album= title = 'Imagine Dragons - Believer (Official Music Video)' track = 'NA' artist = 'NA' album = 'NA'Would be really awesome if all the metadata could be fetched from Youtube music directly, this would eliminate the need to use third party tools that use youtube-dl to download the song and fetch metadata from other sources requiring careful manual intervention in order not to fetch the wrong metadata. So this would make things much better in terms of music collections!
Reacted by Yoann PAGEAUD and github-account1111@Esokrates Metadata extraction of songs is currently broken #4217
Reacted by EsokratesThanks for the input, here wait till track number 3. my full output template:
--output X:/ytdlp/%(artist)s %(album)s %(release_year)s/%(playlist_index)s %(artist)s %(track)s.%(ext)shttps://music.youtube.com/playlist?list=OLAK5uy_mRIIP5Yb0dvfvSWmIhYXicwNU0TKpN68wMultiple artist, not even listed on ytmusic site getting parsed.
The playlist seems to have different IDs between the "music.youtube.com" and "www.youtube.com" versions (another example from me is: https://music.youtube.com/playlist?list=OLAK5uy_nHB9DSjQxYMXFKwFIZz1WXXoZuQ4AxYuQ).
In such cases, yt-dlp cannot collect IDs from the "music.youtube.com" version (even with the--extractor-args "youtube:player_client=web_music"option).
If needed, I'll create another issue.Another thing here is that the YouTube Music cover artwork should be used as the thumbnail, instead of the youtube.com 16:9 one
Would be very useful, because it would eliminate having to do the cropping hacks described in #429 and probably result in higher quality artwork.
yt-dlp's still missing the Album Artist metadata that's available on YT Music. Channel/Uploader name can't be trusted, as the format varies (
- Topicvs. official channel, ...), and the description sadly doesn't contain the album artist for feat. tracks/compilations/etc.Reacted by Jonathan Chemla, Leonel, chilledfrogs, 2V3EvG4LMJFdRe and mrbreitkreutzSongs uploaded to YTM by user have wrong metadata. The Artists is Music Library Uploads and the date is upload date. Can this also be parsed correctly? And here are some additional metadata under View song credits like https://music.youtube.com/browse/MPTCbLNri2zIij8 (MPTC prefix + video id under browse page).
Reacted by github-account1111
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsYoutube Music
Checklist
Description
Hello, I'd like to ask for help another time. Would someone be able to implement the following feature:
If using following syntax:
--output "x:/muzik/%%(artist)s %%(album)s %%(release_year)sIt will work as expected, extract the song artists album name and song release year. But in most cases, there are many artist on a song and the song's were released in different year which produces multiple folders instead of ARTIST-ALBUM-RELEASE_YEAR it creates multiple folders: ARTIST1_ARTIST2_ALBUM_RELEASE_YEAR1 and ARTIST1_ARTIST2_ARTIST3_ALBUM_RELEASEYEAR2 which becomes confusing.
In my opinion the best solution would be able to to parse the album main artist and album release year (pic related) with a tag like %%(main_artist)s and %%(album_release_year). Maybe there is such a option, I tried various tags like 'creator' or 'uploader' or 'album_artist' but none of them work!

Thanks for reading and any input is appreciated!