Skip to content

Instantly share code, notes, and snippets.

@yzdann
Last active September 26, 2018 15:01
Show Gist options
  • Save yzdann/f16f0f4cf37bf5aca7087dde428deb06 to your computer and use it in GitHub Desktop.
Save yzdann/f16f0f4cf37bf5aca7087dde428deb06 to your computer and use it in GitHub Desktop.
import requests
from bs4 import BeautifulSoup
playlist_uuid = "PLoTq7UR349FHG_fqBNFAjsnWmUntUs0_E"
response = requests.get(
"https://www.youtube.com/playlist?list="
+ playlist_uuid)
page_content = response.content
soup = BeautifulSoup(page_content, "lxml")
links = soup.select('.pl-video-title-link')
with open('/home/yzdann/youtube_links_file', 'w') as youtube_link_file:
for link in links:
uuid = link.attrs['href'][9:20]
title = link.string.strip()
youtube_link = title + ":\nhttps://www.youtube.com/watch?v=" + uuid
youtube_link_file.write(youtube_link+"\n")
@yzdann
Copy link
Author

yzdann commented Sep 26, 2018

save my youtube playlist links to a file for download them later with youtube-dl after midnight :)

  • [ ] use system default proxy in request(socks5) instead of running with proxychains or torsocks
  • [ ] use bash or python to pass them automaticly to youtube-dl

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