diff options
author | garret1317 <garret@airmail.cc> | 2025-08-29 20:35:13 +0100 |
---|---|---|
committer | garret1317 <garret@airmail.cc> | 2025-08-29 20:36:05 +0100 |
commit | cbb46ec14339cd938f96446440ea2bd32a2ff1ba (patch) | |
tree | 599c7c504f8b89feda8beb384be08b535a15939a | |
parent | a12ae8fe4636399ce4582c6cdb0bc67352b2caf3 (diff) | |
download | yt-dlp-rajiko-cbb46ec14339cd938f96446440ea2bd32a2ff1ba.tar.gz yt-dlp-rajiko-cbb46ec14339cd938f96446440ea2bd32a2ff1ba.tar.bz2 yt-dlp-rajiko-cbb46ec14339cd938f96446440ea2bd32a2ff1ba.zip |
PersonsIE: construct a timefree url_result directly
so that --download-archive etc will quickly skip without a full extraction
also removes reliance on `radiko_url` always being a share url
-rw-r--r-- | yt_dlp_plugins/extractor/radiko.py | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/yt_dlp_plugins/extractor/radiko.py b/yt_dlp_plugins/extractor/radiko.py index 1f5bf30..94df945 100644 --- a/yt_dlp_plugins/extractor/radiko.py +++ b/yt_dlp_plugins/extractor/radiko.py @@ -733,19 +733,16 @@ class RadikoPersonIE(InfoExtractor): def entries(): key_station_only = len(self._configuration_arg("key_station_only", ie_key="rajiko")) > 0 for episode in person_api.get("data"): - if key_station_only and episode.get("key_station_id") != episode.get("station_id"): - continue - share_url = traverse_obj(episode, ("radiko_url", ("pc", "sp", "android", "ios", "app"), - {url_or_none}), get_all=False) - # they're all identical share links at the moment (5th aug 2024) but they might not be in the future + station = episode.get("station_id") + if key_station_only and episode.get("key_station_id") != station: + continue - # predictions: - # pc will probably stay the same - # don't know what sp is, possibly "SmartPhone"?, anyway seems reasonably generic - # android is easier for me to reverse-engineer than ios (no ithing) - # i assume "app" would be some internal tell-it-to-do-something link, not a regular web link + start = episode.get("start_at") + timestring = rtime.RadikoTime.fromisoformat(start).timestring() - yield self.url_result(share_url, ie=RadikoShareIE, video_title=episode.get("title")) + timefree_id = join_nonempty(station, timestring) + timefree_url = f"https://radiko.jp/#!/ts/{station}/{timestring}" + yield self.url_result(timefree_url, ie=RadikoTimeFreeIE, video_id=timefree_id) return self.playlist_result(entries(), playlist_id=join_nonempty("person", person_id)) |