Skip to main content

Accesses to radiko API, gets media playlist URL and built header for HTTP request to its URL.

Project description

radiko playlist

Test CodeQL Code Coverage Maintainability Dependabot Python versions X URL

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 (7-Day)

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)

Record Time Free (30-Day)

For accessing programs within the past 30 days, you need a radiko premium account. First, log in to radiko.jp in your browser, then get the radiko_session cookie value from your browser's developer tools.

import ffmpeg

from radikoplaylist import MasterPlaylistClient, TimeFree30DayMasterPlaylistRequest

master_playlist_request = TimeFree30DayMasterPlaylistRequest(
    "802", 20251214220000, 20251214223000
)
master_playlist = MasterPlaylistClient.get(
    master_playlist_request,
    area_id="JP13",
    radiko_session="your_radiko_session_value_from_cookie_here"
)

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

radikoplaylist-1.2.0.tar.gz (20.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

radikoplaylist-1.2.0-py3-none-any.whl (12.2 kB view details)

Uploaded Python 3

File details

Details for the file radikoplaylist-1.2.0.tar.gz.

File metadata

  • Download URL: radikoplaylist-1.2.0.tar.gz
  • Upload date:
  • Size: 20.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for radikoplaylist-1.2.0.tar.gz
Algorithm Hash digest
SHA256 54f46e7ae31803f062ee91eeb55532a76734a65bedac9301b3621eb51f73fa21
MD5 d432dfc8f5cffce2d04b3c76b75d5cae
BLAKE2b-256 b6cd98edea736c3c10c869c7f15361fb16e652e9585cd98d7474b0795aded705

See more details on using hashes here.

File details

Details for the file radikoplaylist-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: radikoplaylist-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 12.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for radikoplaylist-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e4be0d32746da4c13433235b9061781098f29785ccc1d5e501e69976d5180ea8
MD5 0b46b4602855e3e41d93ce3fa480863c
BLAKE2b-256 1d56674448730be51efe0c729cc0a9f6a6687404c95f37cace4f32c31cd6e1fd

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page