
Source (link to git-repo or to original if based on someone elses unmodified work): Add the source-code for this project on opencode.net
RecordRadio is a simple bash script that plugs into amarok and uses streamripper to record radio stations you listen to.
Now as of version 0.2 it can also save podcasts to your music collection!
Simply enable it as a plugin, and when you connect to any http stream it plugin will spawn a instance of streamripper that will record the songs and place them in subdirectories within a directory called "Music" in your home. Five seconds later amarok will start listening to a relay server on port 8017 so as not to use unnecessary bandwidth.
To save a podcast or remote mp3 or ogg file to your music collection, right click on it in your playlist, select "RecordRadio" and "Save Podcast". They will be saved in a directory called Music/SavedPodcasts within your home directory.
If you wish to change the streamripper options (proxy settings etc.) or the directory where things are stored right-click on RecordRadio in your script manager and click edit. These are simply variables that are set in the first few lines of the file.
Requirements:
You need to have streamripper installed. It comes as part of Debian and several other distributions. You can also download it from http://streamripper.sourceforge.net/ .
If you are using Mandriva 2006 you can get streamripper from "contrib". However for RecordRadio to work you will need to update to the latest version of Amarok due to a bug in 1.3.1
For RecordRadio to run need to have a few standard GNU commands available: (awk, egrep, ps, wget)
RecordRadio has been tested on and works with
Amarok == 1.3.7 (with xine and arts engines),
1.3.1 will NOT work!
Streamripper == 1.67.17
Note: This script will not work with Amarok 2.0. Please see: https://bugs.kde.org/show_bug.cgi?id=179015
Known Bugs:
When you start an internet radio station your playlist will be cleared. (This can be fixed as soon as the amarok developers fix the playMedia dcop call)
Because streamripper for whatever reason cannot produce metadata on demand for some stations, there may be a delay of up to 15 secounds before you can switch to the replay server. However you can continue to listen to the station live until then, and it will still get recorded. These stations may also cause amarok to be unable to report the length of recorded songs. However these can be fixed by using a plugin called MP3Fixer, and restarting amarok.
Sometimes the server is full and cannot support an additional connection for streamripper so you can't record that station, so it simply will not be recorded and you will continue to listen to it live. If this happens you will receive an error to the effect that localhost refused your connection.
If you like this plugin, please consider making a donation to the Electronic Frontier foundation: www.eff.org
12 years ago
0.2.3 - Separate "always record" and "Record on demand" modes and several bug fixes.
0.2.2 - Adds menu to listen without recording.
0.2.1 - Fixed bugs mentioned by pfeifle and prevented from going out of control if amarok crashes.
0.2 - Added ability to save podcasts.
0.1.1 - Removed bug requiring output file.
0.1 - First release
12 years ago
0.2.3 - Separate "always record" and "Record on demand" modes and several bug fixes.
0.2.2 - Adds menu to listen without recording.
0.2.1 - Fixed bugs mentioned by pfeifle and prevented from going out of control if amarok crashes.
0.2 - Added ability to save podcasts.
0.1.1 - Removed bug requiring output file.
0.1 - First release
TFrog
9 years ago
Report
miskoooo
11 years ago
any help please ? tx
Report
tkaitchuck
11 years ago
You can of course get around this if you really want to. If you look at its manpage, streamripper has an option to change the user agent to anything you want. All you have to do is to add this flag to the 'options' string specified at the top of the file.
This is not done by default, because I have no desire to conceal things from the site it is connecting to.
Report
ckaminsk
12 years ago
Can I use this Script in Amarok 2.0 ?
Report
tkaitchuck
12 years ago
Someone decided that the only plugins that should be allowed must be written in Java script, not call any external libraries processes and only call these functions within Amarok: http://amarok.kde.org/wiki/Development/Script_API
I consider this very limiting and have filed a feature request: https://bugs.kde.org/show_bug.cgi?id=179015
I would encourage anyone who wants this plugin to continue to work in future version to vote for that feature.
Report
Phobeus
12 years ago
Importer.loadQtBinding("qt.core");
var q = new QProcess();
q.start("kate");
And it seems to work. Should be possible to execute streamripper on this way. I might look deeper into it someday, but it would be great to see this script ported to amarok 2.0 soon. It is definitly one of my favorite ones and currently deeply missed! :)
Report
suther
12 years ago
The first lines of "OnDemand-Script" like this:
== snip ===
Output="/dev/null"
MusicDir="$HOME/Music"
PodcastDir="$MusicDir/SavedPodcasts"
PortNumber=8017
http_proxy=""
Options="-o larger -k 1 --quiet -z"
== snap ===
should be changeable out of amarok.
Report
Thelonius
13 years ago
Great work!
Cheers, Thelonius
Report
ghettogeek
13 years ago
In both modes (always and record on demand) the stream records into one big mp3 file. I start and stop recording with the script manager and I'm running Amarok 1.4.5. and streamripper.
Please help!
Thanks :)
Report
Daniel2009
13 years ago
Quote:Q: How can I make streamripper rip to a single large file instead of a lot of little files?
A: Use the -a flag to rip to a single large file. Use the -A flag to disable the creation of the little files.
http://streamripper.sourceforge.net/faq.php
Report
corinna
14 years ago
While amaroK plays in the background I happen to decide that I'd like to have the actual playing song on my harddisk.
How about a Skript recording a radiostream song after song all the time, and a possibility to hit a button saying "save this". If this button is not hit while the actual song is still playing, then the song is deleted when the next song begins.
Report
Trek1701
14 years ago
One question: to record I use "save podcast" but how do I stop recording?
Thanks
Report
rastaplan
14 years ago
great tool!
Just one problem. I tried to record the last.fm stream in amarok 1.4.0(through lastamarok) with recordradio but its just not working...
any ideas how to handle this?
Report
eean
14 years ago
Report
vidak
14 years ago
The script works well with eg. Virgin Radio, but not with last.fm ...
Report
Phlogiston
14 years ago
http://search.cpan.org/src/JOCHEN/last.fm-ripper-1.2/README
Report
RyanDBair
14 years ago
Report
Animatrix30
15 years ago
I try your script, but it says me that :
"Impossible to open the URL http://localhost:8017/relay.mp3
I use Xine, but with Arts it is worse !
What can I do ?
Bye !
Report
tkaitchuck
14 years ago
There are two possibilities that can cause this.
First is if you are using the "Always record" mode, the server may have accepted the connection from your computer, and allowed you to start listening, but rejected when you tried to reconnect, because it was busy. This should not happen in "record on demand" mode. So try that first.
The second possibility is that it simply did not wait long enough to try to connect to the server. This could simply be caused by your computer being slow. If this happens consistently go into the script manager and right click on the script and click edit. Then change the line towards the bottom that says: "sleep 2" to something like say "sleep 5", which will add an extra three seconds pause to get the relay server up and running.
If this continues to happen, even with the increased delay and in "on demand" mode. Then edit the script so that it sends it's log to a file somewhere, start amarok and reproduce the problem. Then send me the log file as well as a step by step list of everyting you did.
Report
blujay
15 years ago
http://64.236.34.67:80/stream/1005
Can that be fixed? :)
Report
tkaitchuck
15 years ago
Report
tkaitchuck
14 years ago
There are two possibilities that can cause this.
First is if you are using the "Always record" mode, the server may have accepted the connection from your computer, and allowed you to start listening, but rejected when you tried to reconnect, because it was busy. This should not happen in "record on demand" mode. So try that first.
The second possibility is that it simply did not wait long enough to try to connect to the server. This could simply be caused by your computer being slow. If this happens consistently go into the script manager and right click on the script and click edit. Then change the line towards the bottom that says: "sleep 2" to something like say "sleep 5", which will add an extra three seconds pause to get the relay server up and running.
If this continues to happen, even with the increased delay and in "on demand" mode. Then edit the script so that it sends it's log to a file somewhere, start amarok and reproduce the problem. Then send me the log file as well as a step by step list of everyting you did.
Report
tkaitchuck
14 years ago
Report
blujay
15 years ago
Report
tkaitchuck
15 years ago
Report