mirror of
https://github.com/blackjack4494/yt-dlc.git
synced 2024-12-22 07:43:08 +00:00
[puhutv] Remove no longer available HTTP formats (closes #25124)
This commit is contained in:
parent
00a41ca4c3
commit
f7f304910d
1 changed files with 2 additions and 18 deletions
|
@ -82,17 +82,6 @@ class PuhuTVIE(InfoExtractor):
|
||||||
urls = []
|
urls = []
|
||||||
formats = []
|
formats = []
|
||||||
|
|
||||||
def add_http_from_hls(m3u8_f):
|
|
||||||
http_url = m3u8_f['url'].replace('/hls/', '/mp4/').replace('/chunklist.m3u8', '.mp4')
|
|
||||||
if http_url != m3u8_f['url']:
|
|
||||||
f = m3u8_f.copy()
|
|
||||||
f.update({
|
|
||||||
'format_id': f['format_id'].replace('hls', 'http'),
|
|
||||||
'protocol': 'http',
|
|
||||||
'url': http_url,
|
|
||||||
})
|
|
||||||
formats.append(f)
|
|
||||||
|
|
||||||
for video in videos['data']['videos']:
|
for video in videos['data']['videos']:
|
||||||
media_url = url_or_none(video.get('url'))
|
media_url = url_or_none(video.get('url'))
|
||||||
if not media_url or media_url in urls:
|
if not media_url or media_url in urls:
|
||||||
|
@ -101,12 +90,9 @@ class PuhuTVIE(InfoExtractor):
|
||||||
|
|
||||||
playlist = video.get('is_playlist')
|
playlist = video.get('is_playlist')
|
||||||
if (video.get('stream_type') == 'hls' and playlist is True) or 'playlist.m3u8' in media_url:
|
if (video.get('stream_type') == 'hls' and playlist is True) or 'playlist.m3u8' in media_url:
|
||||||
m3u8_formats = self._extract_m3u8_formats(
|
formats.extend(self._extract_m3u8_formats(
|
||||||
media_url, video_id, 'mp4', entry_protocol='m3u8_native',
|
media_url, video_id, 'mp4', entry_protocol='m3u8_native',
|
||||||
m3u8_id='hls', fatal=False)
|
m3u8_id='hls', fatal=False))
|
||||||
for m3u8_f in m3u8_formats:
|
|
||||||
formats.append(m3u8_f)
|
|
||||||
add_http_from_hls(m3u8_f)
|
|
||||||
continue
|
continue
|
||||||
|
|
||||||
quality = int_or_none(video.get('quality'))
|
quality = int_or_none(video.get('quality'))
|
||||||
|
@ -128,8 +114,6 @@ class PuhuTVIE(InfoExtractor):
|
||||||
format_id += '-%sp' % quality
|
format_id += '-%sp' % quality
|
||||||
f['format_id'] = format_id
|
f['format_id'] = format_id
|
||||||
formats.append(f)
|
formats.append(f)
|
||||||
if is_hls:
|
|
||||||
add_http_from_hls(f)
|
|
||||||
self._sort_formats(formats)
|
self._sort_formats(formats)
|
||||||
|
|
||||||
creator = try_get(
|
creator = try_get(
|
||||||
|
|
Loading…
Reference in a new issue