Skip to content

Instantly share code, notes, and snippets.

@twocity
Created March 5, 2018 03:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save twocity/fd7d89e537cc9586268d42f73b32a561 to your computer and use it in GitHub Desktop.
Save twocity/fd7d89e537cc9586268d42f73b32a561 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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment