From 2178dd75eacd02729514cd0ed8e7571fa228a5d8 Mon Sep 17 00:00:00 2001 From: meto Date: Tue, 2 Jan 2018 21:53:23 +0800 Subject: [PATCH] =?UTF-8?q?:christmas=5Ftree:=202.0.4=EF=BC=8C=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E7=BD=91=E6=98=93=E4=BA=91=E9=9F=B3=E4=B9=90=E6=97=A0?= =?UTF-8?q?=E6=B3=95=E6=92=AD=E6=94=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 升级 Meting 到 v1.3.10 --- Action.php | 8 +++--- Plugin.php | 4 +-- include/Meting.php | 71 +++++++++++++++++++++++++++------------------- 3 files changed, 48 insertions(+), 35 deletions(-) diff --git a/Action.php b/Action.php index 8268420..3e3cc6a 100644 --- a/Action.php +++ b/Action.php @@ -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{ diff --git a/Plugin.php b/Plugin.php index da7684c..7febb5d 100644 --- a/Plugin.php +++ b/Plugin.php @@ -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 { diff --git a/include/Meting.php b/include/Meting.php index 538a69e..154e541 100644 --- a/include/Meting.php +++ b/include/Meting.php @@ -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 * Released under the MIT license @@ -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; } /**