0 purchases
radikoplaylist 1.1.0
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 informations to access to media playlist.
We can find various useages by integrating with other libraries.
Example
Following example requires additional installations:
ffmpeg
ffmpeg-python
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)
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.