Skip to content

Commit d4a8a54

Browse files
author
kilingzhang
committed
歌单
1 parent 3ccc9f2 commit d4a8a54

4 files changed

Lines changed: 118 additions & 102 deletions

File tree

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<?php
2+
/**
3+
* Created by PhpStorm.
4+
* User: kilingzhang
5+
* Date: 2020-04-20
6+
* Time: 00:03
7+
*/
8+
9+
namespace NeteaseCloudMusicApi\V1\Playlist;
10+
11+
12+
use NeteaseCloudMusicApi\Controller;
13+
14+
/**
15+
* Class Detail
16+
* @package NeteaseCloudMusicApi\V1\Playlist
17+
*
18+
* 获取歌单详情
19+
* 说明:歌单能看到歌单名字,但看不到具体歌单内容,调用此接口,传入歌单 id,可以获取对应歌单内的所有的音乐
20+
*
21+
* 必选参数:
22+
* id : 歌单 id
23+
*
24+
* 接口地址:
25+
* /playlist/detail
26+
*
27+
* 调用例子:
28+
* http://i.music.163.com/playlist/detail?id=24381616
29+
*
30+
*/
31+
class Detail extends Controller
32+
{
33+
protected $uri = 'https://music.163.com/weapi/v3/playlist/detail';
34+
35+
protected $params = [
36+
'id' => null,
37+
'offset' => 0,
38+
'limit' => 30,
39+
'total' => true,
40+
'n' => 30,
41+
];
42+
}
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<?php
2+
/**
3+
* Created by PhpStorm.
4+
* User: kilingzhang
5+
* Date: 2020-04-20
6+
* Time: 00:06
7+
*/
8+
9+
namespace NeteaseCloudMusicApi\V1\Playlist;
10+
11+
12+
use NeteaseCloudMusicApi\Controller;
13+
14+
/**
15+
* Class Tracks
16+
* @package NeteaseCloudMusicApi\V1\Playlist
17+
*
18+
* 收藏单曲到歌单
19+
* 说明:调用此接口,传入音乐 id和 limit 参数, 可获得该专辑的所有评论(需要登录)
20+
*
21+
* 必选参数:
22+
* op: 从歌单增加单曲为add,删除为 del pid: 歌单id tracks: 歌曲id
23+
*
24+
* 接口地址:
25+
* /playlist/tracks
26+
*
27+
* 调用例子:
28+
* http://i.music.163.com/playlist/tracks?op=add&pid=313997889&tracks=1426285166
29+
*
30+
*/
31+
class Tracks extends Controller
32+
{
33+
protected $uri = 'https://music.163.com/weapi/playlist/manipulate/tracks';
34+
35+
protected $params = [
36+
'op' => null,
37+
'pid' => null,
38+
'tracks' => null,
39+
];
40+
41+
protected function parseParams($params): array
42+
{
43+
$params['trackIds'] = "[{$params['tracks']}]";
44+
return $params;
45+
}
46+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?php
2+
/**
3+
* Created by PhpStorm.
4+
* User: kilingzhang
5+
* Date: 2020-04-20
6+
* Time: 00:11
7+
*/
8+
9+
namespace NeteaseCloudMusicApi\V1\User;
10+
11+
12+
use NeteaseCloudMusicApi\Controller;
13+
14+
/**
15+
* Class Playlist
16+
* @package NeteaseCloudMusicApi\V1\User
17+
*
18+
*
19+
* http://i.music.163.com/user/playlist?uid=251183635
20+
*/
21+
class Playlist extends Controller
22+
{
23+
protected $uri = 'https://music.163.com/weapi/user/playlist';
24+
25+
protected $params = [
26+
'uid' => null,
27+
'limit' => 30,
28+
'offset' => 0
29+
];
30+
}

src/NeteaseCloudMusicApiSdk/Playlist.php

Lines changed: 0 additions & 102 deletions
This file was deleted.

0 commit comments

Comments
 (0)