Compare commits
No commits in common. "c0f53c6d2c6cf881151d95dddb63703a778d7e90" and "af97ee82d78e27fa3ea6db560ff01f68523f3fe6" have entirely different histories.
c0f53c6d2c
...
af97ee82d7
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,3 +1,2 @@
|
|||||||
node_modules/
|
node_modules/
|
||||||
bin/ffmpeg
|
bin/ffmpeg
|
||||||
music/*.mp3
|
|
||||||
|
@ -2,13 +2,11 @@ var express = require('express');
|
|||||||
var YoutubeMp3Downloader = require("youtube-mp3-downloader");
|
var YoutubeMp3Downloader = require("youtube-mp3-downloader");
|
||||||
var fs = require('fs');
|
var fs = require('fs');
|
||||||
var path = require('path');
|
var path = require('path');
|
||||||
var urlParse = require("body-parser");
|
|
||||||
var id3 = require('node-id3');
|
|
||||||
|
|
||||||
var router = express.Router();
|
var router = express.Router();
|
||||||
var YD = new YoutubeMp3Downloader({
|
var YD = new YoutubeMp3Downloader({
|
||||||
"ffmpegPath": path.join(__dirname + "/../bin/ffmpeg"),
|
"ffmpegPath": __dirname + "/../bin/ffmpeg",
|
||||||
"outputPath": path.join(__dirname + "/../music"),
|
"outputPath": __dirname + "/../music",
|
||||||
"youtubeVideoQuality": "highest",
|
"youtubeVideoQuality": "highest",
|
||||||
"queueParallelism": 1,
|
"queueParallelism": 1,
|
||||||
"progressTimeout": 2000
|
"progressTimeout": 2000
|
||||||
@ -134,16 +132,4 @@ router.get('/search/:query', (req, res, _next) => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
router.use(urlParse.urlencoded({extended : true}));
|
|
||||||
router.get('/analyse/*', (req, res, _next) => {
|
|
||||||
let file = req.params[0];
|
|
||||||
if (fs.existsSync(file)) {
|
|
||||||
var result = id3.read(file);
|
|
||||||
result.image.base64 = result.image.imageBuffer.toString('base64');
|
|
||||||
} else {
|
|
||||||
var result = 'File not found'
|
|
||||||
}
|
|
||||||
res.json({ result: result });
|
|
||||||
});
|
|
||||||
|
|
||||||
module.exports = router;
|
module.exports = router;
|
||||||
|
Loading…
Reference in New Issue
Block a user