将 MP4 视频发布到 Instagram 始终返回错误代码 2207026
我使用 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我要发布的视频的纵横比是多少?
当我尝试发布
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 above1.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.