diff --git a/README.md b/README.md index 8287892..5edd49f 100644 --- a/README.md +++ b/README.md @@ -18,15 +18,15 @@ ## log ## 功能 -1. ~~登录~~ -2. ~~刷新登录~~ -3. ~~获取用户信息,歌单,收藏,mv, dj 数量~~ -4. ~~获取用户歌单~~ -5. ~~获取用户电台~~ -6. ~~获取用户关注列表~~ -7. ~~获取用户粉丝列表~~ -8. ~~获取用户动态~~ -9. ~~获取用户播放记录~~ +1. 登录 +2. 刷新登录 +3. 获取用户信息,歌单,收藏,mv, dj 数量 +4. 获取用户歌单 +5. 获取用户电台 +6. 获取用户关注列表 +7. 获取用户粉丝列表 +8. 获取用户动态 +9. 获取用户播放记录 10. 获取精品歌单 11. 获取歌单详情 12. 搜索 @@ -50,35 +50,35 @@ 30. 相似 mv 31. 获取相似音乐 32. 获取最近5个听了这首歌的用户 -33. ~~获取每日推荐歌单~~ -34. ~~获取每日推荐歌曲~~ -35. ~~私人 FM~~ -36. ~~签到~~ -37. ~~喜欢音乐~~ -38. ~~垃圾桶~~ +33. 获取每日推荐歌单 +34. 获取每日推荐歌曲 +35. 私人 FM +36. 签到 +37. 喜欢音乐 +38. 垃圾桶 39. 歌单(网友精选碟) 40. 新碟上架 41. 热门歌手 -42. ~~最新 mv~~ -43. ~~推荐 mv~~ -44. ~~推荐歌单~~ -45. ~~推荐新音乐~~ -46. ~~推荐电台~~ -47. ~~推荐节目~~ +42. 最新 mv +43. 推荐 mv +44. 推荐歌单 +45. 推荐新音乐 +46. 推荐电台 +47. 推荐节目 48. 独家放送 49. mv 排行 50. 获取 mv 数据 -51. ~~播放 mv~~ +51. 播放 mv 52. 排行榜 -53. ~~云盘~~ -54. ~~电台-推荐~~ -55. ~~电台-分类~~ -56. ~~电台-分类推荐~~ -57. ~~电台-订阅~~ -58. ~~电台-详情~~ -59. ~~电台-节目~~ -60. ~~给评论点赞~~ -61. ~~获取动态~~ +53. 云盘 +54. 电台-推荐 +55. 电台-分类 +56. 电台-分类推荐 +57. 电台-订阅 +58. 电台-详情 +59. 电台-节目 +60. 给评论点赞 +61. 获取动态 ## 环境要求 diff --git a/src/NeteaseCloudMusicApiSdk/Comment.php b/src/NeteaseCloudMusicApiSdk/Comment.php index 79fabc6..44d1371 100644 --- a/src/NeteaseCloudMusicApiSdk/Comment.php +++ b/src/NeteaseCloudMusicApiSdk/Comment.php @@ -241,9 +241,63 @@ public function dj($id, $offset = 0, $limit = 20) } - public function like() + /** + * + * 给评论点赞 + * 说明:调用此接口,传入 type, 资源 id, 和评论id cid和 是否点赞参数 t 即可给对应评论点赞(需要登录) + * + * 必选参数: + * id : 资源 id, 如歌曲 id,mv id + * + * cid : 评论 id + * + * t :是否点赞,1为点赞,0为取消点赞 + * + * tpye: 数字,资源类型,对应歌曲, mv, 专辑,歌单,电台 对应以下类型 + * + * 0: 歌曲 + * 1: mv + * 2: 歌单 + * 3: 专辑 + * 4: 电台 + * 接口地址: + * comment/like + * + * 调用例子: + * /comment/like?id=186016&cid=4956438&t=1&type=0 对应给晴天最热门的那条评论点赞 + * + * @route GET /comment/like + * @param string $id + * @param string $cid + * @param string $t + * @param string $type + * @return string json + */ + public function like($id, $cid, $t = 1, $type) { - + $typeMap = array( + 'R_SO_4_', //歌曲 + 'R_MV_5_', //mv + 'A_PL_0_', //歌单 + 'R_AL_3_', //专辑 + 'A_DJ_1_' //电台 + ); + $type = $typeMap[$type]; + $Request = new Request(); + $data = array( + 'threadId' => $type . $id, + 'commentId' => $cid, + 'csrf_token' => '', + ); + $action = $t == 1 ? 'like' : 'unlike'; + $response = $Request->createWebAPIRequest( + "http://music.163.com", + "/weapi/v1/comment/{$action}", + 'POST', + $data + ); + return \GuzzleHttp\json_decode($response, true); } + } \ No newline at end of file diff --git a/src/NeteaseCloudMusicApiSdk/Dj.php b/src/NeteaseCloudMusicApiSdk/Dj.php new file mode 100644 index 0000000..605c8ca --- /dev/null +++ b/src/NeteaseCloudMusicApiSdk/Dj.php @@ -0,0 +1,219 @@ + + * Date: 2017/8/19 + * Time: 19:22 + */ + +namespace NeteaseCloudMusicApiSdk; + +use PhpBoot\Application; +use PhpBoot\DI\Traits\EnableDIAnnotations; +use Utils\Request; +use Utils\Snoopy; + +class Dj +{ + + use EnableDIAnnotations; + + /** + * 电台-推荐 + * 说明:登陆后调用此接口,可获得推荐电台 + * + * 接口地址: + * /dj/recommend + * + * 调用例子: + * /dj/recommend + * + * @route GET /dj/recommend + * @return string json + */ + public function recommend() + { + $Request = new Request(); + $data = array( + 'csrf_token' => '', + ); + $response = $Request->createWebAPIRequest( + "http://music.163.com", + "/weapi/djradio/recommend/v1", + 'POST', + $data + ); + return json_decode($response, true); + } + + + /** + * 电台-分类 + * 说明:登陆后调用此接口,可获得电台类型 + * + * 接口地址: + * /dj/catelist + * + * 调用例子: + * /dj/catelist + * + * @route GET /dj/catelist + * @return string json + */ + public function catelist() + { + $Request = new Request(); + $data = array( + 'csrf_token' => '', + ); + $response = $Request->createWebAPIRequest( + "http://music.163.com", + "/weapi/djradio/category/get", + 'POST', + $data + ); + return json_decode($response, true); + } + + + /** + * 电台-分类推荐 + * 说明:登陆后调用此接口,可获得推荐电台 + * + * 必选参数: + * type: 电台类型,数字,可通过/dj/catelist获取,对应关系为 id 对应 此接口的 type, name 对应类型意义 + * + * 接口地址: + * /dj/recommend/type + * + * 调用例子: + * /dj/recommend/type?type=1 + * + * @route GET /dj/recommend/type + * @param int $type + * @return string json + */ + public function type($type) + { + $Request = new Request(); + $data = array( + 'csrf_token' => '', + 'cateId' => $type, + ); + $response = $Request->createWebAPIRequest( + "http://music.163.com", + "/weapi/djradio/recommend", + 'POST', + $data + ); + return json_decode($response, true); + } + + + /** + * 电台-订阅 + * 说明:登陆后调用此接口,传入rid,可订阅 dj,dj 的 rid 可通过搜索指定 type='1009'获取其 id,如/search?keywords=代码时间&type=1009 + * + * 必选参数: + * rid: 电台 的 id + * + * 接口地址: + * /dj/sub + * + * 调用例子: + * /dj/sub?rid=336355127&t=1 (对应关注'代码时间') + * /dj/sub?rid=336355127&t=0 (对应取消关注'代码时间') + * + * @route GET /dj/sub + * @param int $rid + * @return string json + */ + public function sub($rid, $t = 1) + { + $Request = new Request(); + $data = array( + 'csrf_token' => '', + 'id' => $rid, + ); + $action = $t == 1 ? 'sub' : 'unsub'; + $response = $Request->createWebAPIRequest( + "http://music.163.com", + "/weapi/djradio/{$action}", + 'POST', + $data + ); + return json_decode($response, true); + } + + + /** + * 电台-详情 + * 说明:登陆后调用此接口,传入rid,可获得对应电台的详情介绍 + * + * 必选参数: + * rid: 电台 的 id + * + * 接口地址: + * /dj/detail?rid=336355127 + * + * 调用例子: + * /dj/detail?rid=336355127 (对应'代码时间'的详情介绍) + * + * @route GET /dj/detail + * @param int $rid + * @return string json + */ + public function detail($rid) + { + $Request = new Request(); + $data = array( + 'csrf_token' => '', + 'id' => $rid, + ); + $response = $Request->createWebAPIRequest( + "http://music.163.com", + "/weapi/djradio/get", + 'POST', + $data + ); + return json_decode($response, true); + } + + + /** + * 电台-节目 + * 说明:登陆后调用此接口,传入rid,可查看对应电台的电台节目以及对应的 id, 需要注意的是这个接口返回的 mp3Url 已经无效,都为 null, 但是通过调用 /music/url 这个接口,传入节目 id 仍然能获取到节目音频,如 /music/url?id=478446370 获取代码时间的一个节目的音频 + * + * 必选参数: + * rid: 电台 的 id + * + * 接口地址: + * /dj/sub + * + * 调用例子: + * /dj/program?rid=336355127 (对应'代码时间'的节目列表) + * + * @route GET /dj/program + * @param int $rid + * @return string json + */ + public function program($rid, $limit = 30, $offset = 0) + { + $Request = new Request(); + $data = array( + 'csrf_token' => '', + 'asc' => '', + 'radioId' => $rid, + 'limit' => $limit, + 'offset' => $offset, + ); + $response = $Request->createWebAPIRequest( + "http://music.163.com", + "/weapi/dj/program/byradio", + 'POST', + $data + ); + return json_decode($response, true); + } + +} \ No newline at end of file diff --git a/src/NeteaseCloudMusicApiSdk/Event.php b/src/NeteaseCloudMusicApiSdk/Event.php new file mode 100644 index 0000000..e1deb5b --- /dev/null +++ b/src/NeteaseCloudMusicApiSdk/Event.php @@ -0,0 +1,55 @@ + + * Date: 2017/8/19 + * Time: 19:22 + */ + +namespace NeteaseCloudMusicApiSdk; + +use PhpBoot\Application; +use PhpBoot\DI\Traits\EnableDIAnnotations; +use Utils\Request; +use Utils\Snoopy; + +class Event +{ + + use EnableDIAnnotations; + + + + /** + * 获取动态消息 + * 说明:调用此接口,可获取各种动态,对应网页版网易云,朋友界面里的各种动态消息,如分享的视频,音乐,照片等! + * + * 必选参数: + * 未知 + * + * 接口地址: + * /event + * + * 调用例子: + * /event + * + * @route GET /event + * @return string json + */ + public function event() + { + $Request = new Request(); + $data = array( + 'csrf_token' => '', + ); + $response = $Request->createWebAPIRequest( + "http://music.163.com", + "/weapi/v1/event/get", + 'POST', + $data + ); + return json_decode($response, true); + } + + +} \ No newline at end of file diff --git a/src/NeteaseCloudMusicApiSdk/Like.php b/src/NeteaseCloudMusicApiSdk/Like.php new file mode 100644 index 0000000..b4c22a1 --- /dev/null +++ b/src/NeteaseCloudMusicApiSdk/Like.php @@ -0,0 +1,64 @@ + + * Date: 2017/8/19 + * Time: 19:22 + */ + +namespace NeteaseCloudMusicApiSdk; + +use PhpBoot\Application; +use PhpBoot\DI\Traits\EnableDIAnnotations; +use Utils\Request; +use Utils\Snoopy; + +class Like +{ + + use EnableDIAnnotations; + + + /** + * + * 喜欢音乐 + * 说明:调用此接口,传入音乐 id, 可喜欢该音乐 + * + * 必选参数: + * id: 歌曲 id + * + * 可选参数: + * like: 布尔值,默认为 true 即喜欢,若传 false, 则取消喜欢 + * + * 接口地址: + * /like + * + * 调用例子: + * /like?id=347230 + * + * @route GET /like + * @param int $id + * @param boolean $like + * @param int $alg + * @param int $time + * @return string json + */ + public function songs($id, $like = true, $alg = 'itembased', $time = 25) + { + $trackId = $id; + $Request = new Request(); + $data = array( + 'trackId' => $trackId, + 'like' => $like, + 'csrf_token' => '', + ); + $response = $Request->createWebAPIRequest( + "http://music.163.com", + "/weapi/radio/like?alg={$alg}&trackId={$trackId}&like={$like}&time={$time}", + 'POST', + $data + ); + return \GuzzleHttp\json_decode($response, true); + } + +} \ No newline at end of file diff --git a/src/NeteaseCloudMusicApiSdk/Login.php b/src/NeteaseCloudMusicApiSdk/Login.php index 3462542..2cd446a 100644 --- a/src/NeteaseCloudMusicApiSdk/Login.php +++ b/src/NeteaseCloudMusicApiSdk/Login.php @@ -32,19 +32,19 @@ class Login * /login/cellphone * * 调用例子: - * /login/cellphone?phone=xxx&password=yyy + * /login/cellphone?phone=xxx&pw=yyy * * @route GET /login/cellphone * @param string $phone - * @param string $pass + * @param string $pw * @return string json */ - public function cellPhoneLogin($phone, $pass) + public function login($phone, $pw) { $Request = new Request(); $data = array( 'phone' => $phone, - 'password' => md5($pass), + 'password' => md5($pw), 'rememberLogin' => 'true' ); $response = $Request->createWebAPIRequest( diff --git a/src/NeteaseCloudMusicApiSdk/Personalized.php b/src/NeteaseCloudMusicApiSdk/Personalized.php index 4ce8d39..c986013 100644 --- a/src/NeteaseCloudMusicApiSdk/Personalized.php +++ b/src/NeteaseCloudMusicApiSdk/Personalized.php @@ -7,10 +7,16 @@ */ namespace NeteaseCloudMusicApiSdk; - +use PhpBoot\Application; +use PhpBoot\DI\Traits\EnableDIAnnotations; +use Utils\Request; +use Utils\Snoopy; class Personalized { + + use EnableDIAnnotations; + /** * * 推荐歌单 diff --git a/src/NeteaseCloudMusicApiSdk/Playlist.php b/src/NeteaseCloudMusicApiSdk/Playlist.php index 37bc3fd..b50f3e7 100644 --- a/src/NeteaseCloudMusicApiSdk/Playlist.php +++ b/src/NeteaseCloudMusicApiSdk/Playlist.php @@ -60,4 +60,43 @@ public function detail($id, $offset = 0, $total = true, $limit = 1000, $n = 1000 } + //TODO 未测试 + /** + * 收藏单曲到歌单 + * 说明:调用此接口,传入音乐 id和 limit 参数, 可获得该专辑的所有评论(需要登录) + * + * 必选参数: + * op: 从歌单增加单曲为add,删除为 del pid: 歌单id tracks: 歌曲id + * + * 接口地址: + * /playlist/tracks + * + * 调用例子: + * /playlist/tracks?op=add&pid=24381616&tracks=347230 (对应把'海阔天空'添加到'我'的歌单,测试的时候请把这里的 pid换成你自己的) + * @route GET /playlist/tracks + * @param int $pid + * @param string $op + * @param int $tracks + * @return string json + * + */ + public function tracks($pid,$tracks,$op = 'add') + { + $Request = new Request(); + $data = array( + 'op' => $op, + 'pid' => $pid, + 'tracks' => $tracks, + 'trackIds' => "[$tracks]", + 'csrf_token' => '', + ); + $response = $Request->createWebAPIRequest( + "http://music.163.com", + "/weapi/playlist/manipulate/tracks", + 'POST', + $data + ); + return \GuzzleHttp\json_decode($response, true); + } + } \ No newline at end of file diff --git a/src/NeteaseCloudMusicApiSdk/Search.php b/src/NeteaseCloudMusicApiSdk/Search.php index 84435ee..db4e093 100644 --- a/src/NeteaseCloudMusicApiSdk/Search.php +++ b/src/NeteaseCloudMusicApiSdk/Search.php @@ -50,17 +50,17 @@ class Search * /search?keywords=我的一个道姑朋友 * * @route GET /search - * @param string $keyword + * @param string $keywords * @param int $limit * @param int $offset * @param int $type * @return string json */ - public function search($keyword, $limit = 30, $offset = 0, $type = 1) + public function search($keywords, $limit = 30, $offset = 0, $type = 1) { $Request = new Request(); $data = array( - 's' => $keyword, + 's' => $keywords, 'type' => $type, 'limit' => $limit, 'total' => 'true', diff --git a/src/NeteaseCloudMusicApiSdk/TrashFm.php b/src/NeteaseCloudMusicApiSdk/TrashFm.php new file mode 100644 index 0000000..980876a --- /dev/null +++ b/src/NeteaseCloudMusicApiSdk/TrashFm.php @@ -0,0 +1,59 @@ + + * Date: 2017/8/19 + * Time: 19:22 + */ + +namespace NeteaseCloudMusicApiSdk; + +use PhpBoot\Application; +use PhpBoot\DI\Traits\EnableDIAnnotations; +use Utils\Request; +use Utils\Snoopy; + +class TrashFm +{ + + use EnableDIAnnotations; + + /** + * + * 垃圾桶 + * 说明:调用此接口,传入音乐 id, 可把该音乐从私人 FM中移除至垃圾桶 + * + * 必选参数: + * id: 歌曲 id + * + * 接口地址: + * /fm_trash + * + * 调用例子: + * /fm_trash?id=347230 + * + * @route GET /fm_trash + * @param int $id + * @param int $alg + * @param int $time + * @return string json + */ + public function fm_trash($id, $alg = 'RT', $time = 25) + { + $songId = $id; + $Request = new Request(); + $data = array( + 'songId' => $songId, + 'csrf_token' => '', + ); + $response = $Request->createWebAPIRequest( + "http://music.163.com", + "/weapi/radio/trash/add?alg={$alg}&songId={$songId}&time={$time}", + 'POST', + $data + ); + return \GuzzleHttp\json_decode($response, true); + } + + +} \ No newline at end of file diff --git a/src/NeteaseCloudMusicApiSdk/User.php b/src/NeteaseCloudMusicApiSdk/User.php index 771c356..98c6f02 100644 --- a/src/NeteaseCloudMusicApiSdk/User.php +++ b/src/NeteaseCloudMusicApiSdk/User.php @@ -13,10 +13,295 @@ use Utils\Request; use Utils\Snoopy; -class T +class User { - + //251183635 use EnableDIAnnotations; + /** + * 获取用户详情 + * 说明:登陆后调用此接口,传入用户 id, 可以获取用户详情 + * + * 必选参数: + * uid : 用户 id + * + * 接口地址: + * /user/detail + * + * 调用例子: + * /user/detail?uid=251183635 + * + * @route GET /user/detail + * @param string $uid + * @return string json + */ + public function detail($uid) + { + $Request = new Request(); + $data = array( + 'csrf_token' => '', + ); + $response = $Request->createWebAPIRequest( + "http://music.163.com", + "/weapi/v1/user/detail/{$uid}", + 'POST', + $data + ); + return json_decode($response, true); + } + + + /** + * 获取用户电台 + * 说明:登陆后调用此接口,传入用户 id, 可以获取用户电台 + * + * 必选参数: + * uid : 用户 id + * + * 接口地址: + * /user/dj + * + * 调用例子: + * /user/dj?uid=251183635 + * + * @route GET /user/dj + * @param string $uid + * @return string json + */ + public function dj($uid) + { + $Request = new Request(); + $data = array( + 'csrf_token' => '', + ); + $response = $Request->createWebAPIRequest( + "http://music.163.com", + "/weapi/dj/program/{$uid}", + 'POST', + $data + ); + return json_decode($response, true); + } + + + /** + * 获取用户关注列表 + * 说明:登陆后调用此接口,传入用户 id, 可以获取用户关注列表 + * + * 必选参数: + * uid : 用户 id + * + * 可选参数: + * limit : 返回数量,默认为30 + * offset : 偏移数量,用于分页,如: 如:(页数-1)*30, 其中 30 为 limit 的值,默认为0 + * + * 接口地址: + * /user/follows + * + * 调用例子: + * /user/follows?uid=251183635 + * + * @route GET /user/follows + * @param string $uid + * @param string $limit + * @param string $offset + * @return string json + */ + public function follows($uid, $limit = 30, $offset = 0) + { + $Request = new Request(); + $data = array( + 'csrf_token' => '', + 'order' => true, + 'limit' => $limit, + 'offset' => $offset, + ); + $response = $Request->createWebAPIRequest( + "http://music.163.com", + "/weapi/user/getfollows/{$uid}", + 'POST', + $data + ); + return json_decode($response, true); + } + + /** + * 获取用户粉丝列表 + * 说明:登陆后调用此接口,传入用户 id, 可以获取用户粉丝列表 + * + * 必选参数: + * uid : 用户 id + * + * 可选参数: + * limit : 返回数量,默认为30 + * offset : 偏移数量,用于分页,如: 如:(页数-1)*30, 其中 30 为 limit 的值,默认为0 + * + * 接口地址: + * /user/followeds + * + * 调用例子: + * /user/followeds?uid=251183635 + * + * @route GET /user/followeds + * @param string $uid + * @param string $limit + * @param string $offset + * @return string json + */ + public function followeds($uid, $limit = 30, $offset = 0) + { + $Request = new Request(); + $data = array( + 'csrf_token' => '', + 'userId' => $uid, + 'limit' => $limit, + 'offset' => $offset, + ); + $response = $Request->createWebAPIRequest( + "http://music.163.com", + "/weapi/user/getfolloweds", + 'POST', + $data + ); + return json_decode($response, true); + } + + /** + * 获取用户动态 + * 说明:登陆后调用此接口,传入用户 id, 可以获取用户动态 + * + * 必选参数: + * uid : 用户 id + * + * 接口地址: + * /user/event + * + * 调用例子: + * /user/event?uid=251183635 + * + * @route GET /user/event + * @param string $uid + * @return string json + */ + public function event($uid) + { + $Request = new Request(); + $data = array( + 'csrf_token' => '', + 'time' => -1, + 'getcounts' => true, + ); + $response = $Request->createWebAPIRequest( + "http://music.163.com", + "/weapi/event/get/{$uid}", + 'POST', + $data + ); + return json_decode($response, true); + } + + + /** + * 获取用户播放记录 + * 说明:登陆后调用此接口,传入用户 id,可获取用户播放记录 + * + * 必选参数: + * uid : 用户 id + * + * 可选参数: + * type : type=1时只返回weekData, type=0时返回allData + * + * 接口地址: + * /user/record + * + * 调用例子: + * /user/record?uid=251183635&type=1 + * + * @route GET /user/record + * @param string $uid + * @param string $type + * @return string json + */ + public function record($uid, $type = 0) + { + $Request = new Request(); + $data = array( + 'csrf_token' => '', + 'type' => $type, + 'uid' => $uid, + ); + $response = $Request->createWebAPIRequest( + "http://music.163.com", + "/weapi/v1/play/record", + 'POST', + $data + ); + return json_decode($response, true); + } + + /** + * 云盘 + * 说明:登陆后调用此接口,可获取云盘数据,获取的数据没有对应 url,需要再调用一次 /music/url 获取 url + * + * 接口地址: + * /user/cloud + * + * 调用例子: + * /user/cloud + * + * @route GET /user/cloud + * @param string $limit + * @param string $offset + * @return string json + */ + public function cloud($limit = 30, $offset = 0) + { + $Request = new Request(); + $data = array( + 'csrf_token' => '', + 'limit' => $limit, + 'offset' => $offset, + ); + $response = $Request->createWebAPIRequest( + "http://music.163.com", + "/weapi/v1/cloud/get", + 'POST', + $data + ); + return json_decode($response, true); + } + + + /** + * 云盘搜索 + * + * 接口地址: + * /user/cloud/search + * + * 调用例子: + * /user/cloud/search?$byids=xxx&id=xxx + * + * @route GET /user/cloud/search + * @param string $byids + * @param string $id + * @return string json + */ + public function search($byids, $id) + { + $Request = new Request(); + $data = array( + 'csrf_token' => '', + 'byids' => $byids, + 'id' => $id, + ); + $response = $Request->createWebAPIRequest( + "http://music.163.com", + "/weapi/v1/cloud/get/byids", + 'POST', + $data + ); + return json_decode($response, true); + } + } \ No newline at end of file diff --git a/src/Utils/Request.php b/src/Utils/Request.php index 409fb4e..42bca70 100644 --- a/src/Utils/Request.php +++ b/src/Utils/Request.php @@ -90,6 +90,9 @@ public function createWebAPIRequest( $this->_USERAGENT = self::randomUserAgent(); $this->snoopy->agent = $this->_USERAGENT; $this->snoopy->rawheaders['Cookies'] = $this->_COOKIE; + $this->snoopy->cookies['__remember_me'] = true; + $this->snoopy->cookies['MUSIC_U'] = isset($_COOKIE['MUSIC_U']) ? $_COOKIE['MUSIC_U'] : null; + $this->snoopy->cookies['__csrf'] = isset($_COOKIE['__csrf']) ? $_COOKIE['__csrf'] : null; $this->snoopy->referer = $this->_REFERER; $this->snoopy->host = 'music.163.com'; $data = $this->prepare($data); @@ -105,7 +108,7 @@ public function PlayMp4( $url ) { - + }