diff options
author | Florrie <towerofnix@gmail.com> | 2018-11-12 13:47:02 -0400 |
---|---|---|
committer | Florrie <towerofnix@gmail.com> | 2018-11-12 13:47:02 -0400 |
commit | e0e8e85105de083a66e47f4d125cc621b95fbc02 (patch) | |
tree | 5226a172a86b26c66b5ffc94fbb0c3da9b41d675 | |
parent | 2954284abee1b2e5754c0569288108a659c5cee2 (diff) |
Tweak how youtube-dl downloads are stored
-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 => { |