Skip to content

Instantly share code, notes, and snippets.

@kmkmjhyiiiu
Created January 23, 2019 18:15
Show Gist options
  • Save kmkmjhyiiiu/3b3517ce856e97f8683a1480b5f5e5ce to your computer and use it in GitHub Desktop.
Save kmkmjhyiiiu/3b3517ce856e97f8683a1480b5f5e5ce to your computer and use it in GitHub Desktop.
Download list of yt videos to mp3
from subprocess import Popen
def main():
_list = open('list.txt', 'r').read().splitlines()
for link in _list:
p = Popen(executable="/home/ammadkhalid/.local/bin/youtube-dl", args=[
'-i',
'--extract-audio',
'--audio-format',
'mp3',
'--audio-quality',
'0',
link
], shell=True)
print('Waiting for video to be download.')
p.wait()
print("Done!")
if __name__ == '__main__':
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment