diff options
author | garret <garret@airmail.cc> | 2024-08-05 09:23:06 +0100 |
---|---|---|
committer | garret <garret@airmail.cc> | 2024-08-05 09:48:30 +0100 |
commit | e8c42021467cb23eade6982a97bf161415b5a4ec (patch) | |
tree | facc0837bd947f8557cb3657130eebb74ee80629 /yt_dlp_plugins | |
parent | 3aaab0cec71534c1c2099a5289942acdddba7eaa (diff) | |
download | yt-dlp-rajiko-e8c42021467cb23eade6982a97bf161415b5a4ec.tar.gz yt-dlp-rajiko-e8c42021467cb23eade6982a97bf161415b5a4ec.tar.bz2 yt-dlp-rajiko-e8c42021467cb23eade6982a97bf161415b5a4ec.zip |
add extractor arg to filter for "key station only"
Programmes that air on a network of stations have an originating station-
a "key" station. e.g. for all night nippon the key station is ニッポン放送 (LFR)
radiko's new APIs include a key_station field.
I'd only seen such a field in the mobile-web site until now, so I
haven't been able do anything with it. But now the PC website's gotten
this "persons" API, so I can.
this arg is currently only useful for the new "persons" urls,
but i suspect it might become more useful as time goes on...
example usage:
you give the url for the host of a networked show,
the default will download from every station (probably not what you want)
but if you specify key-station-only, then you get just one download from
the originating station
i may add a "preference" argument at some point, for if you want it from
a specific non-key station, but not right now
Diffstat (limited to 'yt_dlp_plugins')
-rw-r--r-- | yt_dlp_plugins/extractor/radiko.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/yt_dlp_plugins/extractor/radiko.py b/yt_dlp_plugins/extractor/radiko.py index a9f53f5..85a17c8 100644 --- a/yt_dlp_plugins/extractor/radiko.py +++ b/yt_dlp_plugins/extractor/radiko.py @@ -705,6 +705,9 @@ class RadikoPersonIE(InfoExtractor): def entries(): for episode in person_api.get("data"): + if len(self._configuration_arg("key_station_only", ie_key="rajiko")) > 0: + if 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) |