Skip to content

Instantly share code, notes, and snippets.

@vik-y
Last active August 29, 2015 14:17
Show Gist options
  • Save vik-y/5872763240554d4aaf0c to your computer and use it in GitHub Desktop.
Save vik-y/5872763240554d4aaf0c to your computer and use it in GitHub Desktop.
To download a list of files from youtube
'''
Copy the list from youtube and save it in a file urls.txt
Run this script to get all the urls
Put them in a file and run youtube-dl --playlist-start <number> --playlist-end <number> -a "filename.txt"
Download entire playlist
'''
from BeautifulSoup import BeautifulSoup
a = open('urls.txt', 'r')
b = a.read()
soup = BeautifulSoup(b)
urls = soup.findAll('a', {'class':'playlist-video clearfix spf-link '})
print urls
for val in urls:
print "http://youtube.com"+val['href']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment