Wrapping youtube-dl into automator via applescript
Nice - a simple UI like that could be very useful in many situations!

Try this:

display dialog "URL to fetch?" default answer ""
set theUrl to (text returned of result)

--&gt; get file
do shell script "cd /tmp/; /usr/local/bin/youtube-dl " &amp; theUrl

--&gt; get title
set theTitle to do shell script "/usr/local/bin/youtube-dl -e " &amp; theUrl

display notification "Fetched " &amp; theTitle sound name "Blow"
delay 1 --&gt; avoid quit before notice


Unfortunately the youtube-dl script did not actually download the video when using the -e flag, (and an error occurred when trying to use the --exec CMD option).

Ended up just running the command twice; First download to /tmp, then get title.

Could also use the process id (pid) to track progress, etc.. :)

command 2&gt;/dev/null &amp; pid=$!


Update:
I could not get the output of certain commands through applescript, like 'nettop'. There are probably ways to fix it.
Here is my sloppy attempt at implementing a pid checking.. :)

set question to display dialog "URL to fetch?" default answer "" buttons {"Cancel", "Open in Browser", "Download"} default button 3
set pageURL to (text returned of result)
if pageURL is "" then return "No URL"
set choice to (button returned of question)

if choice is "Download" then
    try
        set pid to do shell script "cd /tmp/; /usr/local/bin/youtube-dl --newline " &amp; pageURL &amp; " &gt; /tmp/vidstatus 2&gt;&amp;1 &amp; echo $!"
        delay 1
        repeat while ((do shell script "kill -0 " &amp; pid) is "") -- check if pid is still responding
            display dialog "Status: " &amp; (do shell script "tail -n1 /tmp/vidstatus") -- display last line of output
        end repeat
    on error
        display dialog "Download complete!" -- eh, success, hopefully :) 
    end try

else if choice is "Open in Browser" then
    try
        set videoURL to do shell script "/usr/local/bin/youtube-dl -g " &amp; pageURL
        open location videoURL -- browser can stream and save file
    on error
        display dialog "Download aborted!"
    end try
end if