rdt-client icon indicating copy to clipboard operation
rdt-client copied to clipboard

Torbox cant download as zip file

Open kvbev opened this issue 1 year ago • 6 comments

What version are you using? 2.0.104 What OS are you running? raspberry pi 4 debian 12 Are you using Docker or as a service? Docker Which debrid provider are you using? torbox Which downloader are you using? internal

since updating to 2.0.104 with Torbox set to download using the zip link all downloads will silently fail between a few 100 mb to a few GB. The displayed download speed will drop to 0 however the progress percentage will keep increasing. If left alone the percentage will also keep increasing above 100%. The client also appears to keep using bandwidth when this happens however nothing, once it fails, will be written to disk.

please revert to just downloading multiple files with torbox as torbox has unreliable infrastructure to begin with and I would not expect it to reliably zip torrents, or at least present an option to disable zip downloading.

to note I watched this happen with 2 torrents that were not cached to start with, idk if their infrastructure may require an additional window to zip torrents however they present the zip link as if they are ready.

I have reverted to 2.0.102 and can now download without issue.

kvbev avatar Apr 13 '25 13:04 kvbev

yall are fast, thank you

kvbev avatar Apr 13 '25 14:04 kvbev

Normally we're not this quick, you happened to time this very well! You posted this issue a few minutes into rogerfar going through all my PRs, and your issue was sufficiently well written and easy to implement a fix for that I managed to get an easy-to-review PR ready before Roger had finished merging everything.

We're still figuring out the automating the release procedure, so this won't be released right away, but it should be released soon. I'll probably make a manual release this evening (I'm in UTC+1) if nothing else.

Cucumberrbob avatar Apr 13 '25 14:04 Cucumberrbob

I’m reopening this because the issue isn’t actually fixed, we’ve just made downloading .zips optional

Cucumberrbob avatar Apr 21 '25 09:04 Cucumberrbob

Some progress: whatever's serving the .zips for TB doesn't respect the Range header, which the internal downloader assumes will be respected. So when the Internal Downloader asks for say 100 bytes starting from the 300th byte of a 500 byte file, TB just sends the entire 500 byte file. So if we tried to download that 500 byte file over 5 100 byte chunks, we'd end up with a 2500 byte file.

I'll make an issue in Downloader.NET about this, because the assumption that all servers will respect the Range header clearly is not true!

It works fine when downloading in only one chunk, which is what happens for small enough torrents.

I've sent a message to TorBox support asking if this is intended behaviour.

❯ curl --location 'https://files.catbox.moe/cplqmb.zip' \
--header 'Range: bytes=1350-1353' -v -o - 2>&1 | grep -i "Content-Length"
< content-length: 4

❯ curl --location 'https://store-005.weur.tb-cdn.st/zip/acb67f89-8982-4754-95c1-ea030b84a643?token=b1229fd9-6c25-43af-8678-f84dc76b9973' \
--header 'Range: bytes=1350-1353' -v -o - 2>&1 | grep -i "Content-Length"
< content-length: 1354

Cucumberrbob avatar Apr 27 '25 12:04 Cucumberrbob

I got a response from the TorBox team. They think it's a better idea for us to use individual download links wherever possible.

They've recommended we use the redirect=true query parameter for our unrestricted download links. Then when the downloads are actually started, TorBox will unrestricted them. And since we already have a bunch of logic for rate limiting downloads, this should be fine. https://github.com/rogerfar/Downloader.NET/issues/9

As for multipart zip downloads, we're out of luck. TorBox zips stuff up on demand. So they don't listen to the Range header - they've got to zip the entire thing so you might as well get the entire thing in response. I think the most sensible way forward is to fix Downloader.NET so it can handle servers which don't listen to the Range header. I'll also make a separate issue for this

Cucumberrbob avatar Apr 27 '25 20:04 Cucumberrbob

Closing as of https://github.com/rogerfar/rdt-client/commit/4801b94c6404784f6a3cd322d153c9b23184dd39 (which is in v2.0.112), which updates the version of Downloader.NET so we don't try to download chunks for TorBox .zip files.

Cucumberrbob avatar May 20 '25 21:05 Cucumberrbob