Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Telegram premium #159

Closed
tapatianbeast opened this issue Jun 8, 2022 · 17 comments
Closed

Telegram premium #159

tapatianbeast opened this issue Jun 8, 2022 · 17 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@tapatianbeast
Copy link

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

@simonlkch
Copy link

simonlkch commented Jun 21, 2022

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

@xd003
Copy link

xd003 commented Jun 24, 2022

@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 ?

@simonlkch
Copy link

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

@simonlkch
Copy link

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

@xd003
Copy link

xd003 commented Jun 24, 2022

@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 )

@simonlkch
Copy link

simonlkch commented Jun 24, 2022

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

@xd003
Copy link

xd003 commented Jun 25, 2022

@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"

@simonlkch
Copy link

never say never, you can modify and try it

@xd003
Copy link

xd003 commented Jun 26, 2022

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

@tapatianbeast
Copy link
Author

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

@xd003
Copy link

xd003 commented Jun 26, 2022

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

ID works so using that , dunno about invite url

@simonlkch
Copy link

@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?

@xd003
Copy link

xd003 commented Jun 28, 2022

Thats means install yoru version of the module?

yes

@tapatianbeast
Copy link
Author

Thats means install yoru version of the module?

yes

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

@Nideapum
Copy link

Nideapum commented Dec 4, 2022

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.

@santosadrian
Copy link

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

@Nekmo Nekmo self-assigned this Apr 7, 2023
@Nekmo Nekmo added this to the v0.7.0 milestone Jun 15, 2023
@Nekmo Nekmo added the enhancement New feature or request label Jun 15, 2023
Nekmo added a commit that referenced this issue Jun 22, 2023
Nekmo added a commit that referenced this issue Jun 22, 2023
Nekmo added a commit that referenced this issue Jun 23, 2023
Nekmo added a commit that referenced this issue Jun 24, 2023
Nekmo added a commit that referenced this issue Jun 24, 2023
Nekmo added a commit that referenced this issue Jun 27, 2023
@Nekmo Nekmo closed this as completed Jun 28, 2023
@Nekmo
Copy link
Owner

Nekmo commented Jun 28, 2023

Fixed in version v0.7.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

6 participants