|
@@ -478,7 +478,7 @@ app.post("/ncm/url", function (req, res) {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
- if (req.body.id !== undefined && req.body.kind !== undefined) {
|
|
|
+ if (!req.body.id && !req.body.kind) {
|
|
|
try {
|
|
|
let id = req.body.id
|
|
|
fetch(ncmAPIUrl + "/song/download/url/v1?id=" + id + "&level=hires", {
|
|
@@ -487,6 +487,12 @@ app.post("/ncm/url", function (req, res) {
|
|
|
}
|
|
|
}).then(async result => {
|
|
|
if (result.status === 200 || result.status === 304) {
|
|
|
+ try{
|
|
|
+ await result.json()
|
|
|
+ }catch (e){
|
|
|
+ res.status(500).header("Access-Control-Allow-Origin", "*").end("格式错误");
|
|
|
+ return
|
|
|
+ }
|
|
|
let result_json = await result.json()
|
|
|
if (result_json.data.url !== null) {
|
|
|
let infos = await (await fetch(ncmAPIUrl + "/song/detail?ids=" + id)).json();
|