From cfb30fa2b900986e99fc2ce40e335672ec7fed66 Mon Sep 17 00:00:00 2001 From: METO Date: Tue, 13 Jun 2017 10:26:34 +0800 Subject: [PATCH] [update] Code improvement --- README.md | 1 + src/Meting.php | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 584318a..03e4801 100644 --- a/README.md +++ b/README.md @@ -61,6 +61,7 @@ echo $data; - [Hermit-X (Wordpress)](https://github.com/liwanglin12/Hermit-X) - [Meting for Typecho](https://github.com/metowolf/Meting-Typecho-Plugin) - [MKOnlineMusicPlayer](https://github.com/mengkunsoft/MKOnlineMusicPlayer) + - [WP-Player](https://github.com/webjyh/WP-Player) ## License Meting is under the MIT license. diff --git a/src/Meting.php b/src/Meting.php index e123691..36af515 100644 --- a/src/Meting.php +++ b/src/Meting.php @@ -615,7 +615,7 @@ class Meting ); break; } - $this->_temp['br']=$br; + $this->_TEMP['br']=$br; return $this->curl($API); } @@ -729,7 +729,7 @@ class Meting $data=$this->format(false)->song($id); $this->format($format); $data=json_decode($data, 1); - $url=$data['songinfo']['pic_big']?:$data['songinfo']['pic_small']; + $url=isset($data['songinfo']['pic_big'])?$data['songinfo']['pic_big']:$data['songinfo']['pic_small']; break; } return json_encode(array('url'=>$url)); @@ -868,7 +868,7 @@ class Meting 'size_48aac' => array(48 ,'C200','m4a'), ); foreach ($type as $key=>$vo) { - if ($data['data'][0]['file'][$key]&&$vo[0]<=$this->_temp['br']) { + if ($data['data'][0]['file'][$key]&&$vo[0]<=$this->_TEMP['br']) { $url=array( 'url' => 'http://dl.stream.qqmusic.qq.com/'.$vo[1].$data['data'][0]['file']['media_mid'].'.'.$vo[2].'?vkey='.$KEY.'&guid='.$GUID.'&uid=0&fromtag=30', 'br' => $vo[0], @@ -929,7 +929,7 @@ class Meting $max=0; $url=array(); foreach ($data['data'][0]['relate_goods'] as $vo) { - if ($vo['info']['bitrate']<=$this->_temp['br']&&$vo['info']['bitrate']>$max) { + if ($vo['info']['bitrate']<=$this->_TEMP['br']&&$vo['info']['bitrate']>$max) { $API=array( 'method' => 'GET', 'url' => 'http://trackercdn.kugou.com/i/v2/',