Skip to content

Instantly share code, notes, and snippets.

@sidouglas
Created October 21, 2018 07:42
Show Gist options
  • Save sidouglas/8f6842b969293258c81f56d151a9b8c6 to your computer and use it in GitHub Desktop.
Save sidouglas/8f6842b969293258c81f56d151a9b8c6 to your computer and use it in GitHub Desktop.
Youtube DL wrapped in applescript for audio only downloads to desktop.
set theResponse to display dialog "Enter youtube url" default answer "" with icon note buttons {"Cancel", "Continue"} default button "Continue"
set theUrl to (text returned of theResponse)
set shellPath to "PATH=$PATH:/bin:/sbin:/usr/bin:/usr/local/bin:/usr/sbin:~/opt/bin:~/opt/sbin:/opt/local/bin:/opt/local/sbin:" & quoted form of (POSIX path of ((path to me as text) & "::")) & "; "
do shell script shellPath & "youtube-dl --ignore-errors -f bestaudio --extract-audio --audio-format mp3 --audio-quality 0 -o \"~/Desktop/%(title)s-%(id)s.%(ext)s\" " & theUrl
display dialog "Done" giving up after 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment