yt-dlp-rajiko

improved radiko.jp extractor for yt-dlp

what is it

日本語訳もあります。

yt-dlp-rajiko is an improved radiko.jp extractor plugin for yt-dlp. It lets you download any timefree programme or record any live station, from radiko.jp, the central platform for Japanese commercial radio. It bypasses radiko's geoblock, meaning it works even from outside Japan.

I should note that, yes, this lets you listen to stuff from outside your area without radiko premium. But I would encourage you to subscribe to radiko premium if you are able, to support radiko so that it can continue existing.

how do i install it

Download the Python wheel or pip install --extra-index-url https://427738.xyz/yt-dlp-rajiko/pip/ yt-dlp-rajiko

Requires yt-dlp 2025.02.19 or above.

Use the pip command if you installed yt-dlp with pip. If you installed yt-dlp with pipx, use pipx inject --index-url https://427738.xyz/yt-dlp-rajiko/pip/ yt-dlp yt-dlp-rajiko to install the plugin in yt-dlp's environment.

Otherwise, download the wheel, and place it in one of these locations:

You'll have to create those folders if they don't already exist.


Here are the SHA256 checksums for the latest release:

8d8df258a9e9404cc9dde73330183db895905c18bf202875d5da5adf2876965a  yt_dlp_rajiko-1.5-py3-none-any.whl
5b3fdb642d84ad58f8925f833bf3d881c37256ab0be7f77a6305c7e32850b103  yt_dlp_rajiko-1.5.tar.gz

If you're using pip/pipx, these should be verified automatically when you install.

Previous releases
094a5479eac3429b6880c5f7f00f78cdce8299c71a77ac248c0e709dcb770b63  yt_dlp_rajiko-1.4-py3-none-any.whl
237cf5d8612c78c50f4e9c716407753d75b3575a0f50c04db2512f85ce27f796 yt_dlp_rajiko-1.4.tar.gz
25776934bca2046e9c8e1f9cdad73dfa9801c7798d0e6748f974f315f5aad11f yt_dlp_rajiko-1.3-py3-none-any.whl
69692f1cede445ad13784c9c7fae09812ccdbc4e49d2e06d51cbc76978339f0b yt_dlp_rajiko-1.3.tar.gz
4ee278fd138ebc305deeedc7e2a183afe91903607f28c513731d9e3888c3df11 yt_dlp_rajiko-1.2-py3-none-any.whl
f415c9bfade5f60d3e9a7343f526808589c76ab9917c7cc9911260566ded25d0 yt_dlp_rajiko-1.2.tar.gz
d3fdefb4c5c1d5d64c58b3f805bf64ae95f3dd9f496742d214e16e33e677c600 yt_dlp_rajiko-1.1-py3-none-any.whl
29463780d0dcc3be4448eea87f72884c1878e1ea01ccfb823293a42ca6a694b9 yt_dlp_rajiko-1.1.tar.gz
70b95f25a62b465f1fb26f0e6faef45236d55a0c12665ef4f754cd39832118cf yt_dlp_rajiko-1.0-py3-none-any.whl 993e16a3423a43dbeaee59c6eb37086f4e801dcfe03042aa5c5c01b0085fdc4d yt-dlp-rajiko-1.0.tar.gz

source code + release notes

The source code is available via github, or the source tarball that the build generates.

If you'd like to be notified of new releases, you can subscribe by RSS: https://427738.xyz/yt-dlp-rajiko/CHANGELOG.xml
You can read that feed in your browser as well.

If you'd prefer to be notified by email, you can use an RSS to email service. I've tested Feedrabbit and found it to work, but other options are available. Alternatively, shoot me a message with your email address and I'll work something out.

how do i use it

simply:
# timefree download
yt-dlp 'https://radiko.jp/#!/ts/INT/20240308230000'
# live recording
yt-dlp 'https://radiko.jp/#!/live/CCL'
# live shorthand
yt-dlp 'https://radiko.jp/#FMT'

You can semi-automatically grab the latest episodes of programmes by using the search page, like this:
# single-station programme yt-dlp
'https://radiko.jp/#!/search/live?key=World Jazz Warehouse&filter=past'
# area filtering also works
yt-dlp 'https://radiko.jp/#!/search/live?key=tokyo speakeasy&filter=past&area_id=JP13'

(though of course you still need to be there to press the button)

