pass git config options to youtube-dl --simulate

Decided not to --ignore-config by default. It the user has something in
their youtube-dl config files that breaks git-annex they can configure
it to use that option.
This commit is contained in:
Joey Hess 2017-11-29 20:07:03 -04:00
parent 24f27ec39d
commit 31b4d7c6d0
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
2 changed files with 7 additions and 8 deletions

View file

@ -82,5 +82,7 @@ youtubeDlTo key url dest = do
-- Check if youtube-dl can still find media in an url.
youtubeDlSupported :: URLString -> Annex (Either String Bool)
youtubeDlSupported url = liftIO $ catchMsgIO $
snd <$> processTranscript "youtube-dl" [ url, "--simulate" ] Nothing
youtubeDlSupported url = catchMsgIO $ do
opts <- map Param . annexYoutubeDlOptions <$> Annex.getGitConfig
let opts' = opts ++ [ url, "--simulate" ]
liftIO $ snd <$> processTranscript "youtube-dl" opts' Nothing