??改为|| 兼容node v12.13.1
This commit is contained in:
@@ -9,7 +9,7 @@ const dbUtils = global.dbUtils;
|
||||
// refer:
|
||||
// https://neteasecloudmusicapi-docs.4everland.app/
|
||||
// https://github.com/Binaryify/NeteaseCloudMusicApi
|
||||
const { playlist_catlist, playlist_hot } = require('NeteaseCloudMusicApi');
|
||||
const { playlist_catlist, playlist_hot, playlist_detail, playlist_track_all, song_detail } = require('NeteaseCloudMusicApi');
|
||||
|
||||
// // 从数据库中查出还缺少的歌词,并进行爬取
|
||||
// async function fetchAll() {
|
||||
@@ -36,7 +36,20 @@ async function fetch({ playlistId, debug = false }) {
|
||||
// https://neteasecloudmusicapi-docs.4everland.app/#/?id=%e6%ad%8c%e5%8d%95%e5%88%86%e7%b1%bb
|
||||
var queryParams = {};
|
||||
try {
|
||||
var playlistResult = await playlist_catlist(queryParams);
|
||||
// 获取歌单分类
|
||||
// var playlistResult = await playlist_catlist(queryParams);
|
||||
// var playlistResult = await playlist_hot(queryParams);
|
||||
// var playlistResult = await playlist_detail({
|
||||
// id: playlistId,
|
||||
// });
|
||||
var playlistResult = await song_detail({
|
||||
// ids: ["536623501", "536623501"].join(','),
|
||||
});
|
||||
// var playlistResult = await playlist_track_all({
|
||||
// id: playlistId,
|
||||
// limit: 10,
|
||||
// offset: 0,
|
||||
// });
|
||||
fs.writeFileSync(path.join(__dirname, "../../temp", `playlist-${playlistId}.json`), JSON.stringify(playlistResult));
|
||||
} catch (errors) {
|
||||
console.error(errors);
|
||||
|
Reference in New Issue
Block a user