If you can reliably get it in the search, you can somewhat-automate downloading it. If there's a programme that airs on multiple stations, the best way to filter down to the station you want is to use the search's 地域 (region) filter.

You can also get programmes that a person has appeared in, using the links from those little boxes on the side:
yt-dlp 'https://radiko.jp/persons/3363'

you can limit it to the "key station" only, like so:
yt-dlp 'https://radiko.jp/persons/33635' --extractor-args rajiko:key-station-only.

This is meant as an alternative to the region filter, for networked programmes where the same thing airs on multiple stations. Currently this is the only place where that option works, as the information just isn't available for normal search results.


As a general rule, just copying from the browser URL bar should work with no changes. (if it doesn't, let me know!)

Apparently on Windows it won't work unless you use "double quotes", but on Linux it won't work unless you use 'single quotes'. I've tried to put some code in here to change it to "double quotes" if you're on windows, but idk if it actually works. If the command doesnt work with one quote type then try the other.

recommended settings

yt-dlp's default settings aren't ideal for yt-dlp-rajiko. These are the settings I use to make it better.

TL;DR: -N 30 --embed-metadata --embed-thumbnail -o "%(title)s %(timestamp+32400>%Y-%m-%d_%H%M)s [%(id)s].%(ext)s" (put that in an alias)
+ --download-archive "archive" --break-on-existing --break-per-input if using the search page

Metadata

yt-dlp's default settings don't expose any metadata except the title.

Add the argument --embed-metadata to your command. This will embed the show name, description, station name and airdate into the file, as tags that should be picked up by a decent media player. It also embeds the tracklist of songs played, as timestamped chapters.

You can also add --embed-thumbnail to add the show image as cover art, which your media player can display.

I use an output template to add the airdate into the filename as well:
-o "%(title)s %(timestamp+32400>%Y-%m-%d_%H%M)s [%(id)s].%(ext)s" -> World Jazz Warehouse 2024-05-19_2300 [CCL-20240519230000].m4a
+32400 is the JST time offset (+9h) in seconds, since yt-dlp's timestamps are all in UTC.

Sample mediainfo output

Efficiency

You can use -N (multi-threaded download) to increase download speed. I use about 10. Normally you should use a smaller amount, but radiko (and NHK) seem to need more. I think it's because the audio fragments are such small filesize, the speed can only ramp up so much before it finishes. But if you put a good amount of threads you can take advantage of your full connection.

If you're using search queries, you should:

That way you can avoid scraping any more than necessary. (faster for you, less load on radiko, everyone wins)

This section used to recommend --playlist-reverse for search, as the search results were returned oldest-first. This is no longer the case- the API has started returning results newest-first (October 2024).

putting it all together

It would be a pain to type/paste all those arguments onto the command every time. You can make an alias in your yt-dlp config, so you can just type one short thing and get all of the settings.

Make a config file in one of the supported locations, and add --alias rdk 'PASTE THE ARGUMENTS HERE' to it. Then when you want to download from radiko, do yt-dlp 'url' --rdk and it'll all "just work™". Unfortunately site-specific config isn't possible (yet?), so you will have to remember to add that --rdk every time.

If you're going to be using the search pages regularly, you should put your command into a shell/batch/etc script. That way you can just run it after the programme(s) you're interested in have aired, with no extra faff.

Extractor arguments

You can configure yt-dlp-rajiko with extractor arguments. Mostly these are just for development purposes, or disabling workarounds if you have some special setup.

You can set the flags like this:
--extractor-args rajiko:key-station-only
or, when it's an argument that needs an input, like this:
--extractor-args rajiko:device=pc_html5

Setting multiple at a time is a bit more complicated. The full syntax is described in the yt-dlp documentation.

how do i get help

Open an issue on github or send a message via the form.
You can also ping me in the yt-dlp discord server, username garret1317.

Please try to include a verbose log if you're reporting a problem, it helps with diagnosing the issue.

misc notes/writings

You can find various notes/jottings on a dedicated page. These were formerly hosted on the github wiki.

acknowledgements

The mobile spoofing code is almost entirely copied from the rajiko browser extension by jackyzy823, released under the Unlicense. You can read his write-up (in Chinese) here.

The authentication code, and some parts of the metadata extraction, have been adapted from yt-dlp's radiko extractor, which was primarily authored by Lesmiscore (also released under the Unlicense).