def post_videos(self, paths, category, title=None, desc=None, tags=None,
                    devtags=None, is_private=None):
        from gdata.media import Group, Title, Description, Keywords, Private
        if isinstance(paths, basestring):
            paths = [paths]
        set_private = lambda private: Private() if private else None
        for path in paths:
            filename = os.path.basename(path).split('.')[0]
            my_media_group = Group(title=Title(text=title or filename),
                                   description=Description(
                                       text=desc or 'A video'),
                                   keywords=Keywords(text=tags),
                                   category=build_category(category),
                                   private=set_private(is_private))

            video_entry = gdata.youtube.YouTubeVideoEntry(media=my_media_group)
            if devtags:
                taglist = devtags.replace(', ', ',')
                taglist = taglist.split(',')
                video_entry.AddDeveloperTags(taglist)
            LOG.info(safe_encode('Loading ' + path))
            try:
                entry = self.InsertVideoEntry(video_entry, path)
            except gdata.service.RequestError, err:
                LOG.error('Failed to upload video: %s' % err)
            except gdata.youtube.service.YouTubeError, err:
                err_str = str(err)
                if err_str.find('path name or a file-like object') != -1:
                    err_str = safe_encode('Could not find file ' + path)
                if (err.args[0]['body'].find('invalid_value') != -1 and
                        err.args[0]['body'].find('media:category') != -1):
                    err_str = 'Invalid category: %s' % category
                    err_str += ('\nFor a list of valid categories, see '
                                'http://code.google.com/p/googlecl/wiki/Manual#YouTube')
                LOG.error(err_str)
            else:
                LOG.info('Video uploaded: %s' % entry.GetHtmlLink().href)
Post video(s) to YouTube.
dataset/ETHPy150Open vinitkumar/googlecl/src/googlecl/youtube/service.py/YouTubeServiceCL.post_videos