diff options
Diffstat (limited to 'Annex/YoutubeDl.hs')
-rw-r--r-- | Annex/YoutubeDl.hs | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/Annex/YoutubeDl.hs b/Annex/YoutubeDl.hs index d1cac9368..43e63dfd6 100644 --- a/Annex/YoutubeDl.hs +++ b/Annex/YoutubeDl.hs @@ -11,6 +11,7 @@ module Annex.YoutubeDl ( youtubeDlSupported, youtubeDlCheck, youtubeDlFileName, + youtubeDlFileName', ) where import Annex.Common @@ -144,7 +145,16 @@ youtubeDlCheck url youtubeDlFileName :: URLString -> Annex (Either String FilePath) youtubeDlFileName url | supportedScheme url = flip catchIO (pure . Left . show) $ - htmlOnly url nomedia go + htmlOnly url nomedia (youtubeDlFileName' url) + | otherwise = return nomedia + where + nomedia = Left "no media in url" + +-- Does not check if the url contains htmlOnly; use when that's already +-- been verified. +youtubeDlFileName' :: URLString -> Annex (Either String FilePath) +youtubeDlFileName' url + | supportedScheme url = flip catchIO (pure . Left . show) go | otherwise = return nomedia where go = do |