mirror of
https://gitlab.com/Binaryify/neteasecloudmusicapi.git
synced 2025-05-23 22:37:41 +08:00
fix error
This commit is contained in:
parent
68a8635f4b
commit
c5f164a094
@ -26,4 +26,4 @@ var api = {
|
|||||||
getPlaylists: _getPlaylists.getPlaylists
|
getPlaylists: _getPlaylists.getPlaylists
|
||||||
|
|
||||||
};
|
};
|
||||||
exports.api = api;
|
exports.api = api;
|
32
build/component/getPlaylists.js
Normal file
32
build/component/getPlaylists.js
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
'use strict';
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.getPlaylists = undefined;
|
||||||
|
|
||||||
|
var _request = require('request');
|
||||||
|
|
||||||
|
var _request2 = _interopRequireDefault(_request);
|
||||||
|
|
||||||
|
var _config = require('../config');
|
||||||
|
|
||||||
|
var _util = require('../util');
|
||||||
|
|
||||||
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||||
|
|
||||||
|
var getPlaylists = function getPlaylists(id, callback) {
|
||||||
|
var option = (0, _util.deepCopy)(_config.globalOption);
|
||||||
|
var url = _config.origin + '/api/playlist/detail?id=' + id;
|
||||||
|
var method = 'get';
|
||||||
|
Object.assign(option, { url: url, method: method });
|
||||||
|
(0, _request2.default)(option, function (err, res, body) {
|
||||||
|
if (!err && res.statusCode == 200) {
|
||||||
|
var info = JSON.parse(body);
|
||||||
|
callback && callback(JSON.stringify(info, '', 2));
|
||||||
|
} else {
|
||||||
|
console.error(err);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.getPlaylists = getPlaylists;
|
@ -1,10 +1,10 @@
|
|||||||
{
|
{
|
||||||
"name": "NeteaseCloudMusicApi",
|
"name": "NeteaseCloudMusicApi",
|
||||||
"version": "1.2.8",
|
"version": "1.2.9",
|
||||||
"description": "网易云音乐nodejs版接口模块",
|
"description": "网易云音乐nodejs版接口模块",
|
||||||
"main": "build/app.js",
|
"main": "build/app.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "babel-node test/test.js",
|
"test": "node test/test.js",
|
||||||
"build": "babel src/ -d build/"
|
"build": "babel src/ -d build/"
|
||||||
},
|
},
|
||||||
"keywords": ["NeteaseCloudMusic","网易云音乐","网易云"],
|
"keywords": ["NeteaseCloudMusic","网易云音乐","网易云"],
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import { api } from '../src/app.js'
|
// import { api } from '../src/app.js'
|
||||||
|
const api=require('../build/app.js').api
|
||||||
|
|
||||||
api.search("年度之歌",data => {
|
api.search("年度之歌",data => {
|
||||||
console.log("################Search API#################")
|
console.log("################Search API#################")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user