diff options
Diffstat (limited to 'downloaders.js')
-rw-r--r-- | downloaders.js | 5 |
1 files 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 => { |