mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2025-08-14 16:38:29 +00:00
fixes to extractor regex, artist splitting, and half·alive test
This commit is contained in:
parent
13e6a52074
commit
223b3b75ef
@ -1671,12 +1671,37 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
|
|||||||
'url': 'https://music.youtube.com/watch?v=DbCvuSGfR3Y',
|
'url': 'https://music.youtube.com/watch?v=DbCvuSGfR3Y',
|
||||||
'info_dict': {
|
'info_dict': {
|
||||||
'id': 'DbCvuSGfR3Y',
|
'id': 'DbCvuSGfR3Y',
|
||||||
|
'ext': 'mp4',
|
||||||
'title': 'Back Around',
|
'title': 'Back Around',
|
||||||
'artists': ['half·alive'],
|
'artists': ['half·alive'],
|
||||||
'track': 'Back Around',
|
'track': 'Back Around',
|
||||||
'album': 'Conditions Of A Punk',
|
'album': 'Conditions Of A Punk',
|
||||||
'release_date': '20221202',
|
'release_date': '20221202',
|
||||||
'release_year': 2021,
|
'release_year': 2021,
|
||||||
|
'alt_title': 'Back Around',
|
||||||
|
'description': 'md5:bfc0e2b3cc903a608d8a85a13cb50f95',
|
||||||
|
'media_type': 'video',
|
||||||
|
'uploader': 'half•alive',
|
||||||
|
'channel': 'half•alive',
|
||||||
|
'channel_id': 'UCYQrYophdVI3nVDPOnXyIng',
|
||||||
|
'channel_url': 'https://www.youtube.com/channel/UCYQrYophdVI3nVDPOnXyIng',
|
||||||
|
'channel_is_verified': True,
|
||||||
|
'channel_follower_count': int,
|
||||||
|
'comment_count': int,
|
||||||
|
'view_count': int,
|
||||||
|
'like_count': int,
|
||||||
|
'age_limit': 0,
|
||||||
|
'duration': 223,
|
||||||
|
'thumbnail': 'https://i.ytimg.com/vi_webp/DbCvuSGfR3Y/maxresdefault.webp',
|
||||||
|
'heatmap': 'count:100',
|
||||||
|
'categories': ['Music'],
|
||||||
|
'tags': ['half·alive', 'Conditions Of A Punk', 'Back Around'],
|
||||||
|
'creators': ['half·alive'],
|
||||||
|
'timestamp': 1669889281,
|
||||||
|
'upload_date': '20221201',
|
||||||
|
'playable_in_embed': True,
|
||||||
|
'availability': 'public',
|
||||||
|
'live_status': 'not_live',
|
||||||
},
|
},
|
||||||
'params': {
|
'params': {
|
||||||
'skip_download': True,
|
'skip_download': True,
|
||||||
@ -4207,15 +4232,14 @@ def process_language(container, base_url, lang_code, sub_name, client_name, quer
|
|||||||
|
|
||||||
# Youtube Music Auto-generated description
|
# Youtube Music Auto-generated description
|
||||||
if (video_description or '').strip().endswith('\nAuto-generated by YouTube.'):
|
if (video_description or '').strip().endswith('\nAuto-generated by YouTube.'):
|
||||||
# Before you change this, learn how regexes work. The last guy didn't.
|
|
||||||
mobj = re.search(
|
mobj = re.search(
|
||||||
r'''(?xs)
|
r'''(?xs)
|
||||||
(?:\n|^)(?P<track>[^\n·]+)\ ·\ (?P<artist>[^\n]+)\n+
|
(?:\n|^)(?P<track>[^\n·]+)\ ·\ (?P<artist>[^\n]+)\n+
|
||||||
(?P<album>[^\n]+)\n+
|
(?P<album>[^\n]+)\n+
|
||||||
(?:℗\s*(?P<release_year>\d{4})[^\n]+\n+)?
|
(?:℗\s*(?P<release_year>\d{4}))?
|
||||||
(?:Released\ on\s*:\s*(?P<release_date>\d{4}-\d{2}-\d{2}))?
|
(?:.+?\nReleased\ on\s*:\s*(?P<release_date>\d{4}-\d{2}-\d{2}))?
|
||||||
(?:.+?\nArtist\s*:\s*(?P<clean_artist>[^\n]+)\n)?
|
(?:.+?\nArtist\s*:\s*(?P<clean_artist>[^\n]+)\n)?
|
||||||
.+Auto-generated\ by\ YouTube\.\s*$
|
.+\nAuto-generated\ by\ YouTube\.\s*$
|
||||||
''', video_description)
|
''', video_description)
|
||||||
if mobj:
|
if mobj:
|
||||||
release_year = mobj.group('release_year')
|
release_year = mobj.group('release_year')
|
||||||
|
Loading…
Reference in New Issue
Block a user