Avoid running annex.http-headers-command more than once.
This commit is contained in:
parent
98cc34c211
commit
2ec07bc29f
11 changed files with 31 additions and 28 deletions
|
@ -124,8 +124,7 @@ youtubeDlTo key url dest = do
|
|||
-- without it. So, this first downloads part of the content and checks
|
||||
-- if it's a html page; only then is youtube-dl used.
|
||||
htmlOnly :: URLString -> a -> Annex a -> Annex a
|
||||
htmlOnly url fallback a = do
|
||||
uo <- getUrlOptions
|
||||
htmlOnly url fallback a = withUrlOptions $ \uo ->
|
||||
liftIO (downloadPartial url uo htmlPrefixLength) >>= \case
|
||||
Just bs | isHtmlBs bs -> a
|
||||
_ -> return fallback
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue