Skip to content

Instantly share code, notes, and snippets.

@luciferous
Created August 25, 2010 23:54
Show Gist options
  • Save luciferous/550530 to your computer and use it in GitHub Desktop.
Save luciferous/550530 to your computer and use it in GitHub Desktop.
#!/bin/sh
#RSS="http://www.reddit.com/r/Music/top/.rss?t=year"
RSS="http://www.reddit.com/r/listentothis/top/.rss?t=week"
YOUTUBE_RE="youtube\.com\/watch\?v=([^&\"]+)"
DATA=`curl --silent --compressed "$RSS"`
MATCHES=`echo $DATA | grep -Po "$YOUTUBE_RE"`
echo $DATA | hxselect -s '\n' -c item title | nl
for URL in $MATCHES;
do
cookiefile="/tmp/cookies-$( date +%s.%N ).txt"
PLAYURL=$( youtube-dl -f34 --cookies $cookiefile -g $URL )
mplayer -really-quiet -vo null -cookies -cookies-file $cookiefile $PLAYURL
rm -f $cookiefile
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment