Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

A pair of scripts to simplify posting videos to YouTube Internet
We have had a few video cameras, but it was always a real pain to submit short video clips to YouTube. Basically, I would need to create a short movie in a program like iMovie or Final Cut Express and then export it. This is something that is too complicated for my wife, so she asked me for some way to simply drag and drop a video onto an icon in her dock.

I put together these two scripts to automate that process. Just install youtube into /usr/bin/local, and youtube.app into /Applications (and then drag it to your Dock). First, here's the youtube shell script: You need to have ffmpeg installed, of course -- I suggest MacPorts -- and you may need or want to modify the above shell script to set the ffmpeg options, or the path to ffmpeg. Remember to make the script executable, too.

Here's the AppleScript source for youtube.app; paste this into Script Editor and save as an application:
(*
 * This is a droplet that will u/l dropped files and open a message
 * in Mail.app with the urls.
 *)
on open filelist
    -- create the command line
    set this_command to "/usr/local/bin/youtube"
    repeat with i in filelist
        set this_command to this_command & " " & quoted form of POSIX path of i
    end repeat
    -- use Terminal.app to run the command, so that we can see progress
    -- and handle interactive parts such as entering passwords
    tell application "Terminal"
        activate
        -- The bit of shell-code at the end is there b/c Terminal.app
        -- runs the command under 'login -fp' and this way the window
        -- will close after a successful transfer, but will stay open
        -- if the Settings have 'Close only if the shell exited cleanly'
        -- on an error. This bit of code also works regardless of if
        -- the login shell is a Bourne or csh styles shell.
        do script this_command & " && exit || kill `ps $$ -o ppid=`"
    end tell
end open
When you have a nice video clip (say in your Movies folder, in iPhoto, or QuickTime) that you'd like to post to YouTube, just drag the file or files onto the dock icon for youtube.app. Terminal.app will fire up and run ffmpeg to convert the videos into a format more comfortable for the web. Also, it will fire up QuickTime Player with the transcoded file(s). You open a browser window to youtube.com, and then just drag the file(s) from the title bar of the QuickTIme Player window(s) into the file chooser dialog of the browser. After a bit of time, the video(s) should be uploaded.

When you close the browser window and the QuickTime Player Windows, you will see the Terminal.app window asking whether you want to delete or keep the transcoded files (stored in /tmp).

[robg adds: I haven't tested this one.]
    •    
  • Currently 2.22 / 5
  You rated: 1 / 5 (9 votes cast)
 
[9,003 views]  

A pair of scripts to simplify posting videos to YouTube | 1 comments | Create New Account
Click here to return to the 'A pair of scripts to simplify posting videos to YouTube' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
A pair of scripts to simplify posting videos to YouTube
Authored by: ptone on Dec 01, '08 08:47:51AM

There is a typo in the hint text referring to "/usr/bin/local/" while the script src has it correctly as "/usr/local/bin/"

I've thought of putting something like this together, but was hoping this solution would have also done the next step which is to figure out the steps to get curl to login to youtube and do the upload automatically...

-P



[ Reply to This | # ]