Last active
August 29, 2015 14:17
-
-
Save vik-y/5872763240554d4aaf0c to your computer and use it in GitHub Desktop.
To download a list of files from youtube
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
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