« get me outta code hell

Make youtube-dl files a little more sensible - mtui - Music Text User Interface - user-friendly command line music player
about summary refs log tree commit diff
diff options
context:
space:
mode:
authorFlorrie <towerofnix@gmail.com>2018-06-29 21:57:00 -0300
committerFlorrie <towerofnix@gmail.com>2018-06-29 21:57:00 -0300
commit01ef36b2b1a04702af697be6c4f3435537f06cc7 (patch)
tree9d426cee7e20fd78ad4c4888c2ebc94bb4f1e1a1
parent993282e5d028564346e0c794a2d6407077665353 (diff)
Make youtube-dl files a little more sensible
-rw-r--r--downloaders.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/downloaders.js b/downloaders.js
index f0833e7..340abe6 100644
--- a/downloaders.js
+++ b/downloaders.js
@@ -117,19 +117,19 @@ const downloaders = {
   }),
 
   youtubedl: cachify('youtubedl', arg => {
-    const out = (
-      tempy.directory() + '/download.' + downloaders.extension)
+    const outDir = tempy.directory()
+    const outFile = outDir + '/%(id)s-%(uploader)s-%(title)s.' + downloaders.extension
 
     const opts = [
       '--quiet',
       '--extract-audio',
       '--audio-format', downloaders.extension,
-      '--output', out,
+      '--output', outFile,
       arg
     ]
 
     return promisifyProcess(spawn('youtube-dl', opts))
-      .then(() => out)
+      .then(() => outDir)
   }),
 
   local: cachify('local', arg => {