Giter Club home page Giter Club logo

radigo's Introduction

radigo

Record the radiko.jp program.

godoc go report CircleCI

Docker Stars Docker Build Status Docker Automated build

Please do not use this project for commercial use. Only for your personal, non-commercial use.
ๅ€‹ไบบใงใฎ่ฆ–่ดใฎ็›ฎ็š„ไปฅๅค–ใงๅˆฉ็”จใ—ใชใ„ใงใใ ใ•ใ„.

Installation

Docker images

$ docker pull yyoshiki41/radigo

You can launch a radigo container and exec radigo command.

# Mount the volume `"$PWD"/output`(default output path) into `/output` in the container
$ docker run -it \
    -v "$(pwd)"/output:/output \
    yyoshiki41/radigo rec -id=LFR -s=20180401010000
Now downloading..
/
+------------+---------------------------------+
| STATION ID |              TITLE              |
+------------+---------------------------------+
| LFR        |ใ€€ใ€€  ใ‚ชใƒผใƒ‰ใƒชใƒผใฎใ‚ชใƒผใƒซใƒŠใ‚คใƒˆใƒ‹ใƒƒใƒใƒณใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€|
+------------+---------------------------------+
| Completed!
/output/20180401010000-LFR.aac

Open the output file created by the container on your local machine.

$ open $PWD/output/20180401010000-LFR.aac

Build the binary from source

ใƒปGo 1.11 or higher

$ make installdeps
$ make build
$ radigo help

Or release binaries are available on the releases page.

Requirements

  • ffmpeg

Build docker image from source

$ make docker-build
$ docker run -it yyoshiki41/radigo help

Usage

$ radigo help
usage: radigo [--version] [--help] <command> [<args>]

Available commands are:
    area           Get available station ids
    browse         Browse radiko.jp
    browse-live    Browse radiko.jp live
    rec            Record a radiko program
    rec-live       Record a live program

โ–  area

$ radigo area
Area ID: JP13
+----------------------+----------------+
|         NAME         |   STATION ID   |
+----------------------+----------------+
| TBSใƒฉใ‚ธใ‚ช         ใ€€ใ€€ใ€€   | TBS            |
| ๆ–‡ๅŒ–ๆ”พ้€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€| QRR            |
| ใƒ‹ใƒƒใƒใƒณๆ”พ้€            | LFR            |
| ใƒฉใ‚ธใ‚ชNIKKEI็ฌฌ1        | RN1            |
| ใƒฉใ‚ธใ‚ชNIKKEI็ฌฌ2        | RN2            |
| interfm              | INT            |
| TOKYO FM             | FMT            |
| J-WAVE               | FMJ            |
| ใƒฉใ‚ธใ‚ชๆ—ฅๆœฌใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€| JORF           |
| bayfm78              | BAYFM78        |
| NACK5                | NACK5          |
| ๏ผฆ๏ผญใƒจใ‚ณใƒใƒžใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€| YFM            |
| LuckyFM ่ŒจๅŸŽๆ”พ้€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€| IBS            |
| ๆ”พ้€ๅคงๅญฆใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€| HOUSOU-DAIGAKU |
| NHKใƒฉใ‚ธใ‚ช็ฌฌ1๏ผˆๆฑไบฌ๏ผ‰ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€| JOAK           |
| NHK-FM๏ผˆๆฑไบฌ๏ผ‰ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€| JOAK-FM        |
+----------------------+----------------+

Note

Area ID is ISO 3166-2 code that is defined for 47 prefectures.

c.f. ISO 3166-2:JP - Wikipedia

โ–  rec

Record the program using the timefree.

$ radigo rec -id=LFR -s=20161126010000
Now downloading..
+------------+---------------------------------+
| STATION ID |              TITLE              |
+------------+---------------------------------+
| LFR        |ใ€€ใ€€  ใ‚ชใƒผใƒ‰ใƒชใƒผใฎใ‚ชใƒผใƒซใƒŠใ‚คใƒˆใƒ‹ใƒƒใƒใƒณใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€|
+------------+---------------------------------+
Completed!
/tmp/output/20161126010000-LFR.aac

โ–  rec-live

Record the live streaming program.

$ radigo rec-live -id=LFR -t=3600
Now downloading..
+------------+---------------+
| STATION ID | DURATION(SEC) |
+------------+---------------+
| LFR        |          3600 |
+------------+---------------+
Completed!
/tmp/output/20161205083547-LFR.aac

โ–  browse / browse-live

Browse radiko.jp.

$ radigo browse -id=LFR -s=20161126010000
$ radigo browse-live -id=LFR

Optional

- working dir

Default: ${PWD}/output

If you want to change the working dir, set the environment variables.

  • RADIGO_HOME

- radiko premium

If use the area free, set the environment variables.

  • RADIKO_MAIL
  • RADIKO_PASSWORD
