diff options
author | bashonly <88596187+bashonly@users.noreply.github.com> | 2023-06-04 08:37:59 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-04 13:37:59 +0000 |
commit | 97d60ad8cd6c99f01e463a9acfce8693aff2a609 (patch) | |
tree | 2471e2aa8ce786f0032c626ac1395426bc3d8e49 /yt_dlp/extractor/amp.py | |
parent | 5ee9a7d6e18ceea956e831994cf11c423979354f (diff) | |
download | hypervideo-pre-97d60ad8cd6c99f01e463a9acfce8693aff2a609.tar.lz hypervideo-pre-97d60ad8cd6c99f01e463a9acfce8693aff2a609.tar.xz hypervideo-pre-97d60ad8cd6c99f01e463a9acfce8693aff2a609.zip |
[extractor/foxnews] Fix extractors (#7222)
Closes #6050
Authored by: bashonly
Diffstat (limited to 'yt_dlp/extractor/amp.py')
-rw-r--r-- | yt_dlp/extractor/amp.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/yt_dlp/extractor/amp.py b/yt_dlp/extractor/amp.py index b0cbd775c..0d259c549 100644 --- a/yt_dlp/extractor/amp.py +++ b/yt_dlp/extractor/amp.py @@ -5,6 +5,7 @@ from ..utils import ( int_or_none, mimetype2ext, parse_iso8601, + strip_jsonp, unified_timestamp, url_or_none, ) @@ -15,7 +16,7 @@ class AMPIE(InfoExtractor): # XXX: Conventionally, base classes should end with def _extract_feed_info(self, url): feed = self._download_json( url, None, 'Downloading Akamai AMP feed', - 'Unable to download Akamai AMP feed') + 'Unable to download Akamai AMP feed', transform_source=strip_jsonp) item = feed.get('channel', {}).get('item') if not item: raise ExtractorError('%s said: %s' % (self.IE_NAME, feed['error'])) @@ -73,8 +74,10 @@ class AMPIE(InfoExtractor): # XXX: Conventionally, base classes should end with media_url + '?hdcore=3.4.0&plugin=aasp-3.4.0.132.124', video_id, f4m_id='hds', fatal=False)) elif ext == 'm3u8': - formats.extend(self._extract_m3u8_formats( - media_url, video_id, 'mp4', m3u8_id='hls', fatal=False)) + fmts, subs = self._extract_m3u8_formats_and_subtitles( + media_url, video_id, 'mp4', m3u8_id='hls', fatal=False) + formats.extend(fmts) + self._merge_subtitles(subs, target=subtitles) else: formats.append({ 'format_id': media_data.get('media-category', {}).get('@attributes', {}).get('label'), |