Youtube upload from Podcast Producer with 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.