处理 album 极少数情况下 image 正则匹配失败问题
This commit is contained in:
parent
67af823cde
commit
99a53fc759
@ -137,8 +137,15 @@ async function fetch({ albumId, debug = false, update = false }) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let image = /<meta property="og:image" content="http:\/\/p.\.music\.126\.net\/(.*?)" \/>/.exec(html)[1];
|
// 极个别album下面的image正则找不到,例如:73973625 74009959
|
||||||
let songListJSONString = /<textarea id="song-list-pre-data" style="display:none;">(.*?)<\/textarea>/.exec(html)[1];
|
let image = "";
|
||||||
|
try {
|
||||||
|
image = /<meta property="og:image" content="http:\/\/p.\.music\.126\.net\/(.*?)" \/>/.exec(html)[1];
|
||||||
|
} catch (e) { }
|
||||||
|
let songListJSONString = "";
|
||||||
|
try {
|
||||||
|
songListJSONString = /<textarea id="song-list-pre-data" style="display:none;">(.*?)<\/textarea>/.exec(html)[1];
|
||||||
|
} catch (e) { }
|
||||||
let songList = JSON.parse(songListJSONString);
|
let songList = JSON.parse(songListJSONString);
|
||||||
let songIds = songList.map(song => Number(song.id));
|
let songIds = songList.map(song => Number(song.id));
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user