aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/yt_dlp_plugins
diff options
context:
space:
mode:
authorgarret <garret@airmail.cc>2023-05-22 21:08:59 +0100
committergarret <garret@airmail.cc>2023-05-22 21:08:59 +0100
commitc2eac05e4e512c8d4d139e17a122c1fa10827885 (patch)
tree3e90cd9c1e649cd7f0660e08064b521f6f18fb72 /yt_dlp_plugins
parentec1e15f8c2f70634379165785d051ecfc3e75eeb (diff)
downloadyt-dlp-rajiko-c2eac05e4e512c8d4d139e17a122c1fa10827885.tar.gz
yt-dlp-rajiko-c2eac05e4e512c8d4d139e17a122c1fa10827885.tar.bz2
yt-dlp-rajiko-c2eac05e4e512c8d4d139e17a122c1fa10827885.zip
check if url time is between start/end of programme
urls in the middle of the programme are valid and do occur in the wild
Diffstat (limited to 'yt_dlp_plugins')
-rwxr-xr-xyt_dlp_plugins/extractor/radiko.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/yt_dlp_plugins/extractor/radiko.py b/yt_dlp_plugins/extractor/radiko.py
index f28a4e6..21f2b2f 100755
--- a/yt_dlp_plugins/extractor/radiko.py
+++ b/yt_dlp_plugins/extractor/radiko.py
@@ -738,15 +738,16 @@ class RadikoTimeFreeIE(_RadikoBaseIE):
'programs', 'program'), get_all=False)
for prog in programmes:
- if prog['ft'] == start_time:
+ if prog['ft'] <= start_time < prog['to']:
+ actual_start = prog['ft']
if len(prog.get('person')) > 0:
cast = [person.get("name") for person in prog.get('person')]
else:
cast = [prog.get('performer')]
return {
- 'id': join_nonempty(station_id, start_time),
- 'timestamp': unified_timestamp(f'{start_time}+0900'), # hack to account for timezone
+ 'id': join_nonempty(station_id, actual_start),
+ 'timestamp': unified_timestamp(f'{actual_start}+0900'), # hack to account for timezone
'release_timestamp': unified_timestamp(f'{prog["to"]}+0900'),
'cast': cast,
'description': clean_html(join_nonempty('summary', 'description', from_dict=prog, delim='\n')),