Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🥝 1.5.7, Updated xiami API · metowolf/Meting@54178aa112da5db09f487d86… #158

Merged
merged 1 commit into from
May 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions hermit.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
Plugin Name: Hermit X
Plugin URI: https://blog.lwl12.com/read/hermit-x.html
Description: 音乐播放器 Hermit music player build for wordpress with APlayer
Version: 2.9.6
Version: 2.9.7
Author: Hermit X Developer Team
Author URI: https://blog.lwl12.com/read/hermit-x.html#developer
*/

define('HERMIT_FILE', __FILE__);
define('HERMIT_VERSION', '2.9.6');
define('HERMIT_VERSION', '2.9.7');
define('HERMIT_URL', plugins_url('', __FILE__));
define('HERMIT_PATH', dirname(__FILE__));
define('HERMIT_ADMIN_URL', admin_url());
Expand Down
22 changes: 11 additions & 11 deletions include/Meting.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Meting music framework
* https://i-meto.com
* https://github.com/metowolf/Meting
* Version 1.5.6.
* Version 1.5.7.
*
* Copyright 2019, METO Sheel <i@i-meto.com>
* Released under the MIT license
Expand All @@ -13,7 +13,7 @@

class Meting
{
const VERSION = '1.5.6';
const VERSION = '1.5.7';

public $raw;
public $data;
Expand Down Expand Up @@ -192,7 +192,7 @@ public function search($keyword, $option = null)
case 'xiami':
$api = array(
'method' => 'GET',
'url' => 'http://h5api.m.xiami.com/h5/mtop.alimusic.search.searchservice.searchsongs/1.0/',
'url' => 'https://acs.m.xiami.com/h5/mtop.alimusic.search.searchservice.searchsongs/1.0/',
'body' => array(
'data' => array(
'key' => $keyword,
Expand Down Expand Up @@ -278,7 +278,7 @@ public function song($id)
case 'xiami':
$api = array(
'method' => 'GET',
'url' => 'http://h5api.m.xiami.com/h5/mtop.alimusic.music.songservice.getsongdetail/1.0/',
'url' => 'https://acs.m.xiami.com/h5/mtop.alimusic.music.songservice.getsongdetail/1.0/',
'body' => array(
'data' => array(
'songId' => $id,
Expand Down Expand Up @@ -357,7 +357,7 @@ public function album($id)
case 'xiami':
$api = array(
'method' => 'GET',
'url' => 'http://h5api.m.xiami.com/h5/mtop.alimusic.music.albumservice.getalbumdetail/1.0/',
'url' => 'https://acs.m.xiami.com/h5/mtop.alimusic.music.albumservice.getalbumdetail/1.0/',
'body' => array(
'data' => array(
'albumId' => $id,
Expand Down Expand Up @@ -438,7 +438,7 @@ public function artist($id, $limit = 50)
case 'xiami':
$api = array(
'method' => 'GET',
'url' => 'http://h5api.m.xiami.com/h5/mtop.alimusic.music.songservice.getartistsongs/1.0/',
'url' => 'https://acs.m.xiami.com/h5/mtop.alimusic.music.songservice.getartistsongs/1.0/',
'body' => array(
'data' => array(
'artistId' => $id,
Expand Down Expand Up @@ -523,7 +523,7 @@ public function playlist($id)
case 'xiami':
$api = array(
'method' => 'GET',
'url' => 'http://h5api.m.xiami.com/h5/mtop.alimusic.music.list.collectservice.getcollectdetail/1.0/',
'url' => 'https://acs.m.xiami.com/h5/mtop.alimusic.music.list.collectservice.getcollectdetail/1.0/',
'body' => array(
'data' => array(
'listId' => $id,
Expand Down Expand Up @@ -603,7 +603,7 @@ public function url($id, $br = 320)
case 'xiami':
$api = array(
'method' => 'GET',
'url' => 'http://h5api.m.xiami.com/h5/mtop.alimusic.music.songservice.getsongs/1.0/',
'url' => 'https://acs.m.xiami.com/h5/mtop.alimusic.music.songservice.getsongs/1.0/',
'body' => array(
'data' => array(
'songIds' => array(
Expand Down Expand Up @@ -693,7 +693,7 @@ public function lyric($id)
case 'xiami':
$api = array(
'method' => 'GET',
'url' => 'http://h5api.m.xiami.com/h5/mtop.alimusic.music.lyricservice.getsonglyrics/1.0/',
'url' => 'https://acs.m.xiami.com/h5/mtop.alimusic.music.lyricservice.getsonglyrics/1.0/',
'body' => array(
'data' => array(
'songId' => $id,
Expand Down Expand Up @@ -935,7 +935,7 @@ private function baidu_AESCBC($api)

private function xiami_sign($api)
{
$data = $this->curl('http://h5api.m.xiami.com/h5/mtop.alimusic.search.searchservice.searchsongs/1.0/?appKey=12574478&t=1511168684000&dataType=json&data=%7B%22requestStr%22%3A%22%7B%5C%22model%5C%22%3A%7B%5C%22key%5C%22%3A%5C%22Dangerous+Woman%5C%22%2C%5C%22pagingVO%5C%22%3A%7B%5C%22page%5C%22%3A1%2C%5C%22pageSize%5C%22%3A30%7D%7D%7D%22%7D&api=mtop.alimusic.search.searchservice.searchsongs&v=1.0&type=originaljson&sign=f6c99a429e9ef703ea955f7cd113a467', null, 1);
$data = $this->curl('https://acs.m.xiami.com/h5/mtop.alimusic.recommend.songservice.getdailysongs/1.0/?appKey=12574478&t=1560663823000&dataType=json&data=%7B%22requestStr%22%3A%22%7B%5C%22header%5C%22%3A%7B%5C%22platformId%5C%22%3A%5C%22mac%5C%22%7D%2C%5C%22model%5C%22%3A%5B%5D%7D%22%7D&api=mtop.alimusic.recommend.songservice.getdailysongs&v=1.0&type=originaljson&sign=22ad1377ee193f3e2772c17c6192b17c', null, 1);
preg_match_all('/_m_h5[^;]+/', $data->raw, $match);
$this->header['Cookie'] = $match[0][0].'; '.$match[0][1];
$data = json_encode(array(
Expand Down Expand Up @@ -1362,4 +1362,4 @@ private function format_baidu($data)

return $result;
}
}
}