2010-04-09 82 views
2

我正在使用gdata.youtube服务插入视频条目。这是错误的URL提取错误,抱怨文件太大。这是一个非常小的视频(1.7MB)。在理想的世界中,有一种自然的方式可以根据需要分割文件并以大块的形式进行流式处理。是否有一个API可以做到这一点。如何使用gdata.youtube API直接插入大于1MB的视频

这里是我使用基于谷歌API教程中的代码:

my_media_group = gdata.media.Group(
     title=gdata.media.Title(text='My Test Movie'), 
     description=gdata.media.Description(description_type='plain', 
            text='My description'), 
     keywords=gdata.media.Keywords(text='cars, funny'), 
     category=[gdata.media.Category(text='Autos', scheme='http://gdata.youtube.com/schemas/2007/categories.cat', label='Autos')], 
     player=None 
     ) 

    where = gdata.geo.Where() 
    where.set_location((37.0,-122.0)) 

    # create the gdata.youtube.YouTubeVideoEntry to be uploaded 
    video_entry = gdata.youtube.YouTubeVideoEntry(media=my_media_group, 
              geo=where) 

    new_entry = self.client.InsertVideoEntry(video_entry, 'movie.mov') 

这里是错误:

RequestTooLargeError: The request to API call urlfetch.Fetch() was too large. 

回答