Instead of rewriting the upload tool all over again. I think it makes more sense to reuse the youtube_uploader that exists in freeseer:

    https://github.com/Freeseer/freeseer/tree/experimental/src/freeseer/tools/youtube_uploader

The existing uploader also takes into account the metadata inside the files. Importing the function <b>uploadToYouTube</b> will be helpful to you.