I did some research to find an option to automatically upload a video to both YouTube and WordPress.  My goal was to automate the entire upload process from the weather camera computer to YouTube to WordPress.  The benefit of uploading to YouTube first was I was able to find a couple of WordPress plugin that would monitor a YouTube channel and create a WordPress post with an embedded YouTube video.

The first search was for a WordPress plugin.  I found one called External Videos.  The plugin creates a new WordPress post type for the videos.  Here is a great External Videos configuration article.  The plugin worked great.  I just typed in my YouTube user name and started importing videos.  The plugin also created a cron job to automatically import the videos daily.  The only missing feature was that the video posts didn’t go onto the main post blog.  You can attach a video post to a regular post but that is a manual process.  However, I realized I can do this command on interesting videos posts and add a larger description.

The next search for an automatic way to upload to YouTube.  The first thing I found was something called Google CL, short for command line.  However, it looked like it required Python and maybe Linux which wouldn’t work on my Windows XP weather camera computer.  I did find some other software programs but they were quite expensive.  So, I re-visited the Google CL program due to the info in an article called Access Google Services From the Command Line.  The article said there was a version that was an EXE file.  I follow the instructions and was able to make it work.  I did have an issue with the authorization.  I found this webpage that fixed the issue.

I experimented with the parameter syntax and was able to get it to upload.  The command I used was:

F:\googlecl\google.exe youtube post F:\WeatherCam\Movie\upload\* –category People –tags “Woicik, weather”  –summary “Woicik Weather Camera at http://woicik.com

I was able to set the same tags which would import into WordPress also.  The Category gave me a pause.  The syntax is very specific including capitalization.

The last parts to complete the automatic script was to use a program called Blat to send an email when the script ran and to move the AVI file into a series of folders.

Here is the entire script:

MOVE F:\WeatherCam\Movie\*.avi F:\WeatherCam\Movie\upload\
F:\googlecl\google.exe youtube post F:\WeatherCam\Movie\upload\* –category People –tags “Woicik, weather”  –summary “Woicik Weather Camera at http://woicik.com
MOVE F:\WeatherCam\Movie\upload\*.avi F:\WeatherCam\Movie\archive\