Podcast Producer Community Site

Welcome to podcastproducer.org
Friday, September 03 2010 @ 01:08 PM CEST

Youtube upload from Podcast Producer with pcptools

Somebody asked in the forums recently how to get Podcast Producer to upload videos automatically to YouTube.com. There is a description available by Apple at http://developer.apple.com/mac/articles/server/podcastproduceryoutube.html. This example uses a Java YouTube API library to upload the video, but I thought it might also be possible to do this the easy way: with ruby. I little while into writing this script I figured that this was something I would rather have available in pcastaction. Since there might be more things that people find missing in pcastaction I created pcptools.

The idea of pcptools is to have a toolkit for all the stuff that should be in pcastaction, but is not. I have made a start for this script and I hope that people will contribute ideas or code to make this a general purpose tool for Podcast Producer. The general idea and usage is the same as pcastaction. All the code for pcptools is in one file, so it is easy to include in a workflow (use the '/Tools' directory). At the moment pcptools has only one subcommand 'publish2library'.

Before you start trying the script you will need to get yourself an account at youtube and a Developer Key.

Download pcptools I have tried to keep the experience similar to using pcastaction, so when you type:

pcptools help publish2youtube
The output looks like this:

PcP Tools Version 0.1b

 
pcptools publish2youtube --basedir=BASEDIR --input=INPUT MOVIE --dev_id=YOUTUBE_DEVELOPER_ID --user=YOUTUBE_USERNAME
                         --pass=YOUTUBE_PASSWORD --title=TITLE --description=DESCRIPTION --keywords=KEYWORDS
                         --category=YOUTUBE_CATEGORY [--autosplit]
 
KEYWORDS should be a string of keywords separated by ','
 
CATEGORY should by one of the valid YouTube categories

--autosplit
When you use this option the input video will be split into 10 minute chunks,
if it is more than 10 minutes long. The chunks will be uploaded separatly and named
sequentially.
Here is an example for uploading a file to youtube:

publish2youtube.rb --basedir=~/Desktop \
--input=example.mov \
--dev_id=IOkjhdfkjKJkdbKHubLSonsllfeqpwqimKNknknubxc-Jjhofon \
--user=myusername \
--pass=mypassword \
--title="Example Movie" \
--description="This is the description" \
--keywords="test, cool, upload" \
--category=People \
--outfile=publish_youtube.yaml \
--autosplit
When you give the autosplit argument, the script will automatically split videos longer than 10 minutes in 10 minute or less chunks and upload them to youtube.

You could use pcptools for uploading to youtube in any of your workflows, but it would be easier to incorporate it in one 'Youtube' workflow and use this workflow in other workflows to publish to. That way, you will only have to make one custom workflow and use Podcast Composer for all your other generic workflows that you want to use the youtube upload with.

For our 'Youtube' workflow we are going to start with a simple Podcast Composer generated workflow, so open up Podcast Composer and make one:

• Import > should be single source (all your dual source movies are 'single source' by the time they end up here)
• Edit > Remove intro and exit movie
• Edit > Remove Title
• Edit > Remove Watermark
• Export > leave at default
• Publish > only select 'Original Sources'
• Notify > Leave empty

Save the workflow and open the workflow package (right-click on it and select 'View package contents'). Navigate to the Tools directory and copy the pcptools script in here. Now open the template.plist file with Property List Editor. There are some steps we don't need in this workflow, so delete the following tasks:
• edit-core-annotate
• edit-core-master
• export-core-preview-image
• import-plugin-movie-generated
• export-plugin-quicktime[UUID]

Rename the task 'publish-plugin-podcastlibrary-import-plugin-movie-original' to 'publish-youtube'. We are going to edit this task to use pcptools to upload our file to youtube. Change the command to be $$GLOBAL::Workflow Resource Path$$/Tools/pcptools. Best is to delete all arguments and then add these:

