|
Hi everyone, I’m having an issue with the send_video() function. Occasionally, it works, but most of the time, it throws a Timeout Error (see attached screenshot). It’s not a network issue on my end, as my connection is stable. Any ideas on what could be causing this? Here’s the code I’m using: from atproto import Client, models
import os
import time
def main() -> None:
client = Client()
client.login(os.environ['BSKY_USERNAME'], os.environ['BSKY_PASSWORD'])
# replace the path to your video file
with open('./data/new_video.mp4', 'rb') as f:
vid_data = f.read()
root_post_ref = models.create_strong_ref(client.send_video(text='Video posted via send_video() without token', video=vid_data, video_alt='Video posted via send_video - test_game01.mp4'))
vid_data=None
time.sleep(60)
# Reply to the root post. We need to pass ReplyRef with root and parent
# replace the path to your video file
with open('./data/test_game01.mp4', 'rb') as f:
vid_data = f.read()
reply_to_root = models.create_strong_ref(
client.send_video(
text='Reply to the root post via send_post()',
video=vid_data,
reply_to=models.AppBskyFeedPost.ReplyRef(parent=root_post_ref, root=root_post_ref),
)
)
main() |
Answered by
MarshalX
Nov 17, 2024
Replies: 1 comment 10 replies
|
Could this issue be related to the audio codec? I've tried posting the two videos separately. The version that works (test_game01.mp4) uses the AAC audio codec, while the one that throws the error (new_video.mp4) uses MPEG Audio layer 1/2 (mpga). After converting new_video.mp4 to AAC, the error disappeared. Both are using H264 for video. I'll run a few more tests to confirm- |
10 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment



Hi, try to just increase timeout. There is not option in
send_videofor it, but you can use upload blob directly and pass own timeout!Pseudo code (not ready to copy and paste):