yt-dlp-rajiko

yt-dlp用radiko.jpエクストラクターの改良版

現在、この日本語訳はまだ未完です。ご了承ください。
下手な日本語で申し訳ありません

yt-dlp-rajikoとは?

English

yt-dlp-rajikoは配信ダウンローダー「yt-dlp」エクストラクター プラグイン です。好きなラジオ番組をアーカイブ。タイムフリーも生配信もエリアフリーもできます。(海外も!)
あなたの放送エリア以外のコンテンツを無料で聞けます。しかし、できれば、radikoプレミアムを登録してください。radikoの存 在に感謝します、そしてこれからも存在したいとおもいます。

インストール方法

Python wheelをダウンロード または pip install yt-dlp-rajiko

yt-dlp 2023.06.22以上が必要です。

yt-dlpをpipでインストールした場合は、pipコマンドを実行してください。 pipxでインストールした場合はpipx inject yt-dlp yt-dlp-rajiko でyt-dlpの環境にプラグインをインストールしてください。

Python wheelの場合は、以下のいずれの保存先にダウンロードしてください

最新リリースのSHA256チェックサムはこちら:

0e2c24f0acdc9932b215f78347795494c161adf372225c1ff3363a974b46f52c  yt_dlp_rajiko-1.7.tar.gz
35a6d9371ac60ca526ebae519568b50a73c930acdb3fa6ad994b32d3c5d7c04a  yt_dlp_rajiko-1.7-py3-none-any.whl

pipが自動検証

過去のリリース ec192573235a32e3b84e990d10387cde5259db956db05e1e6304ab41c299e48b  yt_dlp_rajiko-1.6.tar.gz
1664969505785b76fb6b7c85a5b8f498039576d6abcdf136f3e007edcda3fcdd  yt_dlp_rajiko-1.6-py3-none-any.whl
5b3fdb642d84ad58f8925f833bf3d881c37256ab0be7f77a6305c7e32850b103  yt_dlp_rajiko-1.5.tar.gz
8d8df258a9e9404cc9dde73330183db895905c18bf202875d5da5adf2876965a  yt_dlp_rajiko-1.5-py3-none-any.whl
237cf5d8612c78c50f4e9c716407753d75b3575a0f50c04db2512f85ce27f796  yt_dlp_rajiko-1.4.tar.gz
094a5479eac3429b6880c5f7f00f78cdce8299c71a77ac248c0e709dcb770b63  yt_dlp_rajiko-1.4-py3-none-any.whl
69692f1cede445ad13784c9c7fae09812ccdbc4e49d2e06d51cbc76978339f0b  yt_dlp_rajiko-1.3.tar.gz
25776934bca2046e9c8e1f9cdad73dfa9801c7798d0e6748f974f315f5aad11f  yt_dlp_rajiko-1.3-py3-none-any.whl
f415c9bfade5f60d3e9a7343f526808589c76ab9917c7cc9911260566ded25d0  yt_dlp_rajiko-1.2.tar.gz
4ee278fd138ebc305deeedc7e2a183afe91903607f28c513731d9e3888c3df11  yt_dlp_rajiko-1.2-py3-none-any.whl
29463780d0dcc3be4448eea87f72884c1878e1ea01ccfb823293a42ca6a694b9  yt_dlp_rajiko-1.1.tar.gz
d3fdefb4c5c1d5d64c58b3f805bf64ae95f3dd9f496742d214e16e33e677c600  yt_dlp_rajiko-1.1-py3-none-any.whl
70b95f25a62b465f1fb26f0e6faef45236d55a0c12665ef4f754cd39832118cf  yt_dlp_rajiko-1.0-py3-none-any.whl
993e16a3423a43dbeaee59c6eb37086f4e801dcfe03042aa5c5c01b0085fdc4d  yt-dlp-rajiko-1.0.tar.gz

ソースコードはこのサイトgithubtarballで ご覧いただけます。

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

If you'd prefer to be notified by email, you can use one of the many RSS to email services. 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.

ご利用方法

こんな風にご利用する

# タイムフリーダウンロードの場合
yt-dlp 'https://radiko.jp/#!/ts/INT/20240308230000'
# 生録音の場合
yt-dlp 'https://radiko.jp/#!/live/CCL'
# 生録音の速記
yt-dlp 'https://radiko.jp/#FMT'

検索ページで使えると、ダウンロードが少し自動になります。

# 角松敏生に関連する各番組
yt-dlp 'https://radiko.jp/#!/search/live?key=角松敏生&filter=past&region_id=all'
# 大阪より特定番組
yt-dlp 'https://radiko.jp/#!/search/live?key=world%20jazz%20warehouse&filter=past&area_id=JP27'

基本的にブラウザからコピーされたURLは大丈夫です。

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.

推奨設定

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" --playlist-reverse --break-on-existing --break-per-input if using the search page

メタデータ

radiko offers a lot of metadata about its shows, a fair amount of which yt-dlp-rajiko extracts. But yt-dlp's default settings don't expose anything 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), since yt-dlp's timestamps are all UTC.

Sample mediainfo output

Efficiency

-N (並列ダウンロード機能)を利用すると、ダウンロードがかなり速くなります。

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

毎回そんな全部のアーギュメントを追加するはめんどくさい。そこで、yt-dlpのコンフィグにエイリアスを作る。一引数だけを追加で も、 全部がでてきます。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.

お問い合わせ

Github で報告してください。
故障を報告する場合は、ぜひverbose logを含めてください (コマンドの終わりに-vを追加しま す)。大変助かります。

雑記

専用ページで。以前はGithub Wikiでホストされました。
英語のみ

謝辞

The mobile spoofing code is based heavily on the rajiko browser extension by jackyzy823, released under the Unlicense. In particular, the fake phone details and GPS coordinate generation code have been copied almost verbatim. You can read their 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).