subzeroid / instagrapi

🔥 The fastest and powerful Python library for Instagram Private API 2024
https://hikerapi.com/p/bkXQlaVe
MIT License
4.38k stars 686 forks source link

[BUG] instagrapi.exceptions.UnknownError: server processing error: VideoSourceVideoStreamCheckException #770

Closed Jackhammer9 closed 2 years ago

Jackhammer9 commented 2 years ago

Describe the bug Every time i try to upload a video i get the following error: instagrapi.exceptions.UnknownError: server processing error: VideoSourceVideoStreamCheckException I tried Uploading from Different Accounts and I tried uploading Different Media still No resolution

To Reproduce

from instagrapi import Client

c = Client()
c.login("user id","passwd")

c.video_upload("D:/Videos/2022-04-06_11-52-02.mp4", "test")

Traceback

Traceback (most recent call last):
  File "D:\python\test.py", line 6, in <module>
    c.video_upload("D:/Videos/2022-04-06_11-52-02.mp4", "test")
  File "D:\Python 3.10.2\lib\site-packages\instagrapi\mixins\video.py", line 290, in video_upload
    raise e
  File "D:\Python 3.10.2\lib\site-packages\instagrapi\mixins\video.py", line 271, in video_upload
    configured = self.video_configure(
  File "D:\Python 3.10.2\lib\site-packages\instagrapi\mixins\video.py", line 365, in video_configure
    return self.private_request(
  File "D:\Python 3.10.2\lib\site-packages\instagrapi\mixins\private.py", line 445, in private_request
    raise e
  File "D:\Python 3.10.2\lib\site-packages\instagrapi\mixins\private.py", line 432, in private_request
    self._send_private_request(endpoint, **kwargs)
  File "D:\Python 3.10.2\lib\site-packages\instagrapi\mixins\private.py", line 354, in _send_private_request
    raise UnknownError(**last_json)
instagrapi.exceptions.UnknownError: server processing error: VideoSourceVideoStreamCheckException

Expected behavior The video gets uploaded to instagram

Desktop (please complete the following information):

stramanu commented 2 years ago

the same to me too..

adw0rd commented 2 years ago

Perhaps your video is not suitable for Instagram format. Download any video from instagram and see what format it is, convert your video to this format and you will be successful

Related #393

stramanu commented 2 years ago

I think I understand what the problem is (in my case). It is not about the format. I realized that Instagram blocked me temporarily. In fact, I can no longer do any action. it is strange, also because I have not done any strange or too fast operations, such as bots. I don't know...

Jackhammer9 commented 2 years ago

Well this is weird I downloaded a video from Instagram directly and I tried uploading it directly It did get uploaded first time but on a second run with same video it threw the same error. I don't think my account is restricted from uploading as I am able to upload videos manually

stramanu commented 2 years ago

@adw0rd do you have an example of the ffmpeg command to correctly convert a video for instagram?

adw0rd commented 2 years ago

@adw0rd do you have an example of the ffmpeg command to correctly convert a video for instagram?

No

stramanu commented 2 years ago

ok, I have found the solution to my case. It is precisely about the format of the video. At this link you will find the prerequisites for the video format: https://docs.ayrshare.com/additional-info/image-and-video-requirements#video-2

Here is the ffmpeg command I use to convert my videos: ffmpeg -y -i "input.mp4" -t 00:00:50 -vf "scale=1080:700:force_original_aspect_ratio=decrease,pad=1080:700:-1:-1:color=black" -r 25 -c:v h264 -crf 18 -c:a aac -b:a 128k -ac 2 -ar 44100 -pix_fmt yuv420p -max_muxing_queue_size 1024 -preset ultrafast "output.mp4"

Jackhammer9 commented 2 years ago

@stramanu that helps a lot thanks!

closing this issue