From e0e8e85105de083a66e47f4d125cc621b95fbc02 Mon Sep 17 00:00:00 2001 From: Florrie Date: Mon, 12 Nov 2018 13:47:02 -0400 Subject: Tweak how youtube-dl downloads are stored --- downloaders.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/downloaders.js b/downloaders.js index 4c93d0f..4b4750c 100644 --- a/downloaders.js +++ b/downloaders.js @@ -118,7 +118,7 @@ const downloaders = { youtubedl: cachify('youtubedl', arg => { const outDir = tempy.directory() - const outFile = outDir + '/%(id)s-%(uploader)s-%(title)s.' + downloaders.extension + const outFile = outDir + '/%(id)s-%(uploader)s-%(title)s.%(ext)s' const opts = [ '--quiet', @@ -130,7 +130,8 @@ const downloaders = { ] return promisifyProcess(spawn('youtube-dl', opts)) - .then(() => outDir) + .then(() => readdir(outDir)) + .then(files => outDir + '/' + files[0]) }), local: cachify('local', arg => { -- cgit 1.3.0-6-gf8a5