album,artist请求增加超时时间;小调整
This commit is contained in:
@@ -59,7 +59,7 @@ async function fetch({ albumId, debug = false, update = false }) {
|
||||
let url = `https://music.163.com/album?id=${albumId}`;
|
||||
try {
|
||||
// var html = fs.readFileSync(path.join(__dirname, "../../temp", `album-${albumId}.html`), 'utf8');
|
||||
var html = await requestUtils.getApiResult(url);
|
||||
var html = await requestUtils.getApiResult(url, { timeout: 3000 });
|
||||
// fs.writeFileSync(path.join(__dirname, "../../temp", `album-${albumId}.html`), html);
|
||||
} catch (errors) {
|
||||
console.error(errors);
|
||||
|
@@ -52,7 +52,7 @@ async function fetch({ artistId, debug = false }) {
|
||||
let url = `https://music.163.com/artist?id=${artistId}`;
|
||||
try {
|
||||
// var html = fs.readFileSync(path.join(__dirname, "../../temp", `artist-${artistId}.html`), 'utf8');
|
||||
var html = await requestUtils.getApiResult(url);
|
||||
var html = await requestUtils.getApiResult(url, { timeout: 3000 });
|
||||
// fs.writeFileSync(path.join(__dirname, "../../temp", `artist-${artistId}.html`), html);
|
||||
} catch (errors) {
|
||||
console.error(errors);
|
||||
|
@@ -21,7 +21,7 @@ async function fetchAll({ args = {} }) {
|
||||
for (let i = 0; i < count; i++) {
|
||||
await global.checkIsExit();
|
||||
var subArray = songIds.slice(i * step, (i + 1) * step);
|
||||
console.log(`${i + 1}/${count} | song: ${subArray[0]}-${subArray.slice(-1)[0]} | ${args.min || "?"}-${args.max || "?"}`);
|
||||
console.log(`${i + 1}/${count} | song: ${subArray[0]}-${subArray.slice(-1)[0]} (${subArray.length}) | ${args.min || "?"}-${args.max || "?"}`);
|
||||
try {
|
||||
await fetch({ songIdArray: subArray });
|
||||
} catch (err) {
|
||||
|
Reference in New Issue
Block a user