mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2025-06-28 09:28:33 +00:00
fix: tracks with meta in data-exec
This commit is contained in:
parent
a38798b479
commit
fb342c0a66
@ -14,7 +14,9 @@
|
|||||||
UserNotLive,
|
UserNotLive,
|
||||||
clean_html,
|
clean_html,
|
||||||
get_element_by_class,
|
get_element_by_class,
|
||||||
|
get_element_html_by_class,
|
||||||
get_element_html_by_id,
|
get_element_html_by_id,
|
||||||
|
extract_attributes,
|
||||||
int_or_none,
|
int_or_none,
|
||||||
join_nonempty,
|
join_nonempty,
|
||||||
parse_qs,
|
parse_qs,
|
||||||
@ -793,6 +795,23 @@ class VKMusicIE(VKBaseIE):
|
|||||||
'skip_download': True,
|
'skip_download': True,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
'note': 'meta is AudioPlayerBlock__root[data-exec], no artists in 17/18',
|
||||||
|
'url': 'https://vk.com/audio-26549346_456239443',
|
||||||
|
'info_dict': {
|
||||||
|
'id': '-26549346_456239443',
|
||||||
|
'ext': 'm4a',
|
||||||
|
'title': 'Fairie\'s Death Waltz - Still to Wake',
|
||||||
|
'track': 'Still to Wake',
|
||||||
|
'uploader': 'Fairie\'s Death Waltz',
|
||||||
|
'artists': ['Fairie\'s Death Waltz'],
|
||||||
|
'duration': 349,
|
||||||
|
'thumbnail': r're:https?://.*\.jpg',
|
||||||
|
},
|
||||||
|
'params': {
|
||||||
|
'skip_download': True,
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
'url': 'https://vk.com/artist/linkinpark/releases?z=audio_playlist-2000984503_984503%2Fc468f3a862b6f73b55',
|
'url': 'https://vk.com/artist/linkinpark/releases?z=audio_playlist-2000984503_984503%2Fc468f3a862b6f73b55',
|
||||||
'info_dict': {
|
'info_dict': {
|
||||||
@ -852,10 +871,19 @@ def _real_extract(self, url):
|
|||||||
# copied regex from VKWallPostIE
|
# copied regex from VKWallPostIE
|
||||||
# XXX: common code should be unified, moved to a class
|
# XXX: common code should be unified, moved to a class
|
||||||
data_audio = self._search_regex(
|
data_audio = self._search_regex(
|
||||||
r'data-audio="([^"]+)',
|
r'data-audio="([^"]+)', webpage, 'data-audio attr',
|
||||||
webpage, 'data-audio attr', group=1)
|
default=None, group=1)
|
||||||
|
|
||||||
|
if data_audio:
|
||||||
|
meta = self._parse_json(unescapeHTML(data_audio), track_id)
|
||||||
|
else:
|
||||||
|
player = get_element_html_by_class('AudioPlayerBlock__root', webpage)
|
||||||
|
meta = traverse_obj(
|
||||||
|
self._parse_json(
|
||||||
|
extract_attributes(player).get('data-exec'),
|
||||||
|
track_id),
|
||||||
|
('AudioPlayerBlock/init', 'firstAudio'))
|
||||||
|
|
||||||
meta = self._parse_json(unescapeHTML(data_audio), track_id)
|
|
||||||
one_more_id = meta[24]
|
one_more_id = meta[24]
|
||||||
|
|
||||||
del data_audio
|
del data_audio
|
||||||
|
Loading…
Reference in New Issue
Block a user