1
0
Code Issues Pull Requests Projects Releases Wiki Activity GitHub Gitee
tools/netease_music/index.js

33 lines
1009 B
JavaScript

if (process.argv.length <= 2) {
let output = [
"参数不够",
"node index --utils [song|album|artist|lyric|comment] --min [number] --max [number] --order [false|ASC|DESC] --limit [number]",
// "",
// "node index --utils xxx --min xxx --max xxx --order ASC --limit 2000",
].join('\n');
console.log(output);
return;
}
var args = require('minimist')(process.argv.slice(2));
args = {
// 子模块
utils: args.utils,
// id 范围
min: Number(args.min) || undefined,
max: Number(args.max) || undefined,
// 顺序
order: args.order,
// 数量
limit: Number(args.limit) || undefined,
// 分区
partition: Number(args.partition) || undefined,
sleepTime: Number(args.sleepTime) || 100,
}
console.log("args:", args);
global.sleepTime = args.sleepTime; // 两次请求之间停顿时间
global.useMysqlPool = true;
const neteaseMusic = require('./src/index');
neteaseMusic.main(args);