update
This commit is contained in:
parent
7ced382c9f
commit
93db6371d9
@ -35,7 +35,7 @@ async function fetchAll({ isUpdate = false }) {
|
||||
for (let i = 0; i < albumIds.length; i++) {
|
||||
await global.checkIsExit();
|
||||
const albumId = albumIds[i];
|
||||
console.log(`${i}/${albumIds.length} | album: ${albumId}`);
|
||||
console.log(`${i + 1}/${albumIds.length} | album: ${albumId}`);
|
||||
try {
|
||||
await fetch({ albumId: albumId, update: isUpdate });
|
||||
} catch (err) {
|
||||
|
@ -31,7 +31,7 @@ async function fetchAll() {
|
||||
for (let i = 0; i < artistIds.length; i++) {
|
||||
await global.checkIsExit();
|
||||
const artistId = artistIds[i];
|
||||
console.log(`${i}/${artistIds.length} | artist: ${artistId}`);
|
||||
console.log(`${i + 1}/${artistIds.length} | artist: ${artistId}`);
|
||||
try {
|
||||
await fetch({ artistId: artistId });
|
||||
} catch (err) {
|
||||
@ -72,9 +72,14 @@ async function fetch({ artistId, debug = false }) {
|
||||
// console.log(artistInfoDict);
|
||||
|
||||
let image = /<meta property="og:image" content="http:\/\/p.\.music\.126\.net\/(.*?)" \/>/.exec(html)[1];
|
||||
let songListJSONString = /<textarea id="song-list-pre-data" style="display:none;">(.*?)<\/textarea>/.exec(html)[1];
|
||||
let songList = JSON.parse(songListJSONString);
|
||||
let songIds = songList.map(song => song.id);
|
||||
let songIds = [];
|
||||
try {
|
||||
let songListJSONString = /<textarea id="song-list-pre-data" style="display:none;">(.*?)<\/textarea>/.exec(html)[1];
|
||||
let songList = JSON.parse(songListJSONString);
|
||||
songIds = songList.map(song => song.id);
|
||||
} catch (error) {
|
||||
// 可能是歌手下面没有音乐 例如:https://music.163.com/#/artist?id=30032762
|
||||
}
|
||||
|
||||
let artistInfo = {
|
||||
artistId: artistId,
|
||||
|
@ -16,7 +16,7 @@ async function fetchAll() {
|
||||
for (let i = 0; i < songIds.length; i++) {
|
||||
await global.checkIsExit();
|
||||
const songId = songIds[i];
|
||||
console.log(`${i}/${songIds.length} | lyric: ${songId}`);
|
||||
console.log(`${i + 1}/${songIds.length} | lyric: ${songId}`);
|
||||
try {
|
||||
await fetch({ songId: songId });
|
||||
} catch (err) {
|
||||
|
@ -35,7 +35,7 @@ async function fetchAll() {
|
||||
for (let i = 0; i < songIds.length; i++) {
|
||||
await global.checkIsExit();
|
||||
const songId = songIds[i];
|
||||
console.log(`${i}/${songIds.length} | song: ${songId}`);
|
||||
console.log(`${i + 1}/${songIds.length} | song: ${songId}`);
|
||||
try {
|
||||
await fetch({ songId: songId });
|
||||
} catch (err) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user