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 .common import InfoExtractor
from ..networking import HEADRequest
from ..utils import ( from ..utils import (
float_or_none, float_or_none,
int_or_none, int_or_none,
@ -100,8 +101,12 @@ class RedCDNLivxIE(InfoExtractor):
ism_doc, ism_urlh = ism_res ism_doc, ism_urlh = ism_res
formats, _ = self._parse_ism_formats_and_subtitles(ism_doc, ism_urlh.url, 'ss') formats, _ = self._parse_ism_formats_and_subtitles(ism_doc, ism_urlh.url, 'ss')
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({ formats.append({
'url': livx_mode('nvr'), 'url': nvr_urlh.url,
'ext': 'flv', 'ext': 'flv',
'format_id': 'direct-0', 'format_id': 'direct-0',
'preference': -1, # might be slow 'preference': -1, # might be slow

View File

@ -168,9 +168,9 @@ class SejmIE(InfoExtractor):
return return
file = f'https:{file}' if file.startswith('//') else file file = f'https:{file}' if file.startswith('//') else file
if not legacy_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: 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') stream_id = self._search_regex(r'/o2/sejm/([^/]+)/[^./]+\.livx', file, 'stream id')
common_info = { common_info = {
'url': file, 'url': file,