various code changes from https://github.com/youtube/api-samples/blob/master/python/upload_video.py