This provides an interface for uploading assets and XML to YouTube <http://www.youtube.com>. In addition to basic delivery this script also facilitates status checks on the encoding process once uploaded. When uploaded YouTube will processes the media and XML, and then generates an XML report as to the status of the import. In order to ensure a successful upload, we perform checks on this file to ensure that if it failed, we properly report the status. To do so, YouTubeObject provides two additional methods, YouTubeObject.batchStatusCheck() and YouTubeObject.checkYouTubeXMLStatusFile(). The former method actually utilizes the latter, so ‘checkYouTubeXMLStatusFile‘ will rarely be need to be called directly.
A batch status check can be performed by running the command:
>>> transmogrifier.py -m YouTube -a batchstatuscheck
Checks on the status of any inprogress batches, as indicated by the presence of *.xml files in the inprogress folder residing in our YouTube support folder.
import YouTube XML status file, verify that our publishing worked
Load from configuration file, expects a ConfigParser type object. If you subclass, you should call this function. If we return false then you should abort. or do your own sanity checks
Uploads all relative assets to the configured SFTP host via the member variable ytSFTPServer. This is achived by creating an SFTP batch file and then passing to the sftp system binary. This method will also call youtube.YouTubeObject.xmlOut() and will upload the resulting XML file. We will attempt the SFTP transfer as defined by our retryCount configuration variable.
The YouTube module has a number of configuration options that will define it’s behavior. The YouTube module will inherent the same configuration file that transmogrifier.py is provided at runtime; by default this file is located at /usr/local/etc/transmogrifier.conf. This file can be usurped with a separate configuration file by providing transmogrifier.py with the --configFile= parameter.
Options utilized by the YouTube module are designated under the [YouTube] config section, as seen in the transmogrifier.conf file shown below:
[YouTube]
host=sftp.myco.youtube.com
username=demo
ownername=AwesomeDemo
retryCount=5
publisherid=10001
For more information about working with Transmogrifier modules, click here