Skip to content

Commit

Permalink
🎄 2.0.4,修复网易云音乐无法播放
Browse files Browse the repository at this point in the history
升级 Meting 到 v1.3.10
  • Loading branch information
metowolf committed Jan 2, 2018
1 parent 69153c4 commit 2178dd7
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 35 deletions.
8 changes: 4 additions & 4 deletions Action.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,14 @@ private function api(){
$url=$data['url'];

if($server=='netease'){
$url=str_replace('://m7c.','://m8.',$url);
$url=str_replace('://m7c.','://m7.',$url);
$url=str_replace('://m8c.','://m8.',$url);
$url=str_replace('http://m8.','https://m8.',$url);
$url=str_replace('http://m7.','https://m8.',$url);
$url=str_replace('http://m8.','https://m9.',$url);
$url=str_replace('http://m7.','https://m9.',$url);
$url=str_replace('http://m10.','https://m10.',$url);
}

if(empty($url))$url='https://api.i-meto.com/Public/music/empty.mp3';
if(empty($url))$url='https://meting.coding.i-meto.com/empty.mp3';
$this->response->redirect($url);
}
else{
Expand Down
4 changes: 2 additions & 2 deletions Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
*
* @package APlayer for Typecho | Meting
* @author METO
* @version 2.0.3
* @version 2.0.4
* @dependence 14.10.10-*
* @link https://github.com/MoePlayer/APlayer-Typecho
*
*/

define('METING_VERSION','2.0.3');
define('METING_VERSION','2.0.4');

class Meting_Plugin extends Typecho_Widget implements Typecho_Plugin_Interface
{
Expand Down
71 changes: 42 additions & 29 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.3.9
* Version 1.3.10
*
* Copyright 2017, METO Sheel <i@i-meto.com>
* Released under the MIT license
Expand Down Expand Up @@ -745,34 +745,47 @@ public function pic($id, $size=300)

private function curlset()
{
$BASE=array(
'netease'=>array(
'referer' => 'https://music.163.com/',
'cookie' => 'os=linux; appver=1.0.0.1026; osver=Ubuntu%2016.10; MUSIC_U=78d411095f4b022667bc8ec49e9a44cca088df057d987f5feaf066d37458e41c4a7d9447977352cf27ea9fee03f6ec4441049cea1c6bb9b6; __remember_me=true',
'useragent' => 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36',
),
'tencent'=>array(
'referer' => 'https://y.qq.com/portal/player.html',
'cookie' => 'pgv_pvi=22038528; pgv_si=s3156287488; pgv_pvid=5535248600; yplayer_open=1; ts_last=y.qq.com/portal/player.html; ts_uid=4847550686; yq_index=0; qqmusic_fromtag=66; player_exist=1',
'useragent' => 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36',
),
'xiami'=>array(
'referer' => 'http://h.xiami.com/',
'cookie' => 'user_from=2;XMPLAYER_addSongsToggler=0;XMPLAYER_isOpen=0;_xiamitoken=123456789;',
'useragent' => 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36',
),
'kugou'=>array(
'referer' => 'http://www.kugou.com/webkugouplayer/flash/webKugou.swf',
'cookie' => '_WCMID=123456789',
'useragent' => 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36',
),
'baidu'=>array(
'referer' => 'http://ting.baidu.com/',
'cookie' => 'BAIDUID=123456789',
'useragent' => 'ios_5.9.12',
),
);
return $BASE[$this->_SITE];
switch ($this->_SITE) {
case 'netease':
return array(
'referer' => 'https://music.163.com/',
'cookie' => 'os=linux; appver=1.0.0.1026; osver=Ubuntu%2016.10; MUSIC_U=' . $this->getRandomHex(112) . '; __remember_me=true',
'useragent' => 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36',
);
case 'tencent':
return array(
'referer' => 'https://y.qq.com/portal/player.html',
'cookie' => 'pgv_pvi=22038528; pgv_si=s3156287488; pgv_pvid=5535248600; yplayer_open=1; ts_last=y.qq.com/portal/player.html; ts_uid=4847550686; yq_index=0; qqmusic_fromtag=66; player_exist=1',
'useragent' => 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36',
);
case 'xiami':
return array(
'referer' => 'http://h.xiami.com/',
'cookie' => 'user_from=2;XMPLAYER_addSongsToggler=0;XMPLAYER_isOpen=0;_xiamitoken=123456789' . $this->getRandomHex(32) . ';',
'useragent' => 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36',
);
case 'kugou':
return array(
'referer' => 'http://www.kugou.com/webkugouplayer/flash/webKugou.swf',
'cookie' => '_WCMID=123456789',
'useragent' => 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36',
);
case 'baidu':
return array(
'referer' => 'http://ting.baidu.com/',
'cookie' => 'BAIDUID=123456789',
'useragent' => 'ios_5.9.12',
);
}
}

private function getRandomHex($length)
{
$val = '';
for( $i=0; $i<$length; $i++ ) {
$val .= chr( rand( 65, 90 ) );
}
return $val;
}

/**
Expand Down

0 comments on commit 2178dd7

Please sign in to comment.