Add back existing manifestfilter regex

pull/14186/head
CasperMcFadden95 4 weeks ago committed by GitHub
parent 4c1bf4b01c
commit 7213d740ac
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -1,5 +1,6 @@
import json import json
import math import math
import re
import urllib.parse import urllib.parse
from .common import InfoExtractor from .common import InfoExtractor
@ -57,22 +58,10 @@ class ShahidBaseIE(InfoExtractor):
if not stream_url: if not stream_url:
raise ExtractorError('Stream URL not found in API response.') raise ExtractorError('Stream URL not found in API response.')
# Remove query from stream_url that restricts video resolutions return self._extract_m3u8_formats_and_subtitles(re.sub(
cleaned_url = self.remove_params(stream_url) # https://docs.aws.amazon.com/mediapackage/latest/ug/manifest-filtering.html
r'aws\.manifestfilter=[\w:;,-]+&?',
formats = [] '', stream_url), video_id, 'mp4', live=live)
subtitles = []
for url in orderedSet((cleaned_url, stream_url)):
try:
formats, subtitles = self._extract_m3u8_formats_and_subtitles(
stream_url, video_id, 'mp4', live=live)
if formats:
break
except Exception as e:
self.report_warning(f'Failed to extract formats from {url}: {e}')
continue
return formats, subtitles
def _get_product_info(self, video_id): def _get_product_info(self, video_id):
return self._call_api('product/id', video_id, { return self._call_api('product/id', video_id, {

Loading…
Cancel
Save