e.g.
# export RADIKO_MAIL="[email protected]" && export RADIKO_PASSWORD="password"
$ radigo rec -a=JP13 -id=LFR -s=20161126010000

Known Issues

ERROR: Failed to concat aac files

(caused by the limitation of file descriptors maybe.)

Increase the number of file descriptors.

$ ulimit -n 16384

Resources

License

radigo is licensed under the GPLv3 license for all open source applications.

Please do not use this project for commercial use, it is not intended to be used for commercial use.

Author

Yoshiki Nakagawa

radigo's People

Contributors

garaemon avatar kangaechu avatar mattn avatar poccariswet avatar turndn avatar yyoshiki41 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

radigo's Issues

CI

ใƒ†ใ‚นใƒˆๆ›ธใ

Output log file

Add -verbose option and output a log file.

  • show cmd.Stdout in terminal?
  • collect cmd.Stderr in log file?

redigo recใŒๆœ€ๅˆใฎ5็ง’ใปใฉใ—ใ‹ไฟๅญ˜ใ•ใ‚Œใชใ„

ใฏใ˜ใ‚ใพใ—ใฆใ€‚

ใ“ใกใ‚‰ใฎๆ‰‹้•ใ„ใ‚„ๅ‹˜้•ใ„ใงใ—ใŸใ‚‰็”ณใ—่จณใชใ„ใฎใงใ™ใŒใ€
recใ‚ชใƒ—ใ‚ทใƒงใƒณใ‚’ๅฎŸ่กŒใ—ใŸ้š›ใซๆœ€ๅˆใฎ5็ง’ใปใฉใ—ใ‹ไฟๅญ˜ใ•ใ‚Œใพใ›ใ‚“ใ€‚

ไพ‹ใจใ—ใฆใ€ไปฅไธ‹ใฎ็•ช็ต„ใ‚’ใƒ€ใ‚ฆใƒณใƒญใƒผใƒ‰ใ—ใ‚ˆใ†ใจใ—ใŸ้š›ใฎๅฎŸ่กŒ็ตๆžœใ‚’ๆทปไป˜ใ—ใพใ™ใ€‚

2017/11/10/้‡‘ 11:30-13:00 | ้ซ˜็”ฐๆ–‡ๅคซใฎใƒฉใ‚ธใ‚ชใƒ“ใƒใƒชใƒผๆ˜ผใ‚บ | ใƒ‹ใƒƒใƒใƒณๆ”พ้€ | radiko.jp
radigo rec -id=LFR -s=20171110113000

screen shot 2017-11-10 at 12 38 26

recใ‚ตใƒ–ใ‚ณใƒžใƒณใƒ‰ใง้Œฒ้Ÿณๆ™‚ใ€ERROR: Failed to concat aac files: exit status 1ใง็•ฐๅธธ็ต‚ไบ†

ๅ•้กŒใฎๅ†…ๅฎน

Radiko ใ‚ฟใ‚คใƒ ใƒ•ใƒชใƒผใงใฎ้Œฒ้Ÿณๆ™‚๏ผˆrecใ‚ณใƒžใƒณใƒ‰๏ผ‰ใซERROR: Failed to concat aac files: exit status 1ใง็•ฐๅธธ็ต‚ไบ†ใ™ใ‚‹ใ€‚

pi@pi2:~ $ bin/radigo rec -id=TBS -s=20171224010000
Now downloading.. 
- 
+------------+----------------------------------+
| STATION ID |              TITLE               |
+------------+----------------------------------+
| TBS        | JUNKใ‚ตใ‚ฟใƒ‡ใƒผใ€€ใ‚จใƒฌ็‰‡ใฎใ‚ณใƒณใƒˆๅคช้ƒŽ |
+------------+----------------------------------+
| ERROR: Failed to concat aac files: exit status 1

ๅฎŸ่กŒ็’ฐๅขƒ

  • OS: Raspbian Stretch
  • ffmpeg: 3.2.9-1~deb9u1

ๅŽŸๅ› 

ใƒ€ใ‚ฆใƒณใƒญใƒผใƒ‰ๅพŒใฎ็ตๅˆๆ™‚ใซไธ€ๅบฆใซ้–‹ใใƒ•ใ‚กใ‚คใƒซใฎๆ•ฐใŒๅคšใ™ใŽใ‚‹ใŸใ‚

ๅ›ž้ฟๆ–นๆณ•

ใƒ•ใ‚กใ‚คใƒซใƒ‡ใ‚ฃใ‚นใ‚ฏใƒชใƒ—ใ‚ฟใฎๅˆถ้™ใ‚’ๅค‰ๆ›ดใ™ใ‚‹ใ“ใจใงๅฏพๅฟœใ€‚

/etc/security/limits.confใซไปฅไธ‹ใฎ่กŒใ‚’่ฟฝๅŠ 

