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

Clarification question about download speed before starting to contribute #110

Open
RoyZhang7 opened this issue Feb 17, 2025 · 1 comment

Comments

@RoyZhang7
Copy link

Hi dev,

I just started to use this script today and found everything is pretty good except download speed. I'm happy to improve this part and submit PR after this conceptual san-check.

After taking a quick look into implementation, I found that the script curls each packet whose size is decided by Telegram server, like every fetchNextPart. So, I wonder if it's possible & safe to request larger chunk size per packet to speed up download?

Also, sometimes, web Telegram crashes after a few download attempts. Is it also relevant to script? It seems not, but I'm not sure.

@Neet-Nestor
Copy link
Owner

Hi @RoyZhang7 ,

Thank you for the interest of contributing. The idea of the script was actually very simple that we are basically simulating the video streaming process of the webapp. We request the video data using HLS protocol just like how the Telegram webapp does it while user playing the videos, then use script to concatenate the data and save it locally.

You are right that the package size is decided by the serve this way. As a result, the download speed is limited and we got issues with large files and sometimes the server rejects the requests with 404 for unknown reasons.

To be honest, I do not know whether requesting larger package size will cause any issue or is there a better approach or APIs we can use. It will be great if you want to experiment and let me know your findings.

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

No branches or pull requests

2 participants