mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2026-08-19 10:36:08 +03:00
@@ -3542,7 +3542,7 @@ class InfoExtractor:
|
||||
query = urllib.parse.urlparse(url).query
|
||||
url = re.sub(r'/(?:manifest|playlist|jwplayer)\.(?:m3u8|f4m|mpd|smil)', '', url)
|
||||
mobj = re.search(
|
||||
r'(?:(?:http|rtmp|rtsp)(?P<s>s)?:)?(?P<url>//[^?]+)', url)
|
||||
r'(?:(?:http|rtmp)(?P<s>s)?:)?(?P<url>//[^?]+)', url)
|
||||
url_base = mobj.group('url')
|
||||
http_base_url = '{}{}:{}'.format('http', mobj.group('s') or '', url_base)
|
||||
formats = []
|
||||
@@ -3567,28 +3567,16 @@ class InfoExtractor:
|
||||
video_id, mpd_id='dash', fatal=False))
|
||||
if re.search(r'(?:/smil:|\.smil)', url_base):
|
||||
if 'smil' not in skip_protocols:
|
||||
rtmp_formats = self._extract_smil_formats(
|
||||
formats.extend(self._extract_smil_formats(
|
||||
manifest_url('jwplayer.smil'),
|
||||
video_id, fatal=False)
|
||||
for rtmp_format in rtmp_formats:
|
||||
rtsp_format = rtmp_format.copy()
|
||||
rtsp_format['url'] = '{}/{}'.format(rtmp_format['url'], rtmp_format['play_path'])
|
||||
del rtsp_format['play_path']
|
||||
del rtsp_format['ext']
|
||||
rtsp_format.update({
|
||||
'url': rtsp_format['url'].replace('rtmp://', 'rtsp://'),
|
||||
'format_id': rtmp_format['format_id'].replace('rtmp', 'rtsp'),
|
||||
'protocol': 'rtsp',
|
||||
})
|
||||
formats.extend([rtmp_format, rtsp_format])
|
||||
video_id, fatal=False))
|
||||
else:
|
||||
for protocol in ('rtmp', 'rtsp'):
|
||||
if protocol not in skip_protocols:
|
||||
formats.append({
|
||||
'url': f'{protocol}:{url_base}',
|
||||
'format_id': protocol,
|
||||
'protocol': protocol,
|
||||
})
|
||||
if 'rtmp' not in skip_protocols:
|
||||
formats.append({
|
||||
'url': f'rtmp:{url_base}',
|
||||
'format_id': 'rtmp',
|
||||
'protocol': 'rtmp',
|
||||
})
|
||||
return formats
|
||||
|
||||
def _find_jwplayer_data(self, webpage, video_id=None, transform_source=js_to_json):
|
||||
|
||||
Reference in New Issue
Block a user