Improve resuming interrupted download when using yt-dlp or youtube-dl
Fixes a failure like this: curl: (33) HTTP server doesn't seem to support byte ranges. Cannot resume. That happens because the whole web page has already been downloaded previously, and kept, so now addurl tries to download it, and curl asks the server to resume from the last byte. And youtube.com can't, for whatever stupid reason. So, delete the temp file after determining that youtube-dl can be used.
This commit is contained in:
parent
a36a81dea3
commit
958c2fa6d2
2 changed files with 4 additions and 3 deletions
|
@ -343,9 +343,10 @@ downloadWeb addunlockedmatcher o url urlinfo file =
|
|||
-- Ask youtube-dl what filename it will download first,
|
||||
-- so it's only used when the file contains embedded media.
|
||||
tryyoutubedl tmp backend = youtubeDlFileNameHtmlOnly url >>= \case
|
||||
Right mediafile ->
|
||||
Right mediafile -> do
|
||||
liftIO $ liftIO $ removeWhenExistsWith R.removeLink tmp
|
||||
let f = youtubeDlDestFile o file (toRawFilePath mediafile)
|
||||
in lookupKey f >>= \case
|
||||
lookupKey f >>= \case
|
||||
Just k -> alreadyannexed f k
|
||||
Nothing -> dl f
|
||||
Left err -> checkRaw (Just err) o (pure Nothing) (normalfinish tmp backend)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue