diff options
author | Florrie <towerofni@gmail.com> | 2017-08-03 03:20:23 +0400 |
---|---|---|
committer | Florrie <towerofni@gmail.com> | 2017-08-03 03:20:23 +0400 |
commit | 63ee18f61991cfcd10e42871d57eccd53fa51828 (patch) | |
tree | b07bbe3aa8b4358a77758783638b447465a850fe /src/downloaders.js | |
parent | b94845e008931bfaee56b91db1f892af7a6d339f (diff) | |
parent | 70462b74635da8eb92c10d51d1a8a1fe06ceb9f1 (diff) |
Merge branch 'master' of https://github.com/liam4/http-music
Diffstat (limited to 'src/downloaders.js')
-rw-r--r-- | src/downloaders.js | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/downloaders.js b/src/downloaders.js index c3dc43d..b9cc33d 100644 --- a/src/downloaders.js +++ b/src/downloaders.js @@ -107,7 +107,7 @@ function makeConverterDownloader(downloader, type) { const inFile = await downloader(arg) const base = path.basename(inFile, path.extname(inFile)) const tempDir = tempy.directory() - const outFile = tempDir + base + '.' + type + const outFile = `${tempDir}/${base}.${type}` await promisifyProcess(spawn('avconv', ['-i', inFile, outFile]), false) @@ -122,6 +122,14 @@ module.exports = { makePowerfulDownloader, makeConverterDownloader, + byName: { + 'http': makeHTTPDownloader, + 'local': makeLocalDownloader, + 'file': makeLocalDownloader, + 'youtube': makeYouTubeDownloader, + 'youtube-dl': makeYouTubeDownloader + }, + getDownloaderFor(arg) { if (arg.startsWith('http://') || arg.startsWith('https://')) { if (arg.includes('youtube.com')) { |