mirror of
https://github.com/ytdl-org/youtube-dl.git
synced 2025-01-09 10:01:29 +00:00
Condensed code when extracting formats. Edited comments.
This commit is contained in:
parent
2fcb8b8c20
commit
f5e01562b1
@ -132,7 +132,7 @@ class SenateISVPIE(InfoExtractor):
|
|||||||
# extract more info about committee (for matching to possible locations)
|
# extract more info about committee (for matching to possible locations)
|
||||||
stream_number, stream_domain, stream_id, msl3 = self._get_info_for_comm(committee)
|
stream_number, stream_domain, stream_id, msl3 = self._get_info_for_comm(committee)
|
||||||
|
|
||||||
# possible locations that m3u8 could be located at
|
# the possible locations for the video: only the first has been seen in use
|
||||||
possible_manifest_urls = [
|
possible_manifest_urls = [
|
||||||
'https://www-senate-gov-media-srs.akamaized.net/hls/live/%d/%s/%s/master.m3u8' % (stream_id, committee, filename),
|
'https://www-senate-gov-media-srs.akamaized.net/hls/live/%d/%s/%s/master.m3u8' % (stream_id, committee, filename),
|
||||||
'https://www-senate-gov-msl3archive.akamaized.net/%s/%s_1/master.m3u8' % (msl3, filename),
|
'https://www-senate-gov-msl3archive.akamaized.net/%s/%s_1/master.m3u8' % (msl3, filename),
|
||||||
@ -140,17 +140,12 @@ class SenateISVPIE(InfoExtractor):
|
|||||||
'https://ussenate-f.akamaihd.net/i/%s' % video_id,
|
'https://ussenate-f.akamaihd.net/i/%s' % video_id,
|
||||||
]
|
]
|
||||||
|
|
||||||
# iterate through possible locations until we find a match (match found when formats is filled)
|
# we iterate through the possible locations until we find formats
|
||||||
formats = []
|
formats = []
|
||||||
for url in possible_manifest_urls:
|
for url in possible_manifest_urls:
|
||||||
entries = self._extract_m3u8_formats(
|
entries = self._extract_m3u8_formats(
|
||||||
url,
|
url, video_id, ext='mp4', m3u8_id='hls',
|
||||||
video_id,
|
entry_protocol='m3u8_native', fatal=False)
|
||||||
ext='mp4',
|
|
||||||
m3u8_id='hls',
|
|
||||||
entry_protocol='mu38_native',
|
|
||||||
fatal=False
|
|
||||||
)
|
|
||||||
|
|
||||||
for entry in entries:
|
for entry in entries:
|
||||||
mobj = re.search(r'(?P<tag>-[pb]).m3u8', entry['url'])
|
mobj = re.search(r'(?P<tag>-[pb]).m3u8', entry['url'])
|
||||||
|
Loading…
Reference in New Issue
Block a user