Skip to content
This repository has been archived by the owner on Jun 25, 2019. It is now read-only.

Commit

Permalink
更新咪咕接口,支持 320k 音频
Browse files Browse the repository at this point in the history
  • Loading branch information
maicong committed May 24, 2018
1 parent 42c94e5 commit cec41da
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 15 deletions.
27 changes: 14 additions & 13 deletions core/music.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*
* @author MaiCong <[email protected]>
* @link https://github.com/maicong/music
* @since 1.5.8
* @since 1.6.0
*
*/

Expand Down Expand Up @@ -358,7 +358,7 @@ function mc_song_urls($value, $type = 'query', $site = 'netease', $page = 1)
],
'migu' => [
'method' => 'GET',
'url' => 'http://m.10086.cn/migu/remoting/cms_detail_tag',
'url' => 'http://music.migu.cn/v2/async/audioplayer/playurl/' . $songid,
'referer' => 'http://m.10086.cn',
'proxy' => false,
'body' => [
Expand All @@ -371,9 +371,7 @@ function mc_song_urls($value, $type = 'query', $site = 'netease', $page = 1)
'url' => 'http://m.lizhi.fm/api/audios_with_radio',
'referer' => 'http://m.lizhi.fm',
'proxy' => false,
'body' => [
'ids' => $songid
],
'body' => false,
'user-agent' => 'Mozilla/5.0 (iPhone; CPU iPhone OS 9_1 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Version/9.0 Mobile/13B143 Safari/601.1'
],
'qingting' => [
Expand Down Expand Up @@ -912,20 +910,23 @@ function mc_get_song_by_id($songid, $site = 'netease', $multi = false)
break;
case 'migu':
foreach ($radio_result as $val) {
$radio_json = json_decode($val, true);
$radio_data = $radio_json['data'];
$radio_data = json_decode($val, true);
if (!empty($radio_data)) {
$radio_song_id = $radio_data['songId'];
$radio_author = implode(',', $radio_data['singerName']);
$radio_song_id = $radio_data['musicId'];
$radio_authors = [];
foreach ($radio_data['artistInfoList'] as $author) {
$radio_authors[] = $author['artistName'];
}
$radio_author = implode(',', $radio_authors);
$radio_songs[] = [
'type' => 'migu',
'link' => 'http://music.migu.cn/v2/music/song/' . $radio_song_id,
'songid' => $radio_song_id,
'title' => $radio_data['songName'],
'title' => $radio_data['musicName'],
'author' => $radio_author,
'lrc' => $radio_data['lyricLrc'],
'url' => $radio_data['listenUrl'] ?: $radio_data['sst']['listenUrl'],
'pic' => $radio_data['picL']
'lrc' => $radio_data['dynamicLyric'],
'url' => $radio_data['songAuditionUrl'],
'pic' => $radio_data['smallPic']
];
}
}
Expand Down
4 changes: 2 additions & 2 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
*
* @author MaiCong <[email protected]>
* @link https://github.com/maicong/music
* @since 1.5.10
* @since 1.6.0
*
*/

// 定义核心
define('MC_CORE', true);

// 定义版本
define('MC_VERSION', '1.5.10');
define('MC_VERSION', '1.6.0');

// 核心文件目录
define('MC_CORE_DIR', __DIR__ . '/core');
Expand Down

0 comments on commit cec41da

Please sign in to comment.