const express = require("express");
const router = express();
const request = require("request");

router.get("/", (req, res) => {
  const options = {
    url: "http://music.163.com/discover",
    method: "GET",
    headers: {
      Referer: "http://music.163.com",
      "User-Agent":
        "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3380.0 Safari/537.36"
    }
  };
  request(options, (error, response, body) => {
    if (error) {
      res.status(502).send("fetch error");
    } else {
      try {
        const pattern = /<script[^>]*>\s*window\.Gbanners\s*=\s*([^;]+?);\s*<\/script>/g;
        const banners = pattern.exec(body)[1];
        res.send(JSON.stringify(eval(banners)));
      } catch (error) {
        res.status(502).send("fetch error");
      }
    }
  });
});

module.exports = router;

@@ -721,23 +721,49 @@
 fy(eval(
-banners
+%60(%7Bcode:200,banners:$%7Bbanners%7D%7D)%60
 )));%0A   

modify banner data format