Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
嗯菜
NeteaseCloudMusicApi
提交
79e837ce
N
NeteaseCloudMusicApi
项目概览
嗯菜
/
NeteaseCloudMusicApi
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
N
NeteaseCloudMusicApi
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
79e837ce
编写于
7月 09, 2016
作者:
B
binaryify
提交者:
GitHub
7月 09, 2016
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #5 from CeBkCn/master
Add getPlaylists
上级
16297444
49554adb
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
69 addition
and
3 deletion
+69
-3
README.MD
README.MD
+5
-0
build/app.js
build/app.js
+5
-2
build/component/getPlaylists
build/component/getPlaylists
+32
-0
src/app.js
src/app.js
+3
-1
src/component/getPlaylists.js
src/component/getPlaylists.js
+19
-0
test/test.js
test/test.js
+5
-0
未找到文件。
README.MD
浏览文件 @
79e837ce
...
@@ -59,6 +59,11 @@ api.getArtistAlbums(id:Number,[callback:function,limit:Number default:3, offset:
...
@@ -59,6 +59,11 @@ api.getArtistAlbums(id:Number,[callback:function,limit:Number default:3, offset:
api
.
getAlbums
(
id
:
Number
,[
callback
:
function
])
api
.
getAlbums
(
id
:
Number
,[
callback
:
function
])
```
```
## getPlaylists
```
javascript
api
.
Playlists
(
id
:
Number
,[
callback
:
function
])
```
## License
## License
[
The MIT License (MIT)
](
LICENSE
)
[
The MIT License (MIT)
](
LICENSE
)
build/app.js
浏览文件 @
79e837ce
...
@@ -15,12 +15,15 @@ var _getArtistAlbums = require('./component/getArtistAlbums');
...
@@ -15,12 +15,15 @@ var _getArtistAlbums = require('./component/getArtistAlbums');
var
_getAlbums
=
require
(
'
./component/getAlbums
'
);
var
_getAlbums
=
require
(
'
./component/getAlbums
'
);
var
_getPlaylists
=
require
(
'
./component/getPlaylists
'
);
var
api
=
{
var
api
=
{
search
:
_search
.
search
,
search
:
_search
.
search
,
song
:
_song
.
song
,
song
:
_song
.
song
,
lrc
:
_lrc
.
lrc
,
lrc
:
_lrc
.
lrc
,
getArtistAlbums
:
_getArtistAlbums
.
getArtistAlbums
,
getArtistAlbums
:
_getArtistAlbums
.
getArtistAlbums
,
getAlbums
:
_getAlbums
.
getAlbums
getAlbums
:
_getAlbums
.
getAlbums
,
getPlaylists
:
_getPlaylists
.
getPlaylists
};
};
exports
.
api
=
api
;
exports
.
api
=
api
;
\ No newline at end of file
build/component/getPlaylists
0 → 100644
浏览文件 @
79e837ce
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getAlbums = 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;
src/app.js
浏览文件 @
79e837ce
...
@@ -3,13 +3,15 @@ import { song } from './component/song'
...
@@ -3,13 +3,15 @@ import { song } from './component/song'
import
{
lrc
}
from
'
./component/lrc
'
import
{
lrc
}
from
'
./component/lrc
'
import
{
getArtistAlbums
}
from
'
./component/getArtistAlbums
'
import
{
getArtistAlbums
}
from
'
./component/getArtistAlbums
'
import
{
getAlbums
}
from
'
./component/getAlbums
'
import
{
getAlbums
}
from
'
./component/getAlbums
'
import
{
getPlaylists
}
from
'
./component/getPlaylists
'
let
api
=
{
let
api
=
{
search
:
search
,
search
:
search
,
song
:
song
,
song
:
song
,
lrc
:
lrc
,
lrc
:
lrc
,
getArtistAlbums
:
getArtistAlbums
,
getArtistAlbums
:
getArtistAlbums
,
getAlbums
:
getAlbums
getAlbums
:
getAlbums
,
getPlaylists
:
getPlaylists
}
}
export
{
api
}
export
{
api
}
src/component/getPlaylists.js
0 → 100644
浏览文件 @
79e837ce
import
request
from
'
request
'
import
{
origin
,
globalOption
}
from
'
../config
'
import
{
deepCopy
}
from
'
../util
'
const
getPlaylists
=
(
id
,
callback
)
=>
{
const
option
=
deepCopy
(
globalOption
)
const
url
=
`
${
origin
}
/api/playlist/detail?id=
${
id
}
`
const
method
=
'
get
'
Object
.
assign
(
option
,
{
url
,
method
})
request
(
option
,
(
err
,
res
,
body
)
=>
{
if
(
!
err
&&
res
.
statusCode
==
200
)
{
let
info
=
JSON
.
parse
(
body
)
callback
&&
callback
(
JSON
.
stringify
(
info
,
''
,
2
))
}
else
{
console
.
error
(
err
);
}
})
}
export
{
Playlists
}
test/test.js
浏览文件 @
79e837ce
...
@@ -26,3 +26,8 @@ api.getAlbums('32311', data => {
...
@@ -26,3 +26,8 @@ api.getAlbums('32311', data => {
console
.
log
(
"
####################Albums####################
"
)
console
.
log
(
"
####################Albums####################
"
)
console
.
log
(
data
)
console
.
log
(
data
)
})
})
api
.
getPlaylists
(
'
311785002
'
,
data
=>
{
console
.
log
(
"
####################Playlists####################
"
)
console
.
log
(
data
)
})
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录