I wrote a small bash script to automate downloading from samurai.fm:
Code:
#!/bin/bash
#ver.6
Error() { read -p "Press enter to continue"; }
# -----uncomment following strings for first run:
#sudo add-apt-repository ppa:jon-hedgerows/get-iplayer
#sudo apt-get update
#sudo apt-get install rtmpdump
#sudo apt-get install ffmpeg libavcodec-extra-53
mkdir -p ~/Music/SamuraiFM
cd ~/Music/SamuraiFM/
link="link not captured!"
sudo iptables -t nat -A OUTPUT -p tcp --dport 1935 -j REDIRECT || Error
echo refresh browser and press PLAY then press here "q" and hit ENTER
link=`sudo rtmpsrv | grep rtmpdump -r ` || Error
fname=`echo $link | sed 's/.*-o //' | sed 's/.flv//'`
sudo echo $link | sed 's/-o.*/--live -o - | ffmpeg -i - -vn -y -ab 320 "SFM_'$fname'.mp3"/' > samurai_link.sh || Error
sudo iptables -t nat -D OUTPUT -p tcp --dport 1935 -j REDIRECT || Error
sudo bash samurai_link.sh || Error
rm -f $fname.flv
U start script, refresh samurai.fm page, hit play & pause on desired track, back to terminal, hit Q and Enter. Download starts.
As i need to make some changes to link & to make it fully automatic (to skip mess with Q and Enter) it would be great to have an option for rtmpsrv just to output download link and exit quietly, without autostart of rtmpdump.
Anyway it's a great tool, thanks.