Skip to content

Instantly share code, notes, and snippets.

@kirkbyo
Last active August 29, 2015 14:21
Show Gist options
  • Save kirkbyo/96a6315b7151e45098f1 to your computer and use it in GitHub Desktop.
Save kirkbyo/96a6315b7151e45098f1 to your computer and use it in GitHub Desktop.
Downloads Youtube Videos from .txt
import pafy
""" Dependencies:
- pafy: https://github.com/np1/pafy
"""
fileObject = open("songs.txt", "r")
fileText = fileObject.read()
links = fileText.split("\n")
for url in links:
if (url != ""):
video = pafy.new(url)
audio = video.getbestaudio()
audio.download(quiet=False)
https://www.youtube.com/watch?v=xHRkHFxD-xY
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment