mirror of
https://github.com/dutchcoders/transfer.sh.git
synced 2026-02-03 06:03:25 +00:00
How can I resume downloads? #106
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @mptnan on GitHub.
I'm downloading from transfer.sh url like wget -c "https://transfer.sh/..." but in the middle way an error occurs stating that "...バイトで読み込みエラーが発生しました (Operation timed out)。 再試行しています。".
Then it restarts downloading but from the scratch (progress bar starts from 0%). I read this https://github.com/dutchcoders/transfer.sh/issues/289 but didn't get the solution.
@mptnan commented on GitHub:
Sorry but I'm always putting "wget -c url" and what's wrong with that
@paolafrancesca commented on GitHub:
hello @niss88
after some tests I can confirm that the code handles download resume on video and audio file (we could change for every file type, but that's no related to your problem)
failure on download resume at https://transfer.sh could be due to a proxy that doesn't forward the range header (it was indeed the same on my private instance): @stefanbenten , can you validate this assumption?
do you have a proxy in front of the service?
in case of nginx I had to add the
proxy_pass_request_headers on;directive, btw@paolafrancesca commented on GitHub:
from wget documentation
@mptnan commented on GitHub:
My downloading file was a video... but I'll wait either way.
For testing I uploaded mp4 file for example https://transfer.sh/KnDl1c/out3.mp4 (~1 MB), tested like below and --continue (-c) didn't work for mp4 file
@paolafrancesca commented on GitHub:
I'm sorry @niss88, you are right
range donwload works only for video and audio file: https://github.com/dutchcoders/transfer.sh/blob/main/server/handlers.go#L1054
I will fix as soon as I have time
@paolafrancesca commented on GitHub:
@stefanbenten
taking @niss88 upload (https://transfer.sh/KnDl1c/out3.mp4), seeking does not work on the video player, that should be related to the
rangeheader@ErrorNoInternet commented on GitHub:
This is also affecting parallel download tools (tools that connect to the server multiple times and download segments of the file in each thread). It makes a
HEADrequest to see if the server gives theAccept-Ranges: bytesheader, and then sends a GET request containing theRange: bytes=0-Nheader to download the first N bytes.@paolafrancesca commented on GitHub:
filtering out
rangeheader to the transfer.sh service will also break seeking feature on the audio/video preview page@stefanbenten commented on GitHub:
transfer.sh is currently running with nginx in front and the correct proxy pass directive added. That said, it has a timeout at 1800s per request, due to the fact that there have been HTTP slow attacks in the past.
@stefanbenten commented on GitHub:
I think i have an idea why it is not working correctly. Lemme debug the code (because the proxy forwards it correctly) and put up a PR.
@paolafrancesca commented on GitHub:
@ErrorNoInternet did you hit this issue with
transfer.sh, intended as software, or on https://transfer.sh website?can you tell me one of the parallel download tools that are affected?
I will check if everything is fine on the
transfer.shside.For sure
Range: bytes=requests are currently supported only for video and audio content type. We can widen support for every file.@paolafrancesca commented on GitHub:
HEADrequests do not returnAccept-Ranges: bytes, I will fix that, as well of allowing partial download for every file typethis is related to the support on
transfer.shintended as software.hosted instances like https://transfer.sh, might or might nor support this according to the presence of a proxy and its setup
@paolafrancesca commented on GitHub:
indeed it's a rather tricky: we have a mutex on
checkMetadata(35e794220b/server/handlers.go (L689-L690)) in order to track theMaxDownloadsand update themparallel range requests will be handled sequentially anyway because of the mutex.
I cannot see an easy way to get rid of the mutex: just skipping it in case of range requests will be prone to abuse (I do an
HEADand just make a range one with a full range but one byte)keeping track of all the requested ranges to understand when a full donwload happened is a no way to go, since there are a lot of cases where range requests are not a parallel download (seeking in a multimedia content for example)
skipping the lock if the upload doesn't contain
MaxDownloadsis troublesome as well: since we'll know that after checking the metadata, but if it was the case we should have acquired the lock. I will see if I can move the lock before updating theDownloadscounter (we have to re-check the metadata just before indeed because of race conditions).I have to find a way where this is producing all the required goals:
MaxDownloadsDownloadsin metadata without race conditionsMaxDownloadsis set allow for parallel downloads@ErrorNoInternet commented on GitHub:
@aspacca
The https://transfer.sh website
Some examples are Paralload (my own tool), Chrome (it has a multi-threaded download feature), chunked-downloader, and a few more small tools.
My ISP throttles download speeds (sometimes down to 20 KB/s) for foreign sites, so I rely on these tools to download files faster.
@paolafrancesca commented on GitHub:
@ErrorNoInternet here: https://github.com/dutchcoders/transfer.sh/pull/495
@paolafrancesca commented on GitHub:
@niss88 allowing parallel range request showed to be more complicated than I initially thought, especially regarding performance impact.
I will reserve to go back to the issue once I'll have more time for it