1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2025-08-13 16:08:29 +00:00
This commit is contained in:
TheQWERTYCodr 2025-08-12 12:41:05 -10:00 committed by GitHub
commit c4f23a23c5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1666,6 +1666,46 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
'view_count': int,
},
'params': {'skip_download': True},
}, {
# Youtube Music Auto-generated description with dot in artist name
'url': 'https://music.youtube.com/watch?v=DbCvuSGfR3Y',
'info_dict': {
'id': 'DbCvuSGfR3Y',
'ext': 'mp4',
'title': 'Back Around',
'artists': ['half·alive'],
'track': 'Back Around',
'album': 'Conditions Of A Punk',
'release_date': '20221202',
'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': {
'skip_download': True,
},
}]
_WEBPAGE_TESTS = [{
# <object>
@ -4192,20 +4232,14 @@ def process_language(container, base_url, lang_code, sub_name, client_name, quer
# Youtube Music Auto-generated description
if (video_description or '').strip().endswith('\nAuto-generated by YouTube.'):
# XXX: Causes catastrophic backtracking if description has "·"
# E.g. https://www.youtube.com/watch?v=DoPaAxMQoiI
# Simulating atomic groups: (?P<a>[^xy]+)x => (?=(?P<a>[^xy]+))(?P=a)x
# reduces it, but does not fully fix it. https://regex101.com/r/8Ssf2h/2
mobj = re.search(
r'''(?xs)
(?=(?P<track>[^\n·]+))(?P=track)·
(?=(?P<artist>[^\n]+))(?P=artist)\n+
(?=(?P<album>[^\n]+))(?P=album)\n
(?:.+?\s*(?P<release_year>\d{4})(?!\d))?
(?:.+?Released\ on\s*:\s*(?P<release_date>\d{4}-\d{2}-\d{2}))?
(.+?\nArtist\s*:\s*
(?=(?P<clean_artist>[^\n]+))(?P=clean_artist)\n
)?.+\nAuto-generated\ by\ YouTube\.\s*$
(?:\n|^)(?P<track>[^\n·]+)\ ·\ (?P<artist>[^\n]+)\n+
(?P<album>[^\n]+)\n+
(?:\s*(?P<release_year>\d{4}))?
(?:.+?\nReleased\ on\s*:\s*(?P<release_date>\d{4}-\d{2}-\d{2}))?
(?:.+?\nArtist\s*:\s*(?P<clean_artist>[^\n]+)\n)?
.+\nAuto-generated\ by\ YouTube\.\s*$
''', video_description)
if mobj:
release_year = mobj.group('release_year')
@ -4217,7 +4251,7 @@ def process_language(container, base_url, lang_code, sub_name, client_name, quer
info.update({
'album': mobj.group('album'.strip()),
'artists': ([a] if (a := mobj.group('clean_artist'))
else [a.strip() for a in mobj.group('artist').split('·')]),
else [a.strip() for a in mobj.group('artist').split(' · ')]),
'track': mobj.group('track').strip(),
'release_date': release_date,
'release_year': int_or_none(release_year),