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++) {
|
for (let i = 0; i < albumIds.length; i++) {
|
||||||
await global.checkIsExit();
|
await global.checkIsExit();
|
||||||
const albumId = albumIds[i];
|
const albumId = albumIds[i];
|
||||||
console.log(`${i}/${albumIds.length} | album: ${albumId}`);
|
console.log(`${i + 1}/${albumIds.length} | album: ${albumId}`);
|
||||||
try {
|
try {
|
||||||
await fetch({ albumId: albumId, update: isUpdate });
|
await fetch({ albumId: albumId, update: isUpdate });
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
@ -31,7 +31,7 @@ async function fetchAll() {
|
|||||||
for (let i = 0; i < artistIds.length; i++) {
|
for (let i = 0; i < artistIds.length; i++) {
|
||||||
await global.checkIsExit();
|
await global.checkIsExit();
|
||||||
const artistId = artistIds[i];
|
const artistId = artistIds[i];
|
||||||
console.log(`${i}/${artistIds.length} | artist: ${artistId}`);
|
console.log(`${i + 1}/${artistIds.length} | artist: ${artistId}`);
|
||||||
try {
|
try {
|
||||||
await fetch({ artistId: artistId });
|
await fetch({ artistId: artistId });
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
@ -72,9 +72,14 @@ async function fetch({ artistId, debug = false }) {
|
|||||||
// console.log(artistInfoDict);
|
// console.log(artistInfoDict);
|
||||||
|
|
||||||
let image = /<meta property="og:image" content="http:\/\/p.\.music\.126\.net\/(.*?)" \/>/.exec(html)[1];
|
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 songIds = [];
|
||||||
let songList = JSON.parse(songListJSONString);
|
try {
|
||||||
let songIds = songList.map(song => song.id);
|
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 = {
|
let artistInfo = {
|
||||||
artistId: artistId,
|
artistId: artistId,
|
||||||
|
@ -16,7 +16,7 @@ async function fetchAll() {
|
|||||||
for (let i = 0; i < songIds.length; i++) {
|
for (let i = 0; i < songIds.length; i++) {
|
||||||
await global.checkIsExit();
|
await global.checkIsExit();
|
||||||
const songId = songIds[i];
|
const songId = songIds[i];
|
||||||
console.log(`${i}/${songIds.length} | lyric: ${songId}`);
|
console.log(`${i + 1}/${songIds.length} | lyric: ${songId}`);
|
||||||
try {
|
try {
|
||||||
await fetch({ songId: songId });
|
await fetch({ songId: songId });
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
@ -35,7 +35,7 @@ async function fetchAll() {
|
|||||||
for (let i = 0; i < songIds.length; i++) {
|
for (let i = 0; i < songIds.length; i++) {
|
||||||
await global.checkIsExit();
|
await global.checkIsExit();
|
||||||
const songId = songIds[i];
|
const songId = songIds[i];
|
||||||
console.log(`${i}/${songIds.length} | song: ${songId}`);
|
console.log(`${i + 1}/${songIds.length} | song: ${songId}`);
|
||||||
try {
|
try {
|
||||||
await fetch({ songId: songId });
|
await fetch({ songId: songId });
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user