aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/yt_dlp_plugins/extractor
diff options
context:
space:
mode:
authorgarret <garret@airmail.cc>2023-06-13 02:15:38 +0100
committergarret <garret@airmail.cc>2023-06-13 02:16:23 +0100
commitc1bccb5ef6b89f99aeeae25010a17d70a4b28afa (patch)
tree62fd9ac00a9eae82ccbb4c038856725046d21ba7 /yt_dlp_plugins/extractor
parentdc902d03795a67f8ff63f38db86b27c4698849a6 (diff)
downloadyt-dlp-rajiko-c1bccb5ef6b89f99aeeae25010a17d70a4b28afa.tar.gz
yt-dlp-rajiko-c1bccb5ef6b89f99aeeae25010a17d70a4b28afa.tar.bz2
yt-dlp-rajiko-c1bccb5ef6b89f99aeeae25010a17d70a4b28afa.zip
handle 29-hour time in ShareIE
Diffstat (limited to 'yt_dlp_plugins/extractor')
-rwxr-xr-xyt_dlp_plugins/extractor/radiko.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/yt_dlp_plugins/extractor/radiko.py b/yt_dlp_plugins/extractor/radiko.py
index cb7a870..4e7d0e2 100755
--- a/yt_dlp_plugins/extractor/radiko.py
+++ b/yt_dlp_plugins/extractor/radiko.py
@@ -846,4 +846,14 @@ class RadikoShareIE(_RadikoBaseIE):
station = traverse_obj(queries, ("sid", 0))
time = traverse_obj(queries, ("t", 0))
+ hour = int(time[8:10])
+ if hour <= 24: # 29-hour time is valid here, see _unfuck_day in RadikoTimeFreeIE
+ hour = hour - 24 # move back by a day
+
+ date = datetime.datetime(int(time[:4]), int(time[4:6]), int(time[6:8]),
+ hour=hour, minute=int(time[10:12]), second=int(time[12:14]))
+
+ date += datetime.timedelta(days=1) # move forward a day in datetime to compensate
+ time = date.strftime("%Y%m%d%H%M%S")
+
return self.url_result(f"https://radiko.jp/#!/ts/{station}/{time}", RadikoTimeFreeIE)