cquest / tootbot

python bot to clone tweets to a mastodon account
GNU Affero General Public License v3.0
101 stars 35 forks source link

Uploading error of video included in tweet #18

Closed tanisou closed 1 year ago

tanisou commented 1 year ago

Occurred below error while copy tweets included video to mastodon instance. I tried other tweets included video from other users, but it was occurred same error.


nogizaka46
---------------------------
99
lien: https://t.co/lqj7vyV93F
video: https://twitter.com/nogizaka46/status/1594685061630074881/video/1
[twitter] 1594685061630074881: Downloading guest token
[twitter] 1594685061630074881: Downloading JSON metadata
[twitter] 1594685061630074881: Downloading m3u8 information
[info] 1594685019657682944: Downloading 1 format(s): http-2176
[download] Destination: out.mp4
[download] 100% of    4.04MiB in 00:00:00 at 8.77MiB/s
[VideoConvertor] Not converting media file "out.mp4"; already is in target format mp4
received
posted
Traceback (most recent call last):
  File "tootbot.py", line 257, in <module>
    toot = mastodon_api.status_post(c,
  File "/home/user_name/.local/lib/python3.8/site-packages/decorator.py", line 232, in fun
    return caller(func, *(extras + args), **kw)
  File "/home/user_name/.local/lib/python3.8/site-packages/mastodon/Mastodon.py", line 117, in wrapper
    return function(self, *args, **kwargs)
  File "/home/user_name/.local/lib/python3.8/site-packages/mastodon/Mastodon.py", line 1972, in status_post
    return self.__status_internal( 
  File "/home/user_name/.local/lib/python3.8/site-packages/mastodon/Mastodon.py", line 1907, in __status_internal
    return self.__api_request('POST', '/api/v1/statuses', params, headers=headers, use_json=use_json)
  File "/home/user_name/.local/lib/python3.8/site-packages/mastodon/Mastodon.py", line 3792, in __api_request
    raise ex_type('Mastodon API returned error', response_object.status_code, response_object.reason, error_msg)
mastodon.Mastodon.MastodonAPIError: ('Mastodon API returned error', 422, 'Unprocessable Entity', 'ファイルのアップロードに失敗しました。しばらくしてからもう一度お試しください!')
osauzet commented 1 year ago

I have the same error...

cquest commented 1 year ago

Fixed by https://github.com/cquest/tootbot/commit/35bc4aeb4f83954a77e4a359bc960566e656fc7f

Mastodon processes the video and this sometime need some delay between uploading the video and posting the toot.