Skip to content

Instantly share code, notes, and snippets.

@doorknob60
Created June 7, 2012 01:01
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 doorknob60/2885837 to your computer and use it in GitHub Desktop.
Save doorknob60/2885837 to your computer and use it in GitHub Desktop.
Youtube subscription viewer
#!/usr/bin/env python3
import feedparser
import subprocess
d = feedparser.parse('http://gdata.youtube.com/feeds/base/users/USER/newsubscriptionvideos')
onetoten = range(0, 20)
for n in onetoten:
print(str(n)+". "+d.entries[n].title+" - "+d.entries[n].author)
x = int(input('Which number (0-19)? '))
print(d.entries[x].link)
rawurl = subprocess.check_output(['youtube-dl', '-g', '--max-quality=22', '--cookies', '/tmp/ytdl-cookie.txt', d.entries[x].link])
subprocess.call(['mplayer', '-cookies', '-cookies-file', '/tmp/ytdl-cookie.txt', rawurl.strip()])
subprocess.call(['rm', '/tmp/ytdl-cookie.txt'])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment