gpt4 book ai didi

python-2.7 - 如何通过http发送srt文件

转载 作者:行者123 更新时间:2023-12-04 18:03:21 25 4
gpt4 key购买 nike

我可以通过他们的 Graph API 将视频上传到 Facebook,但无法为这些视频上传字幕 (cc)。根据他们的 documentation 在上传视频字幕时,仅需提供视频 ID、语言环境和 srt 文件名。但是,在发布请求时

r = requests.post("https://graph.facebook.com/v" + str(self.version) + "/" + path + "?" +
post_data, files={captions_file: open(captions_file, 'rb')})

这是结果:

{"error":{"message":"(#100) Invalid file. Expected file of one of the following types:
application\/octet-stream","type":"OAuthException","code":100}}

我的困惑是文档将字幕文件指定为 filename.locale.srt,但错误指定了一个 MIME 类型 application/octet-stream 的文件,而 .srt 文件不适用。

如何通过 application/octet-stream 发送 .srt 文件?

最佳答案

我试图为 Facebook 视频上传字幕,但我遇到的唯一错误是“(#100) 无效文件。预期文件属于以下类型之一:应用程序/八位字节流”。

所以我在 facebook 上写了一张票,看起来这是一个有效的错误。

I'm trying to add captions to video, but the only error I'm getting is "Invalid file. Expected file of one of the following types: application/octet-stream"

The file that I'm using is http://www.apps.bg/filename.bg_BG.srt

Steps to reproduce the bug: 1. Trying to upload captions from api ( /v2.4/video_id/captions )

我得到的答案是

"We have managed to reproduce this issue and it appears to be a valid bug. We are assigning this to the appropriate team."

https://developers.facebook.com/bugs/1470577926590877

所以我们必须等待修复它 - 或者如果有人找到解决方法。希望对您有所帮助。

关于python-2.7 - 如何通过http发送srt文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31416760/

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