* soft nofile 65536
* hard nofile 65536
pi@pi2:~ $ ulimit -n
65536
pi@pi2:~ $ bin/radigo rec -id=TBS -s=20171224010000
Now downloading.. 
- 
+------------+----------------------------------+
| STATION ID |              TITLE               |
+------------+----------------------------------+
| TBS        | JUNKใ‚ตใ‚ฟใƒ‡ใƒผใ€€ใ‚จใƒฌ็‰‡ใฎใ‚ณใƒณใƒˆๅคช้ƒŽ |
+------------+----------------------------------+
/ Completed!
/tmp/radigo/output/20171224010000-TBS.aac

Can I use it in Overseas?

Hello.
I'm listening Tokyo FM in Korea, OVERSEAS!
I'm using rajiko in Android. And It is too hard to record.
Than I found this project and I wonder can I use it.

  1. Can I use it on Raspberry pi 3(Rasbian)?
  2. Can I use it normally or I'll need VPN?

Thanks.

Cannot record for more than 10 minutes in rec-live

  • ้Œฒ็”ปใŒๆญฃๅธธใซ็ต‚ไบ†ใ—ใชใ„ใ€‚
  • 10ๅˆ†ไปฅไธŠใŒ้Œฒ็”ปๅ‡บๆฅใฆใ„ใชใ„ใ€‚
  • raspberry pi ใงๅ‹•ใ‹ใ—ใŸๅ ดๅˆใซ็™บ็”Ÿใ€‚

Failed to ConcatAACFiles lately

docker pull yyoshiki41/radigo

docker run --rm -v $HOME/Music:/output yyoshiki41/radigo -id=XXX -s=YYYYMMDDHHNNSS

WARNING: The requested image's platform (linux/arm64/v8) does not match the detected host platform (linux/amd64/v2) and no specific platform was requested
exec /bin/radigo: exec format error

oh..

git clone [email protected]:yyoshiki41/radigo.git
docker build --platform amd64 -t yyoshiki41/radigo .

docker run --rm -v $HOME/Music:/output yyoshiki41/radigo -id=XXX -s=YYYYMMDDHHNNSS
Now downloading..

+------------+--------------------------------+
| STATION ID | TITLE |
+------------+--------------------------------+
| XXX |XXXXXXXXXXXXXXXXXXXXXX |
+------------+--------------------------------+
Failed to ConcatAACFiles
ERROR: Failed to concat aac files: exit status 127

What should I do? ? ?

Fix to open browse on Linux or Windows

What version of radigo are you using (radigo --version)?

> radigo --version
v0.11.0 built with go1.17.6

The Problem

  • When I run the radigo rec command or the radigo browse-live command on Ubuntu 18.04 or Windows (Version 10.0.19043.1526), I get an error and cannot open the browser. Specifically, I get the following error.
> radigo browse -id=ABC -s=20220222010000
ERROR: Failed to open browser: exit status 1
> radigo browse-live -id=ABC
ERROR: Failed to open browser: exit status 1

The Cause

  • The problem may be due to the fact that the process of opening the browser in browse.go and browse_live.go uses open to execute an external command. This implementation can only perform the browser opening operation on macOS.

The Proposal

  • If you need a fix, can I modify the program so that it works on Linux and Windows?

CAUTION: do not use ffmpeg v3.4.x

radigo does not work as expected when using ffmpeg v3.4.x.

Use ffmpeg v3.3.x.
Installation example is below.

Example

First, uninstall your local ffmpeg.
Then, install and build ffmpeg from source.

$ curl -o ./ffmpeg-3.3.5.tar.gz http://www.ffmpeg.org/releases/ffmpeg-3.3.5.tar.gz
$ tar -xzf ./ffmpeg-3.3.5.tar.gz 
$ cd ffmpeg-3.3.5
$ ./configure --disable-yasm
$ make
$ make install

Related issues

Failed to ConcatAACFiles lately

I failed to run radigo (at least, after 2020/05/25 this error has been occurred).
Is there any problem?

$ docker run --rm -v $PWD/output:/output yyoshiki41/radigo rec -id=QRR -start=20200531220000 -output=mp3
Now downloading..
|
+------------+------------------------+
| STATION ID |         TITLE          |
+------------+------------------------+
| QRR        | ๆฐด็€ฌใ„ใฎใ‚Š MELODY FLAG |
+------------+------------------------+
Failed to ConcatAACFiles
ERROR: Failed to concat aac files: exit status 1

rec-live : record forever

When the rec-live option is specified, a duration must be specified with the -t parameter. However, this parameter is ignored and recording continues forever.

Failed to construct a radiko Client

radigoใ‚’ใ„ใคใ‚‚ไฝฟใ‚ใ›ใฆใ„ใŸใ ใ„ใฆใŠใ‚Šใพใ™๏ผŽๆœฌๅฝ“ใซใ‚ใ‚ŠใŒใจใ†ใ”ใ–ใ„ใพใ™๏ผŽ

