aboutsummaryrefslogtreecommitdiff
path: root/Annex/YoutubeDl.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2017-11-30 13:45:43 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2017-11-30 14:13:20 -0400
commit7a8d7ba5ef558f3038ee5ee06e92e5f5e8df1ec5 (patch)
tree3a2482329870e768f4f92240ae14d61c7768bd0d /Annex/YoutubeDl.hs
parent51ab2efc693983dcca6d79b531339b00e23fa871 (diff)
rethought --relaxed change
Better to make it not be surprising and slow, than surprising and fast. --raw can be used when it needs to be really fast. Implemented adding a youtube-dl supported url to an existing file. This commit was sponsored by andrea rota.
Diffstat (limited to 'Annex/YoutubeDl.hs')
-rw-r--r--Annex/YoutubeDl.hs14
1 files changed, 6 insertions, 8 deletions
diff --git a/Annex/YoutubeDl.hs b/Annex/YoutubeDl.hs
index 1eafa4173..4e33c2ff3 100644
--- a/Annex/YoutubeDl.hs
+++ b/Annex/YoutubeDl.hs
@@ -71,14 +71,12 @@ youtubeDlTo key url dest = do
case dl of
Right (Just mediafile) -> do
liftIO $ renameFile mediafile dest
- return (Right True)
- Right Nothing -> return (Right False)
- Left msg -> return (Left msg)
- case res of
- Left msg -> do
- warning msg
- return False
- Right r -> return r
+ return (Just True)
+ Right Nothing -> return (Just False)
+ Left msg -> do
+ warning msg
+ return Nothing
+ return (fromMaybe False res)
youtubeDlSupported :: URLString -> Annex Bool
youtubeDlSupported url = either (const False) id <$> youtubeDlCheck url