Search code examples
applescriptautomatoryoutube-dl

What's wrong with this Automator Workflow for YouTube-dl (AppleScript)


ytURL = https://www.youtube.com/watch?v=dQw4w9WgXcQ

do shell script "/usr/local/bin/youtube-dl -o ~/Desktop/DownloadedVideo.mp4 " + ytURL

(see photo for more info)

Screenshot + error message


Solution

  • For the Run AppleScript action use the following example:

    on run {input, parameters}
        
        do shell script "/usr/local/bin/youtube-dl -o ~/Desktop/DownloadedVideo.mp4" & space & quoted form of item 1 of input
        
    end run
    

    Per CJK's comment, if you want to use a Run Shell Script action instead, then use:

    • Pass input: as arguments

    Replace the default code with just:

    /usr/local/bin/youtube-dl -o ~/Desktop/DownloadedVideo.mp4 "$1"