ๅ…ˆ้€ฑๆ—ฅๆ›œใพใงใฏๅ•้กŒใชใไฝฟ็”จใงใใฆใ„ใพใ—ใŸใŒ๏ผŒไปŠๆ—ฅไฝฟใŠใ†ใจใ—ใŸใจใ“ใ‚

sora@snorlax:~$ radigo rec -a=JP13 -id=FMT -s=20221001190000
Now downloading..
| ERROR: Failed to construct a radiko Client: invalid login status code: 400

ใ“ใฎใ‚ˆใ†ใชใ‚จใƒฉใƒผใŒ็™บ็”Ÿใ—ใพใ—ใŸ๏ผŽใ‚ขใ‚ซใ‚ฆใƒณใƒˆใฏใƒ—ใƒฌใƒŸใ‚ขใƒ ใ‚ขใ‚ซใ‚ฆใƒณใƒˆใงใ™๏ผŽ

่‡ชๅˆ†ใฎใ‚จใƒชใ‚ขใฎใƒฉใ‚ธใ‚ชใฎใƒ€ใ‚ฆใƒณใƒญใƒผใƒ‰ใฏๆญฃๅธธใซใงใใพใ™(-aใงใ‚จใƒชใ‚ขใ‚’ๆŒ‡ๅฎšใ—ใชใ„ๅ ดๅˆใงใ™ใญ)๏ผŽ

็’ฐๅขƒใฏ Windows10(21H2) WSL2 Ubuntu 20.04.5 LTSใงใ™๏ผŽmacOSใงใ‚‚ๅŒๆง˜ใฎ็พ่ฑกใ‚’็ขบ่ชใ—ใŸใฎใงใŠใใ‚‰ใ็ซฏๆœซใฎๅ•้กŒใงใฏใชใ„ใจๆ€ใ„ใพใ™๏ผŽ

ใ„ใค้ ƒใ‹ใ‚‰ๅค‰ๆ›ดใŒ่กŒใ‚ใ‚ŒใŸใฎใ‹ใ‚ใ‹ใ‚‰ใชใ„ใฎใงใ™ใŒ๏ผŒradiko.jpใฎใƒญใ‚ฐใ‚คใƒณ็”ป้ขใŒๆ–ฐใ—ใใชใฃใฆใ„ใพใ—ใŸใฎใงradikoๅดใงไฝ•ใ‹ใ—ใ‚‰ๅค‰ๆ›ดใŒ่กŒใ‚ใ‚ŒใŸใ“ใจใงใ“ใฎใ‚ˆใ†ใช็Šถๆณใซใชใฃใฆใ„ใ‚‹ใฎใงใฏใชใ„ใ‹ใจๆŽจๆธฌใ—ใฆใ„ใพใ™๏ผŽใ‚ˆใ‚ใ—ใใŠ้ก˜ใ„ใ—ใพใ™๏ผŽ

rec-live did not works

docker run -it yyoshiki41/radigo radigo rec-live -id=TBS -t=1000
Now downloading..
+------------+---------------+
| STATION ID | DURATION(SEC) |
+------------+---------------+
| TBS        |          1000 |
+------------+---------------+
| ERROR: Failed to construct rtmpdump command: exec: "rtmpdump": executable file not found in $PATH

so I tried to install rtmpdump manually.

docker run -it yyoshiki41/radigo /bin/bash
apt-get install rtmpdump
radigo rec-live -id=TBS -t=1000

then

Now downloading..
+------------+---------------+
| STATION ID | DURATION(SEC) |
+------------+---------------+
| TBS        |          1000 |
+------------+---------------+
| ERROR: Failed to execute ffmpeg command: exit status 1

How to fix this problem?

Failed to download (rec) JOAB program

According to https://www.nhk.or.jp/pr/keiei/otherpress/pdf/20190322.pdf, JOAB is not able to download as of 2020? wtf...

I could download something from JOAK using the docker container so I am sure my setting is right.

$ docker run -it -v ~/radiko/:/output yyoshiki41/radigo rec -id=JOAK -s=20200722010000
Now downloading..
|
+------------+----------+
| STATION ID |  TITLE   |
+------------+----------+
| JOAK       | ใƒ‹ใƒฅใƒผใ‚น |
+------------+----------+
/ Completed!
/output/20200722010000-JOAK.aac

Failed to get auth_token when executing rec command

Hello,
I've faced the error Failed to get auth_token: strconv.ParseInt: parsing "": invalid syntax when I perform radigo rec command.
I've sought the problem a bit and I think the cause of this problem is authentication handling in go-radiko.

If I use radigo without login, could I skip client.AuthorizeToken in rec.go and rec-live.go?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.