Created
January 23, 2019 18:15
-
-
Save kmkmjhyiiiu/3b3517ce856e97f8683a1480b5f5e5ce to your computer and use it in GitHub Desktop.
Download list of yt videos to mp3
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
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