gpt4 book ai didi

python - 如何使用 gdata.youtube api 直接方法插入大于 1MB 的视频

转载 作者:太空宇宙 更新时间:2023-11-04 06:39:38 25 4
gpt4 key购买 nike

我正在使用 gdata.youtube 服务插入视频条目。它因 url 提取错误而失败,提示文件太大。这是一个非常小的视频 (1.7MB)。在理想情况下,有一种自然的方式可以根据需要分解文件并将其分块流式传输。是否已经有一个 API 可以执行此操作。

这是我根据 google 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.

最佳答案

Url fetch 的请求大小限制为 1 兆字节。检查appengine docs配额和其他限制

关于python - 如何使用 gdata.youtube api 直接方法插入大于 1MB 的视频,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2608712/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com