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.1.tar.gz (22.2 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.1-py3-none-any.whl (13.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: radikoplaylist-1.3.1.tar.gz
  • Upload date:
  • Size: 22.2 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.1.tar.gz
Algorithm Hash digest
SHA256 59fefb15e09494025be3b4803585bd89874328dae96a38822d4afb7f50c3affc
MD5 fbcc023b8850669d949ba37b7ef12237
BLAKE2b-256 1b9468c97d6feb51e5e05503f73de90c0406d6514dc95662eac4cb7d3f7ed189

See more details on using hashes here.

File details

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

File metadata

  • Download URL: radikoplaylist-1.3.1-py3-none-any.whl
  • Upload date:
  • Size: 13.2 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6789f3b5f748a7ea0ed81f74bc508c81fd208d52cec5eef69792fc21ef463d64
MD5 347daec993fd416a3f625f0bbfd9e609
BLAKE2b-256 475ce60c92755e7975d2cb7021c8ce45a6ccb490ab8265a3140f50cdcf036f2c

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