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

downloadFile, offset and limit problem #3262

Open
dev4ever888 opened this issue Mar 2, 2025 · 1 comment
Open

downloadFile, offset and limit problem #3262

dev4ever888 opened this issue Mar 2, 2025 · 1 comment

Comments

@dev4ever888
Copy link

Hello,

I've been testing the functionality of tdLib on nodejs with tdl for a few days now.
But for a few days now I've been having trouble with the downloadFile method.
There's something I don't understand about this method.

I do a first download with an offset that starts at 0 and I limit it to 4,000,000, so 4mo.
For the second download, I change the offset to 4,000,000 and set the limit to 0 to take the rest of the video.
For the first part, no playback problems because I had put the vital playback files at the beginning of the video.
In the second video, however, the entire beginning is empty by the length of the first video.

Why does it behave like this when downloaded with offset? Has anyone managed to put two parts back together and make it viewable?

I'm very interested, I've learned a lot in the last few days about ffmpeg and all that revolves around it, but I must admit that I'm stumped ;)

@levlam
Copy link
Contributor

levlam commented Mar 3, 2025

Both downloaded parts are stored within the same file. TDLib provides local.downloadedPrefixSize with the number of available to use bytes from the offset and the method getFileDownloadedPrefixSize to get the number of bytes from an arbitrary position.

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