[ie/GoPro] Fix extractor (#9019)

Authored by: stilor
This commit is contained in:
Alexey Neyman 2024-01-19 08:49:15 -08:00 committed by GitHub
parent 5eb1458be4
commit 4a07a455bb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -57,8 +57,8 @@ class GoProIE(InfoExtractor):
video_id = self._match_id(url) video_id = self._match_id(url)
webpage = self._download_webpage(url, video_id) webpage = self._download_webpage(url, video_id)
metadata = self._parse_json( metadata = self._search_json(
self._html_search_regex(r'window\.__reflectData\s*=\s*([^;]+)', webpage, 'metadata'), video_id) r'window\.__reflectData\s*=', webpage, 'metadata', video_id)
video_info = metadata['collectionMedia'][0] video_info = metadata['collectionMedia'][0]
media_data = self._download_json( media_data = self._download_json(
@ -99,7 +99,7 @@ class GoProIE(InfoExtractor):
'duration': int_or_none( 'duration': int_or_none(
video_info.get('source_duration')), video_info.get('source_duration')),
'artist': str_or_none( 'artist': str_or_none(
video_info.get('music_track_artist')), video_info.get('music_track_artist')) or None,
'track': str_or_none( 'track': str_or_none(
video_info.get('music_track_name')), video_info.get('music_track_name')) or None,
} }