Accesses to radiko API, gets media playlist URL and built header for HTTP request to its URL.
Project description
radiko playlist
Accesses to radiko API, gets media playlist URL and built header for HTTP request to its URL.
Features
This is light weight library for interacting with radiko API to get information to access to media playlist. We can find various usages by integrating with other libraries.
Example
Following example requires additional installations:
Record Live
import time
import ffmpeg
from radikoplaylist import MasterPlaylistClient, LiveMasterPlaylistRequest
master_playlist_request = LiveMasterPlaylistRequest("FMT")
master_playlist = MasterPlaylistClient.get(master_playlist_request, area_id="JP13")
stream = ffmpeg.input(
master_playlist.media_playlist_url,
headers=master_playlist.headers,
copytb='1'
)
stream = ffmpeg.output(stream, "./record.m4a", f='mp4', c='copy')
# @see https://github.com/kkroening/ffmpeg-python/issues/162#issuecomment-571820244
popen = stream.run_async(pipe_stdin=True)
recording_minute = 30
time.sleep(recording_minute * 60)
popen.communicate(str.encode("q"))
time.sleep(3)
popen.terminate()
Record Time Free
import ffmpeg
from radikoplaylist import MasterPlaylistClient, TimeFreeMasterPlaylistRequest
master_playlist_request = TimeFreeMasterPlaylistRequest(
"NACK5", 20200529210000, 20200529230000
)
master_playlist = MasterPlaylistClient.get(master_playlist_request, area_id="JP13")
stream = ffmpeg.input(
master_playlist.media_playlist_url,
headers=master_playlist.headers,
copytb='1'
)
stream = ffmpeg.output(stream, "./record.m4a", f='mp4', c='copy')
ffmpeg.run(stream)
Project details
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 radikoplaylist-1.1.1.tar.gz.
File metadata
- Download URL: radikoplaylist-1.1.1.tar.gz
- Upload date:
- Size: 19.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eeb33d326fa607da3d2c22bc5aaa3df827eff97a18760363880c0dd324a7c539
|
|
| MD5 |
4d16cd1fe23e195398d6799fb9567227
|
|
| BLAKE2b-256 |
d86e55a02d14737a942182893d25aed076b064368799e9040c9821e67e1899a7
|
File details
Details for the file radikoplaylist-1.1.1-py3-none-any.whl.
File metadata
- Download URL: radikoplaylist-1.1.1-py3-none-any.whl
- Upload date:
- Size: 11.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a7b121797a1d2bb09821d2ef03aeee3e4cf4f89d69d7b53aac75e5cb2ccf5a8a
|
|
| MD5 |
fb4a7133c3983472616c126b5089ff67
|
|
| BLAKE2b-256 |
eb6e79d4fd43f85f4296392a53feb1bf5adc8bdd63a11734b80912669972f57f
|