update
This commit is contained in:
@@ -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} | ${global.statistics}`);
|
||||
console.log(`${i}/${songIds.length} | song: ${songId}`);
|
||||
try {
|
||||
await fetch({ songId: songId });
|
||||
} catch (err) {
|
||||
@@ -51,24 +51,9 @@ async function fetch({ songId, debug = false }) {
|
||||
if (result[0].count > 0 && !debug) {
|
||||
console.log(`数据库中已有数据,跳过 songId: ${songId}`);
|
||||
return;
|
||||
|
||||
// let songResult = await dbUtils.query('SELECT * FROM song WHERE song_id = ?', [songId]);
|
||||
// songResult = JSON.parse(JSON.stringify(songResult));
|
||||
|
||||
// let songArtistResult = await dbUtils.query('SELECT * FROM song_artist_relation WHERE song_id = ?', [songId]);
|
||||
// songArtistResult = JSON.parse(JSON.stringify(songArtistResult));
|
||||
// songResult.artistIds = songArtistResult.map(song => song.artist_id);
|
||||
|
||||
// let songAlbumResult = await dbUtils.query('SELECT * FROM song_album_relation WHERE song_id = ?', [songId]);
|
||||
// songAlbumResult = JSON.parse(JSON.stringify(songAlbumResult));
|
||||
// songResult.albumId = songAlbumResult.map(song => song.album_id)[0];
|
||||
|
||||
// // console.log(songResult);
|
||||
// return songResult;
|
||||
}
|
||||
|
||||
let url = `https://music.163.com/song?id=${songId}`;
|
||||
|
||||
try {
|
||||
// var html = fs.readFileSync(path.join(__dirname, "../../temp", `song-${songId}.html`), 'utf8');
|
||||
var html = await requestUtils.getApiResult(url);
|
||||
|
Reference in New Issue
Block a user