No project description provided
Project description
はじめに
このプログラムは、NHKラジオの「らじる★らじる」で公開されている番組の HLSのアドレスを取得するためのパッケージを提供します。
HLSのアドレスが入手できれば、 第48回『らじる★らじる』の聴き逃がしサービス(4)を参照に コンテンツのダウンロードが可能となります。
API
使用方法
「らじる★らじる」の英語番組のタイトル一覧の習得例
(nhk) taku@okisuke:~/study/nhk/gogaku_dl$ ipython
Python 3.12.4 | packaged by conda-forge | (main, Jun 17 2024, 10:23:07) [GCC 12.3.0]
Type 'copyright', 'credits' or 'license' for more information
IPython 8.26.0 -- An enhanced Interactive Python. Type '?' for help.
In [1]: from gogaku_dl import english
In [2]: english.get_program_titles()
Out[2]:
['小学生の基礎英語',
'中学生の基礎英語レベル1',
'中学生の基礎英語レベル2',
'中高生の基礎英語in English',
'ラジオ英会話',
'ボキャブライダー',
'エンジョイ・シンプル・イングリッシュ',
'英会話タイムトライアル',
'ニュースで学ぶ「現代英語」',
'ラジオビジネス英語']
In [3]:
「らじる★らじる」の英語番組のHLSの取得例
get_english_hls関数でHLSを取得することができます。
get_english_hlsの引数には、get_program_titlesで取得したいずれかの値を指定します。
「エンジョイ・シンンプル・イングリシュ」のHLSの取得例を示します。
(nhk) taku@okisuke:~/study/nhk/gogaku_dl$ ipython
Python 3.12.4 | packaged by conda-forge | (main, Jun 17 2024, 10:23:07) [GCC 12.3.0]
Type 'copyright', 'credits' or 'license' for more information
IPython 8.26.0 -- An enhanced Interactive Python. Type '?' for help.
In [1]: from gogaku_dl import english
In [2]: english.get_english_hls('エンジョイ・シンプル・イングリッシュ')
Out[2]:
{'title': 'エンジョイ・シンプル・イングリッシュ',
'detail_url': 'https://www.nhk.or.jp/radio-api/app/v1/web/ondemand/series?site_id=3064&corner_site_id=01',
'episodes': [{'エンジョイ・シンプル・イングリッシュ「箱根への道」': {'onair': '6月24日(月)午前9:10放送',
'hls': 'https://vod-stream.nhk.jp/radioondemand/r/3064/s/stream_3064_fee6e512960579b4ded0ba5db73d54ec/index.m3u8'}},
{'エンジョイ・シンプル・イングリッシュ「詰め放題&腕相撲」': {'onair': '6月25日(火)午前9:10放送',
'hls': 'https://vod-stream.nhk.jp/radioondemand/r/3064/s/stream_3064_31d8db87f7b54acbd4cc746ef76f4297/index.m3u8'}},
{'エンジョイ・シンプル・イングリッシュ「通信カラオケ」': {'onair': '6月26日(水)午前9:10放送',
'hls': 'https://vod-stream.nhk.jp/radioondemand/r/3064/s/stream_3064_19af8a39defb5ea74ca89f2a6c4728e7/index.m3u8'}},
{'エンジョイ・シンプル・イングリッシュ「かにと母親」': {'onair': '6月27日(木)午前9:10放送',
'hls': 'https://vod-stream.nhk.jp/radioondemand/r/3064/s/stream_3064_1889cf1c4ab7913625f8eb972d9f41bf/index.m3u8'}},
{'エンジョイ・シンプル・イングリッシュ「あやしい旅行者-最終話-」': {'onair': '6月28日(金)午前9:10放送',
'hls': 'https://vod-stream.nhk.jp/radioondemand/r/3064/s/stream_3064_7231a97605445389cedfeed0c5aa3d2d/index.m3u8'}}],
'fiscal_year': 2024}
In [3]:
APIを使用した実装例
「エンジョイン・シンプル・イングリシュ」をmp3にダウンロードする実装例
をexamples/rec_enjoy_simple_english.pyとして格納しました。
実行例を以下に示します。
https://github.com/takushi1969/gogaku_dl/assets/3589129/bf56750c-3b2b-47b7-a925-a9e1f15bce87
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file gogaku_dl-0.1.1.tar.gz.
File metadata
- Download URL: gogaku_dl-0.1.1.tar.gz
- Upload date:
- Size: 4.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
241d11bc895253086361e4256d6195feb5b6d3c278a9e49aaa19b0b53ed9d2e1
|
|
| MD5 |
cdfc96a94ae3079ae110103fc69bc327
|
|
| BLAKE2b-256 |
a17f4b4bbe7ab0f7948ae698e55d3146451699f8329ef7d8b6d58efd39ee7004
|
File details
Details for the file gogaku_dl-0.1.1-py3-none-any.whl.
File metadata
- Download URL: gogaku_dl-0.1.1-py3-none-any.whl
- Upload date:
- Size: 5.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ce929aaf4284156bd54a0d941a7c36ee9bead597db6cceb16dbdfda4c108495c
|
|
| MD5 |
f6cde349f16ce30dcfe2c2b331670256
|
|
| BLAKE2b-256 |
8b58180bff8075b6bff6227a7518fae5f8945be0229b96a74359bb175a30461d
|