telegram-upload icon indicating copy to clipboard operation
telegram-upload copied to clipboard

Telegram premium

Open tapatianbeast opened this issue 2 years ago • 14 comments

What do you know about telegram premium and his 4gb file size?

tapatianbeast avatar Jun 08 '22 00:06 tapatianbeast

today, telegram have already release the premium function.

This change is necessary to support 4GB files uploaded by premium accounts. Basiclly, premium accounts have x2 quota to compare the free account such as MAX_FILE_SIZE and CAPTION_MAX_LENGTH become 4GB and 2048

According tg doc, User class have add one more parameter, is_premium True Optional. True, if this user is a Telegram Premium user

ref: https://core.telegram.org/bots/api#user

simonlkch avatar Jun 21 '22 12:06 simonlkch

@simonlkch To get the premium upload working with increased limits , we just change the MAX_FILE_SIZE & CAPTION_MAX_LENGTH in files.py here or need to do some other changes as well ?

xd003 avatar Jun 24 '22 11:06 xd003

i dont know how to debug the code. but the concept is right. one more step for checking the user is_premium flag.

simonlkch avatar Jun 24 '22 14:06 simonlkch

image

I check the source code, this project is using telethon, in telethon documention, The User Class don't have the is_premium flag. Maybe need telethon to update their library first.

https://docs.telethon.dev/en/stable/quick-references/client-reference.html#users

simonlkch avatar Jun 24 '22 15:06 simonlkch

@simonlkch thanks for info Picsart_22-06-24_22-12-19-890

I found this on a channel , so going by this if the is_premium flag is only for indentification by bots . It shouldn't really affect us in the uploads i guess ? ( Just guessing i could be very well wrong )

xd003 avatar Jun 24 '22 16:06 xd003

just test it, telethon have set the file size limit, so need wait telethon to upgrade

https://github.com/LonamiWebs/Telethon/blob/dd51aea4db90fd255a14e27192e221c70b45e105/telethon/_misc/utils.py#L1057

simonlkch avatar Jun 24 '22 17:06 simonlkch

@simonlkch Can't we just easily fork & edit that condition & then install our own version of telethon ?

pip3 install -U https://github.com/$username/telethon/archive/master.zip

Also on being asked that the premium flag is missing in telethon official group , they replied this - "because premium is implemented in a layer newer than the layer the docs are written for"

xd003 avatar Jun 25 '22 03:06 xd003

never say never, you can modify and try it

simonlkch avatar Jun 25 '22 14:06 simonlkch

never say never, you can modify and try it

Yes indeed , thanks to all people who helped me, it should be working fine now in my fork , here it is if you need - pip install https://github.com/xd003/tg/archive/master.zip

Just make sure to uninstall telethon before installing

xd003 avatar Jun 26 '22 04:06 xd003

This is safe? Do you fix the new format of url private channels/groups error?

tapatianbeast avatar Jun 26 '22 04:06 tapatianbeast

This is safe? Do you fix the new format of url private channels/groups error?

ID works so using that , dunno about invite url

xd003 avatar Jun 26 '22 05:06 xd003

@simonlkch Can't we just easily fork & edit that condition & then install our own version of telethon ?

pip3 install -U https://github.com/$username/telethon/archive/master.zip

Also on being asked that the premium flag is missing in telethon official group , they replied this - "because premium is implemented in a layer newer than the layer the docs are written for"

Thats means install yoru version of the module?

simonlkch avatar Jun 28 '22 12:06 simonlkch

Thats means install yoru version of the module?

yes

xd003 avatar Jun 28 '22 12:06 xd003

Thats means install yoru version of the module?

yes

It didn't work for me, I hope Neko updates the official version

tapatianbeast avatar Jul 01 '22 19:07 tapatianbeast

never say never, you can modify and try it

Yes indeed , thanks to all people who helped me, it should be working fine now in my fork , here it is if you need - pip install https://github.com/xd003/tg/archive/master.zip

Just make sure to uninstall telethon before installing

Thanks, It works for me.

Nideapum avatar Dec 04 '22 10:12 Nideapum

Thank you very much, now I can upload files up to 4GB. TY sir.

santosadrian avatar Apr 06 '23 11:04 santosadrian

Fixed in version v0.7.0.

Nekmo avatar Jun 28 '23 00:06 Nekmo