diff --git a/netease_music/src/getInfo/commentUtils.js b/netease_music/src/getInfo/commentUtils.js index 1447d81..bd9cf25 100644 --- a/netease_music/src/getInfo/commentUtils.js +++ b/netease_music/src/getInfo/commentUtils.js @@ -1,7 +1,6 @@ const fs = require('fs'); const path = require('path'); -const requestUtils = require('../../../utils/requestUtils'); const sleepUtils = require('../../../utils/sleepUtils'); const dataManager = require('../dataManager'); diff --git a/netease_music/src/getInfo/playlistUtils.js b/netease_music/src/getInfo/playlistUtils_old.js similarity index 96% rename from netease_music/src/getInfo/playlistUtils.js rename to netease_music/src/getInfo/playlistUtils_old.js index 004f801..6a84328 100644 --- a/netease_music/src/getInfo/playlistUtils.js +++ b/netease_music/src/getInfo/playlistUtils_old.js @@ -9,7 +9,7 @@ const dbUtils = global.dbUtils; // refer: // https://neteasecloudmusicapi-docs.4everland.app/ // https://github.com/Binaryify/NeteaseCloudMusicApi -const { playlist_catlist, playlist_hot, playlist_detail } = require('NeteaseCloudMusicApi'); +const { playlist_detail } = require('NeteaseCloudMusicApi'); const dataManager = require('../dataManager'); async function fetchAll({ args }) { diff --git a/netease_music/src/getInfo/testUtils.js b/netease_music/src/getInfo/testUtils.js new file mode 100644 index 0000000..b87af4a --- /dev/null +++ b/netease_music/src/getInfo/testUtils.js @@ -0,0 +1,29 @@ +const fs = require('fs'); +const path = require('path'); + +const sleepUtils = require('../../../utils/sleepUtils'); + +const dbUtils = global.dbUtils; + +// refer: +// https://neteasecloudmusicapi-docs.4everland.app/ +// https://github.com/Binaryify/NeteaseCloudMusicApi +const { top_playlist, top_playlist_highquality, related_playlist } = require('NeteaseCloudMusicApi'); + +// 获取歌词详情 +async function fetch() { + try { + var result = await related_playlist({ + id: 1 + }); + fs.writeFileSync(path.join(__dirname, "../../temp", `test.json`), JSON.stringify(result.body)); + } catch (errors) { + console.error("error", errors); + await sleepUtils.sleep(10 * 1000); + } + console.log(result); +} + +module.exports = { + fetch: fetch, +} \ No newline at end of file diff --git a/netease_music/src/index.js b/netease_music/src/index.js index 39ecd95..95c733d 100644 --- a/netease_music/src/index.js +++ b/netease_music/src/index.js @@ -21,6 +21,7 @@ const commentUtils = require('./getInfo/commentUtils'); const playlistUtils = require('./getInfo/playlistUtils'); const assistantUtils = require('./assistantUtils'); +const testUtils = require('./getInfo/testUtils'); /** * 测试 @@ -37,6 +38,7 @@ async function test() { // let res = await artistInfoUtils.fetch({ artistId: "12023508" }); // let res = await songInfoUtils.fetch({ songId: "437608327" }); // let res = await playlistUtils.fetch({ playlistId: "4980157066", debug: true }); + // let res = await testUtils.fetch(); // let res = await albumInfoUtils.getFromDatabase({ albumId: "9156" }); // let res = await artistInfoUtils.getFromDatabase({ artistId: "12023508" });