Closed fatshotty closed 2 years ago
In the folder _telegramupload search for files.py. Open it in a text editor and modify the line 21 CAPTION_MAX_LENGTH = 200
to a value that suits your needs, then save it.
thanks for reply
I saw the code and I found the solution. However I don't want modify the code. Is it possibile add a cli-argument to set the caption_chars_length?
thanks
I don't think is possible, I don't see anything in the documentation. It's up to @Nekmo to implement such a feature. By the way, how is your upload speed when using the script? In my case doesn't seem to pass the 1.5 MB/s (12 Mb/s), even if my connection supports more than that.
speed is the same of yours on my side. However, telegram supports 4000chars in caption, I think.
Maybe should I fork and push a pull-request? Hope @Nekmo can have a look into that :)
Thanks
Thanks for the answer, I hope that @Nekmo improves the upload speed in the next versions. Regarding the captions, the limit is 1024 characters, messages have a 4096 chars limit. See this. You could do a pull request.
thanks for reply.
I send a pull request setting caption_length to 2000. Wait to talk with Nekmo and you to set the correct value :)
Is too much, TG won't allow it. The max length for captions is 1024. See line 44 from TG source. I run tests with values of more than 1024 and is not working. I get an error "The caption is too long".
ok, I'm going to change the value and make a new pullrequest ;)
Hi, i've fixed the caption_chars_length set to 1024 thanks
Fixed!
pip freeze
): cffi==1.14.6 click==8.0.1 cryptg==0.2.post4 hachoir==3.1.2 pyaes==1.6.1 pyasn1==0.4.8 pycparser==2.20 rsa==4.7.2 telegram-upload==0.4.0 Telethon==1.23.0Description
I'm trying to upload file with a caption and thumbnail. Everything works fine, but caption is truncated to 200chars
What I Did
Caption of the uploaded file is truncated to 200chars. Telegram allows 2-4000chars instead
is it possibile to add
caption_chars_length
to command-line arguments, in order to customize the caption length?thanks in advance