mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-10 03:10:38 +00:00
parent
904a19ee93
commit
568f080518
@ -134,10 +134,17 @@ class IPrimaIE(InfoExtractor):
|
|||||||
), webpage, 'real id', group='id', default=None)
|
), webpage, 'real id', group='id', default=None)
|
||||||
|
|
||||||
if not video_id:
|
if not video_id:
|
||||||
nuxt_data = self._search_nuxt_data(webpage, video_id, traverse='data')
|
nuxt_data = self._search_nuxt_data(webpage, video_id, traverse='data', fatal=False)
|
||||||
video_id = traverse_obj(
|
video_id = traverse_obj(
|
||||||
nuxt_data, (..., 'content', 'additionals', 'videoPlayId', {str}), get_all=False)
|
nuxt_data, (..., 'content', 'additionals', 'videoPlayId', {str}), get_all=False)
|
||||||
|
|
||||||
|
if not video_id:
|
||||||
|
nuxt_data = self._search_json(
|
||||||
|
r'<script[^>]+\bid=["\']__NUXT_DATA__["\'][^>]*>',
|
||||||
|
webpage, 'nuxt data', None, end_pattern=r'</script>', contains_pattern=r'\[(?s:.+)\]')
|
||||||
|
|
||||||
|
video_id = traverse_obj(nuxt_data, lambda _, v: re.fullmatch(r'p\d+', v), get_all=False)
|
||||||
|
|
||||||
if not video_id:
|
if not video_id:
|
||||||
self.raise_no_formats('Unable to extract video ID from webpage')
|
self.raise_no_formats('Unable to extract video ID from webpage')
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user