diff options
author | Joey Hess <joeyh@joeyh.name> | 2017-12-31 15:19:01 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2017-12-31 15:19:01 -0400 |
commit | 6f83a6c8f45d7aa325d315654c4fd28de9feb4a6 (patch) | |
tree | b8b58cd6e18e2b698d9a9fd8b89b60bc469cc68d | |
parent | 683a62b3f5e5f0c464c1e0ec3c7d0bd85a257490 (diff) |
addurl: Fix encoding of filename queried from youtube-dl when in --fast mode.
And also now in non-fast mode, since it was just changed to query for the
filename separately.
And avoid processTranscript which mixed up stdout and stderr and could have
led to weirdness if there were warnings that didn't get suppressed.
-rw-r--r-- | Annex/YoutubeDl.hs | 13 | ||||
-rw-r--r-- | CHANGELOG | 2 |
2 files changed, 13 insertions, 2 deletions
diff --git a/Annex/YoutubeDl.hs b/Annex/YoutubeDl.hs index 43e63dfd6..95b6bf762 100644 --- a/Annex/YoutubeDl.hs +++ b/Annex/YoutubeDl.hs @@ -24,6 +24,7 @@ import Utility.HtmlDetect import Logs.Transfer import Network.URI +import Control.Concurrent.Async -- Runs youtube-dl in a work directory, to download a single media file -- from the url. Reutrns the path to the media file in the work directory. @@ -168,8 +169,16 @@ youtubeDlFileName' url , Param "--get-filename" , Param "--no-warnings" ] - (output, ok) <- liftIO $ processTranscript "youtube-dl" - (toCommand opts) Nothing + (Nothing, Just o, Just e, pid) <- liftIO $ createProcess + (proc "youtube-dl" (toCommand opts)) + { std_out = CreatePipe + , std_err = CreatePipe + } + output <- liftIO $ fmap fst $ + hGetContentsStrict o + `concurrently` + hGetContentsStrict e + ok <- liftIO $ checkSuccessProcess pid return $ case (ok, lines output) of (True, (f:_)) | not (null f) -> Right f _ -> nomedia @@ -8,6 +8,8 @@ git-annex (6.20171215) UNRELEASED; urgency=medium * addurl: When the file youtube-dl will download is already an annexed file, don't download it again and fail to overwrite it, instead just do nothing, like it used to when quvi was used. + * addurl: Fix encoding of filename queried from youtube-dl when in + --fast mode. -- Joey Hess <id@joeyh.name> Wed, 20 Dec 2017 12:11:46 -0400 |