« get me outta code hell

http-music - Command-line music player + utils (not a server!)
about summary refs log tree commit diff
path: root/src/loop-play.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/loop-play.js')
-rw-r--r--src/loop-play.js5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/loop-play.js b/src/loop-play.js
index 50bca80..5205025 100644
--- a/src/loop-play.js
+++ b/src/loop-play.js
@@ -30,11 +30,10 @@ module.exports = async function loopPlay(picker, downloader, playArgs = []) {
     const [ title, downloaderArg ] = picked
     console.log(`Downloading ${title}..\nDownloader arg: ${downloaderArg}`)
 
+    const downloadFile = await downloader(downloaderArg)
+
     const tempDir = tempy.directory()
     const wavFile = tempDir + `/.${sanitize(title)}.wav`
-    const downloadFile = tempDir + '/.dl-' + path.basename(downloaderArg)
-
-    await downloader(downloaderArg, downloadFile)
 
     try {
       await convert(downloadFile, wavFile)