--basedir=$$GLOBAL::Library Bundle Path$$/Contents/Resources/Working
--input=$$SOURCE::0::Filename$$
--dev_id=[Your youtube dev id]
--user=[Your youtube login name]
--pass=[Your youtube password]
--title=$$Title$$
--description=$$Description$$
--keywords=pcp (use your own keywords)
--category=People (Use only valid youtube categories)
--autosplit
--outfile=publish-plugin-youtube.yaml (for later use)

Now change the 'dependsOnTasks' tag of the 'publish-youtube' task to only contain one item called 'preflight'. In the 'postflight' task make sure that in the 'dependsOnTasks' tag there is only one item called 'publish-youtube'. Now save the file.

Upload the new workflow with the following command:

pcast --server <hostname server> --user <admin user> --installworkflow --path <path to workflow>
Now you can use this workflow in other workflows with the Podcast Composer publish-to-workflow item.

Story Options

Youtube upload from Podcast Producer with pcptools | 13 comments | Create New Account
The following comments are owned by whomever posted them. This site is not responsible for what they say.
Youtube upload from Podcast Producer with pcptools
Authored by: Marcel Borsten on Monday, December 28 2009 @ 10:31 PM CET

I've noticed there is still a problem with the --autosplit option, so I'll be posting an update of the script soon.

Youtube upload from Podcast Producer with pcptools
Authored by: budGibson on Monday, December 28 2009 @ 11:46 PM CET
This looks quite good. I'm starting from scratch with podcast producer, but I'm fairly technical and should be able to figure this out. A few points:
  • A screen cast showing the installation steps and use within podcast producer would be quite nice. Perhaps, you can post it on youtube ;). Generally, a youtube channel for this site would make a lot of sense.
  • What's the difference between pcptools and the ruby gem? Does the gem just install library code needed by pcptools?
  • The way you've done this implies that one can chain together workflows, with this one being on the final output stage. Is that what you intend? Is it fairly obvious how to do it?
Thanks for this work. FYI, I'm actually a faculty who invested in a mac min os x leopard server to get all this stuff launched. My goal is to get going on it this coming term. The youtube channel idea comes from what I am trying to do. Generally, I think it would be icing on the cake here. I'm not trying to push more work onto your volunteer shoulders. It would however increase your reach.
Youtube upload from Podcast Producer with pcptools
Authored by: Marcel Borsten on Tuesday, December 29 2009 @ 03:38 PM CET
I've set up a Github repository for the script at PcP Tools Repo
Youtube upload from Podcast Producer with pcptools
Authored by: esummers on Wednesday, January 20 2010 @ 11:41 PM CET

This script isn't going to work for legacy YouTube accounts created before the Google acquisition. You also need to send the original username for that in addition to the new google username and password. If I get a chance to use the script, I'll fix it and post it.

Youtube upload from Podcast Producer with pcptools
Authored by: Marcel Borsten on Thursday, January 21 2010 @ 10:31 AM CET
Thanks for the feedback, thats a great tip. Would you mind filing a bug for this at http://github.com/mborsten/PcP-Tools/issues
Youtube upload from Podcast Producer with pcptools
Authored by: jfbloom22 on Tuesday, February 23 2010 @ 05:43 AM CET

I have written a Java program to upload to youtube and a bash shell script to feed it the data from podcast producer. The only problem is that podcast producer doesn't seem be able to run my bash shell script. I have placed the script in the resources folder of the workflow and modified the template.plist to call the script. I have tried everything it seems, but I keep getting the same error:

