A script used to save radios broadcasted on AGQR.
Compared to ybenjo/agqr.rb:
- Fixed the script to work if run on machines that operate on non-JST timezones
- Fixed a bug in the folder creation part of the script which would cause the script to fail and not run
- Changed the folder paths to be within the same directory as the script
- Updated the dependencies to say Ruby 2.x or above, because
__dir__
was only introduced in Ruby 2.0.0.
Put agqr.rb
in a folder of your choice, then install a Cron job like this:
29,59 * * * * sleep 55; ruby agqr.rb
This causes Cron to execute this command at 29th and 59th minute of every hour, sleep for 55 seconds, then run agqr.rb
. If there is something to record, then it should automatically start recording.
A note on cronjobs:
You may need to use absolute paths when specifying your ruby
binary and the location of agqr.rb
due to the fact that Cron executes with a different PATH
compared to your normal shell. Alternatively, you can specify a custom PATH
in your personal file.
See this AskUbuntu answer for more details).
The script automatically creates a structure like this upon first run:
├ rec
├ flv
└ mp3
Downloaded .flv
files are placed in rec/flv
and the converted .mp3
files are in rec/mp3
.
The default paths for rtmpdump
and ffmpeg
are based on what I have on my Ubuntu server, so feel free to overwrite those with your correct paths.
- Ruby 2.x
- rtmpdump
- ffmpeg
- cron
This is where you specify the shows you want to record.
To add a show, simply add a new entry to the file like this:
- title: title
wday: 月
time: '10:30'
length: 30
The script supports time expressions like 26:00
(02:00
next day).
Weekday is specified via kanji for readability.
NOTE: Using spaces, ampersands, quotation marks, braces/brackets in the title
may break the script.