Compare commits

..

3 Commits

Author SHA1 Message Date
bashonly
47e6dc3e44
why does github make suggesting newlines so difficult 2024-01-20 23:57:37 +00:00
bashonly
cf7fe0b9e2
Apply suggestions from code review 2024-01-20 23:55:52 +00:00
bashonly
c92d1cacc0
cleanup 2024-01-20 23:55:25 +00:00
2 changed files with 12 additions and 11 deletions

View File

@ -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):

View File

@ -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(