mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-18 13:21:26 +01:00
Compare commits
3 Commits
e2d05bf782
...
47e6dc3e44
Author | SHA1 | Date | |
---|---|---|---|
|
47e6dc3e44 | ||
|
cf7fe0b9e2 | ||
|
c92d1cacc0 |
|
@ -7,9 +7,9 @@ from ..utils import (
|
|||
int_or_none,
|
||||
join_nonempty,
|
||||
parse_qs,
|
||||
traverse_obj,
|
||||
update_url_query,
|
||||
)
|
||||
from ..utils.traversal import traverse_obj
|
||||
|
||||
|
||||
class RedCDNLivxIE(InfoExtractor):
|
||||
|
|
|
@ -1,22 +1,23 @@
|
|||
import datetime
|
||||
|
||||
from .common import InfoExtractor
|
||||
from .redge import RedCDNLivxIE
|
||||
from ..utils import (
|
||||
clean_html,
|
||||
join_nonempty,
|
||||
js_to_json,
|
||||
strip_or_none,
|
||||
traverse_obj,
|
||||
update_url_query,
|
||||
)
|
||||
|
||||
import datetime
|
||||
from ..utils.traversal import traverse_obj
|
||||
|
||||
|
||||
def is_dst(date):
|
||||
year = date.year
|
||||
# last sunday of march and october, respectively. might break on switch days.
|
||||
dst_start = datetime.datetime(year, 3, 31, 2) - datetime.timedelta(days=(datetime.datetime(year, 3, 31).weekday() + 1) % 7)
|
||||
dst_end = datetime.datetime(year, 10, 31, 3) - datetime.timedelta(days=(datetime.datetime(year, 10, 31).weekday() + 1) % 7)
|
||||
return dst_start <= date <= dst_end
|
||||
last_march = datetime.datetime(date.year, 3, 31)
|
||||
last_october = datetime.datetime(date.year, 10, 31)
|
||||
last_sunday_march = last_march - datetime.timedelta(days=last_march.isoweekday() % 7)
|
||||
last_sunday_october = last_october - datetime.timedelta(days=last_october.isoweekday() % 7)
|
||||
return last_sunday_march.replace(hour=2) <= date <= last_sunday_october.replace(hour=3)
|
||||
|
||||
|
||||
def rfc3339_to_atende(date):
|
||||
|
@ -139,7 +140,7 @@ class SejmIE(InfoExtractor):
|
|||
video_id)
|
||||
params = data['params']
|
||||
|
||||
title = data['title'].strip()
|
||||
title = strip_or_none(data.get('title'))
|
||||
|
||||
if data.get('status') == 'VIDEO_ENDED':
|
||||
live_status = 'was_live'
|
||||
|
@ -186,7 +187,7 @@ class SejmIE(InfoExtractor):
|
|||
'_type': 'url_transparent',
|
||||
'ie_key': RedCDNLivxIE.ie_key(),
|
||||
'id': stream_id,
|
||||
'title': f'{title} - {stream_id}',
|
||||
'title': join_nonempty(title, stream_id, delim=' - '),
|
||||
})
|
||||
|
||||
cameras = self._search_json(
|
||||
|
|
Loading…
Reference in New Issue
Block a user