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.3.0.tar.gz (20.7 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.3.0-py3-none-any.whl (12.6 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for radikoplaylist-1.3.0.tar.gz
Algorithm Hash digest
SHA256 3f95560b7d49975b1a07502f59de4e6d1fc67f89b49c0de2db8778ce1cdce73d
MD5 1118c6f8bc576d510e28fc7423b82989
BLAKE2b-256 3b9a2154c9e6b9734c60815f05bd3576f959f8735f79d19c6a52744a600f2237

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for radikoplaylist-1.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 71a330aa983bff4f8f966c14b14ff9b14a5ca0a46d798e344377592bdd63ad92
MD5 3139587fe00b66529e05d1209d39f0b9
BLAKE2b-256 e5a6006ed4f97f53b3ad3121107e4da7f767497d247666a8dd2c99058f4ddfe2

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