2/22/10 10:24:55 PM xgridagentd[77] Notice: agent task "-1" failed for user "jflower" executable "pcastaction" arguments (
"--basedir=/Network/Servers/macserver.libertyupdatepodcast.com/Library/PodcastProducer/Shared/UUIDs/086CCBDA-2074-4B79-A452-434A434D4F99.prb/Contents/Resources/Working",
"--",
"publish_youtube",
"",
"D193FC5F-E1CB-4A39-AE2C-3A7F4DE060E1-7408308F-6386-4F9D-ADE0-267929EB2BA3-youtube.m4v",

Youtube upload from Podcast Producer with pcptools
Authored by: krolingo on Friday, March 05 2010 @ 03:39 PM CET

The script does not work (for me):

./pcptools publish2youtube --basedir=/Users/someuser/Desktop/ --dev_id=[ID HERE]--user=[Redacted] --pass=[Redacted] --title="Example Movie" --description="This is the description" --keywords="test" --category=People --outfile=publish_youtube.yaml --input=test.mov
./pcptools:359: warning: instance variable @auth_token not initialized
warning: peer certificate won't be verified in this SSL session
./pcptools:325:in `upload': uninitialized constant Publish2YouTube::UploadError (NameError)
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/net/http.rb:543:in `start'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/net/http.rb:440:in `start'
from ./pcptools:312:in `upload'
from ./pcptools:181:in `upload_movie'
from ./pcptools:154:in `run'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `each_with_index'
from ./pcptools:149:in `each'
from ./pcptools:149:in `each_with_index'
from ./pcptools:149:in `run'
from ./pcptools:529

Youtube upload from Podcast Producer with pcptools
Authored by: mjfenton on Monday, May 24 2010 @ 04:14 AM CEST
I cannot get the workflow to successfully process a job. I've been troubleshooting, and am stuck on a few questions:

1. In the tutorial, is the line "--basedir=$$GLOBAL::Library Bundle Path$$/Contents/Resources/Working --input=$$SOURCE::0::Filename$$" supposed to be one line or two lines? In terms of editing the template.plist file, is this one argument, or two?

2. When my jobs fail, I see the message "Unable to resolve admin user: admin" in the Podcast Producer menu on the Server Admin tool. Can anyone translate this (or offer suggestions for a solution) for a novice such as myself?

3. Should the pcptools file in the Tools menu have an extension? If so, is pcptools.rb appropriate? Required? And do I refer to "$$GLOBAL::Workflow Resource Path$$/Tools/pcptools" or "$$GLOBAL::Workflow Resource Path$$/Tools/pcptools.rb" (or something with a different extension)?

Thanks for the help!
Youtube upload from Podcast Producer with pcptools
Authored by: Marcel Borsten on Monday, May 24 2010 @ 06:14 PM CEST

1. Each argument should be on a separate line (I've corrected this error in the article now too)
2. I don't think this message has anything to do with your problem
3. The script does not need an extension, but if you do give it one you should use the full name (inc. extension) in the template.plist file.

Youtube upload from Podcast Producer with pcptools
Authored by: mjfenton on Wednesday, May 26 2010 @ 05:13 AM CEST

I discovered my error. In following the directions to "delete all arguments and then add these..." (under the task "publish-youtube") I considered argument 0 (publish2youtube) one of the strings to be deleted.

By adding that back in, the script now works.

Youtube upload from Podcast Producer with pcptools
Authored by: peter mears on Sunday, May 30 2010 @ 06:37 AM CEST

 Please could you post some screenshots of the process? Especially plist changes. 

Testing my parameters from the Command line Fails! and ideas 

./pcpyt:359: warning: instance variable @auth_token not initialized

warning: peer certificate won't be verified in this SSL session

nil

./pcpyt:315:in `upload': http error code 403 (Exception)

from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/net/http.rb:543:in `start'

from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/net/http.rb:440:in `start'

from ./pcpyt:311:in `upload'

from ./pcpyt:180:in `upload_movie'

from ./pcpyt:153:in `run'

from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `each_with_index'

from ./pcpyt:148:in `each'

from ./pcpyt:148:in `each_with_index'

from ./pcpyt:148:in `run'

from ./pcpyt:529

 

Youtube upload from Podcast Producer with pcptools
Authored by: Marcel Borsten on Sunday, May 30 2010 @ 01:04 PM CEST

 I suggest we move this to the forum and continue there...

Youtube upload from Podcast Producer with pcptools
Authored by: NioThePoet on Wednesday, July 21 2010 @ 06:31 PM CEST

 Anytime I try to run a workflow from the steps you described the workflow fails without giving a specific reason for the error. Could you possibly upload what you have in the "template.plist" file so that I can check what I have against what is the correct version?