Skip to content

Instantly share code, notes, and snippets.

@twocity
Created March 5, 2018 03:51
Show Gist options
  • Save twocity/d6f0b19fe15d2503a4b61cddcbc3131d to your computer and use it in GitHub Desktop.
Save twocity/d6f0b19fe15d2503a4b61cddcbc3131d to your computer and use it in GitHub Desktop.
download youtube audio through youtube-dl
from subprocess import call
import sys
cmd = 'youtube-dl --extract-audio --audio-format mp3 --audio-quality 0'.split(' ')
url = sys.argv[1]
cmd.append(url)
print('running {}'.format(' '.join(cmd)))
call(cmd)
@twocity
Copy link
Author

twocity commented Mar 5, 2018

python3 youtube-dl-mp3.py YOUTUBE-URL

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