mirror of
https://codeberg.org/polarisfm/youtube-dl
synced 2024-12-25 07:47:55 +01:00
playerglobewien - add audio only to formats to prevent to returns
This commit is contained in:
parent
a734819a6c
commit
bd7e0caa13
@ -65,34 +65,33 @@ class PlayerGlobeWienIE(InfoExtractor):
|
|||||||
]
|
]
|
||||||
|
|
||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
video_id = self._match_id(url)
|
format_id = self._match_id(url)
|
||||||
print(video_id)
|
webpage = self._download_webpage(url, format_id)
|
||||||
webpage = self._download_webpage(url, video_id)
|
|
||||||
formats = []
|
formats = []
|
||||||
title = self._og_search_title(webpage)
|
title = self._og_search_title(webpage)
|
||||||
title = re.sub(r'^(Globe Wien VOD -|Hader VOD -)\s*', '', title)
|
title = re.sub(r'^(Globe Wien VOD -|Hader VOD -)\s*', '', title)
|
||||||
|
|
||||||
streamurl = self._download_json("https://player.globe.wien/api/playout?vodId=" + video_id,
|
streamurl = self._download_json("https://player.globe.wien/api/playout?vodId=" + format_id,
|
||||||
video_id).get('streamUrl')
|
format_id).get('streamUrl')
|
||||||
|
|
||||||
if streamurl.get('hls'):
|
if streamurl.get('hls'):
|
||||||
formats.extend(self._extract_m3u8_formats(
|
formats.extend(self._extract_m3u8_formats(
|
||||||
streamurl.get('hls'), video_id, 'mp4', entry_protocol='m3u8_native', m3u8_id='hls'))
|
streamurl.get('hls'), format_id, 'mp4', entry_protocol='m3u8_native', m3u8_id='hls'))
|
||||||
|
|
||||||
if streamurl.get('dash'):
|
if streamurl.get('dash'):
|
||||||
formats.extend(self._extract_mpd_formats(
|
formats.extend(self._extract_mpd_formats(
|
||||||
streamurl.get('dash'), video_id, mpd_id='dash', fatal=False))
|
streamurl.get('dash'), format_id, mpd_id='dash', fatal=False))
|
||||||
|
|
||||||
if streamurl.get('audio'):
|
if streamurl.get('audio'):
|
||||||
return {
|
formats.append({
|
||||||
'id': video_id,
|
|
||||||
'title': title,
|
|
||||||
'url': streamurl.get('audio'),
|
'url': streamurl.get('audio'),
|
||||||
}
|
'format_id': format_id,
|
||||||
|
'vcodec': 'none',
|
||||||
|
})
|
||||||
|
|
||||||
self._sort_formats(formats)
|
self._sort_formats(formats)
|
||||||
return {
|
return {
|
||||||
'id': video_id,
|
'id': format_id,
|
||||||
'title': title,
|
'title': title,
|
||||||
'formats': formats,
|
'formats': formats,
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user