Skip to content

Instantly share code, notes, and snippets.

@marcotrosi
Created December 15, 2015 16:56
Show Gist options
  • Save marcotrosi/89f535a0052f8e3c8454 to your computer and use it in GitHub Desktop.
Save marcotrosi/89f535a0052f8e3c8454 to your computer and use it in GitHub Desktop.
#!/bin/bash
# save tool paths in variables
CocoaDialog='/Applications/cocoaDialog.app/Contents/MacOS/cocoaDialog'
YoutubeDL='/usr/local/bin/youtube-dl'
# get clipboard content
Clipboard=$(pbpaste)
# run youtube-dl
$YoutubeDL -o "/Users/${USER}/Downloads/%(title)s.%(ext)s" $Clipboard
# create info bubble
if [ $? -eq 0 ]; then
$CocoaDialog bubble --timeout 3 --title "YoutubeDL" --text "Download Successful";
else
$CocoaDialog bubble --timeout 3 --title "YoutubeDL" --text "Download Failed";
fi
exit 0;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment