Compare commits

..

2 Commits

Author SHA1 Message Date
lauren n. liberda
74e5aa6902
[extractor/redge] try to follow redir on nvr, ignore nvr format if invalid 2024-01-08 11:38:05 +01:00
lauren n. liberda
89199aedbe
[extractor/sejm] fix 2024-01-08 11:22:21 +01:00
2 changed files with 13 additions and 8 deletions

View File

@ -1,4 +1,5 @@
from .common import InfoExtractor
from ..networking import HEADRequest
from ..utils import (
float_or_none,
int_or_none,
@ -100,12 +101,16 @@ class RedCDNLivxIE(InfoExtractor):
ism_doc, ism_urlh = ism_res
formats, _ = self._parse_ism_formats_and_subtitles(ism_doc, ism_urlh.url, 'ss')
formats.append({
'url': livx_mode('nvr'),
'ext': 'flv',
'format_id': 'direct-0',
'preference': -1, # might be slow
})
nvr_urlh = self._request_webpage(
HEADRequest(livx_mode('nvr')), video_id, 'Follow flv file redirect', fatal=False,
expected_status=lambda _: True)
if nvr_urlh and nvr_urlh.getcode() == 200:
formats.append({
'url': nvr_urlh.url,
'ext': 'flv',
'format_id': 'direct-0',
'preference': -1, # might be slow
})
formats.extend(self._extract_mpd_formats(livx_mode('livedash'), video_id, mpd_id='dash', fatal=False))
formats.extend(self._extract_m3u8_formats(
livx_mode('livehls'), video_id, m3u8_id='hls', ext='mp4', fatal=False))

View File

@ -168,9 +168,9 @@ class SejmIE(InfoExtractor):
return
file = f'https:{file}' if file.startswith('//') else file
if not legacy_file:
update_url_query(file, {'startTime': start_time})
file = update_url_query(file, {'startTime': start_time})
if stop_time is not None:
update_url_query(file, {'stopTime': stop_time})
file = update_url_query(file, {'stopTime': stop_time})
stream_id = self._search_regex(r'/o2/sejm/([^/]+)/[^./]+\.livx', file, 'stream id')
common_info = {
'url': file,