clonechat icon indicating copy to clipboard operation
clonechat copied to clipboard

trying again... Due to: Telegram says: [400 MEDIA_CAPTION_TOO_LONG] - The media caption is too long (caused by "messages.SendMedia")

Open yakkobr opened this issue 1 year ago • 4 comments

ao tentar clonar o conteudo de varios grupos ocorre essa mensagem

trying again... Due to: Telegram says: [400 MEDIA_CAPTION_TOO_LONG] - The media caption is too long (caused by "messages.SendMedia")

grupo: Courses - Online

yakkobr avatar Apr 30 '23 18:04 yakkobr

continua sendo um problema para voce?

matheusbach avatar Jun 23 '23 02:06 matheusbach

continua sendo um problema para voce?

Opa, infelizmente sim, tento realizar o clone de alguns grupos e simplesmente trava, desta forma não consigo clonar todos os grupso que preciso.

criei um .sh onde coloco varios clones, então quando da erro em 1 os proximos não são executados.

image

yakkobr avatar Jun 23 '23 13:06 yakkobr

do you still have the problem? .....

I only solve it "quick and dirty for myself"..... i add for every filetype (here as example for type photo):

except Exception as e:
print(f"trying again... Due to: {e}")
tg.send_photo(
              chat_id=destination_chat,
              photo=photo_id,
              caption="",
          )**
        time.sleep(10)

important is: caption=""

timgahmen avatar Feb 17 '24 18:02 timgahmen

def foward_video(message, destination_chat): caption = get_caption(message) video_id = message.video.file_id MAX_CAPTION_LENGTH = 1024 # Limitar el subtítulo a 1024 caracteres

# Verificar si el subtítulo es demasiado largo y acortarlo si es necesario
if len(caption) > MAX_CAPTION_LENGTH:
    caption = caption[:MAX_CAPTION_LENGTH]

try:
    tg.send_video(
        chat_id=destination_chat,
        video=video_id,
        caption=caption,
    )
    return
except FloodWait as e:
    print(f"..FloodWait {e.value} seconds..")
    time.sleep(e.value)
except Exception as e:
    print(f"trying again... Due to: {e}")
    time.sleep(10)

foward_video(message, destination_chat)

TokyoghoulEs avatar Sep 09 '24 10:09 TokyoghoulEs