Skip to content

Instantly share code, notes, and snippets.

@hoodie
Last active December 21, 2015 15:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hoodie/6328073 to your computer and use it in GitHub Desktop.
Save hoodie/6328073 to your computer and use it in GitHub Desktop.
download sputnik roboton shows (needs debugging)
#!/bin/bash
function cget(){
curl $* --silent --user-agent "Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20100101 Firefox/16.0"
}
# | xargs wget -nc -q -P /home/hendrik/roboton
station=${@:-https://www.sputnik.de/programm/programmschema}
#showpage="http://www.sputnik.de/musik/sendungen/sputnik-roboton-mi-22-00-23-00-cet"
showpage=$(cget $station --silent | sed -n 's/.*href="\(http[^"]*\).*/\1/p' | grep roboton)
shows=$(cget $showpage --silent | sed -n 's/.*href="\(http[^"]*\).*/\1\n/p' | grep mp3)
for show in $shows; do
#echo $show
url=$(cget $show --silent | sed -n 's/.*File.=\(.*.mp3\).*$/\1/p')
#IFS=$'\n'; for i in `bash hoody.sh | sed "s/.mp3.*$/.mp3/"`;do wget "$i"; done
wget "$url"
done
@maloi
Copy link

maloi commented Aug 24, 2013

#!/bin/bash
function cget(){
  curl $* --silent --user-agent "Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20100101 Firefox/16.0"
}
# | xargs wget -nc -q -P /home/hendrik/roboton

station=${@:-https://www.sputnik.de/programm/programmschema}
#showpage="http://www.sputnik.de/musik/sendungen/sputnik-roboton-mi-22-00-23-00-cet"
showpage=$(cget $station --silent | sed -n 's/.*href="\(http[^"]*\).*/\1/p' | grep roboton)
shows=$(cget $showpage --silent | sed -n 's/.*href="\(http[^"]*\).*/\1\n/p' | grep mp3)

for show in $shows; do
  #echo $show
  url=$(cget $show --silent  | sed -n 's/.*File.=\(.*\)/\1/p'  | sed 's/\r$//' )
  wget $url
done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment