将 MP4 视频发布到 Instagram 始终返回错误代码 2207026

发布于 2025-01-19 13:11:22 字数 1250 浏览 2 评论 0原文

我使用 Facebook Graph API 进行内容发布并使用以下代码将 MP4 视频发布到 Instagram,但大多数时候我在检查视频状态时都会收到 2207026 错误。

代码如下:

let mediaContainerUrl = `https://graph.facebook.com/${igUserId}/media`;
let videoURL = `URL Of MP4 Video Hosted on Firebase Storage`;
let containerParams = new URLSearchParams();
containerParams.append('caption', body);
containerParams.append('video_url', videoURL);
containerParams.append('access_token', targetAccessToken);
let mediaContainerResponse = await axios.post(mediaContainerUrl, containerParams);
let { id: mediaContainerId } = mediaContainerResponse.data; //Upload is done here
                            

我现在使用以下代码检查了上传视频的状态:

let mediaContainerStatusEndpoint = `https://graph.facebook.com/${mediaContainerId}?fields=status_code,status&access_token=${targetAccessToken}`;
let { data: mediaContainerStatus } = await axios.get(mediaContainerStatusEndpoint);
let { status_code, status } = mediaContainerStatus; //Unfortunately, status is most times coming back as `2207026` even for valid videos

那么,我不断取回状态代码 2207026 是否有原因?因为状态码2207026表示视频格式无效。但视频格式对我来说似乎有效。

请注意,该视频是 MP4,且时长也低于 60 秒。

对此的任何想法将不胜感激。

谢谢

I posted an MP4 Video to instagram using the Facebook Graph API for Content Publishing with the below code, but for most of the time I'm getting back the error occurred 2207026 while checking the status of the video.

The code is below:

let mediaContainerUrl = `https://graph.facebook.com/${igUserId}/media`;
let videoURL = `URL Of MP4 Video Hosted on Firebase Storage`;
let containerParams = new URLSearchParams();
containerParams.append('caption', body);
containerParams.append('video_url', videoURL);
containerParams.append('access_token', targetAccessToken);
let mediaContainerResponse = await axios.post(mediaContainerUrl, containerParams);
let { id: mediaContainerId } = mediaContainerResponse.data; //Upload is done here
                            

I now checked the status of the uploaded video using the below code:

let mediaContainerStatusEndpoint = `https://graph.facebook.com/${mediaContainerId}?fields=status_code,status&access_token=${targetAccessToken}`;
let { data: mediaContainerStatus } = await axios.get(mediaContainerStatusEndpoint);
let { status_code, status } = mediaContainerStatus; //Unfortunately, status is most times coming back as `2207026` even for valid videos

So, is there a reason I keep getting back the status code 2207026? Because status code 2207026 means invalid video format. But the video format seems valid to me

Please note that the video is an MP4 and also under 60seconds.

Any ideas on this would be greatly appreciated.

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

娇妻 2025-01-26 13:11:22

我要发布的视频的纵横比是多少?

当我尝试发布1024x490视频> 1.91/1 <时, 我遇到了相同的错误/代码>(最大)纵横比。

在编写此答案的那一刻,Instagram允许在4:5-1.91:1范围内的长宽比

参见: https://develovelers.facebook.com/docs/instagram-api/reference/reference/ig--user/media/media/

** *较晚的答案,但可能对他人有帮助。

What is the aspect ratio of the video you're trying to post?

I got the same error when I tried posting 1024x490 video which is above 1.91/1 (max) aspect ratio.

Instagram, at the moment of writing this answer, allows aspect ratio within a range of 4:5 - 1.91:1

See: https://developers.facebook.com/docs/instagram-api/reference/ig-user/media/

***Late answer but might be helpful to others.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文