From 9ca611c898c867ea16068acc5db795a3400ffc40 Mon Sep 17 00:00:00 2001
From: METO
Date: Tue, 5 Sep 2017 23:37:59 +0800
Subject: [PATCH] =?UTF-8?q?[1.2.5]=20=E6=96=B0=E5=A2=9E=20cookie=20?=
=?UTF-8?q?=E6=8E=A5=E5=8F=A3=EF=BC=8C=E6=9B=B4=E6=96=B0=20Meting=20?=
=?UTF-8?q?=E5=BA=93?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 新增用户自定义 cookie 设置
- 更新 Meting v1.5.8
- 更新 APlayer 1.6.1-beta
- 修复 PHP notice 警告
- 修复一些 bug
---
Action.php | 24 ++++++++++++++++++------
Plugin.php | 15 +++++++++------
README.md | 10 ++++++----
assets/APlayer.min.js | 1 -
include/Meting.php | 32 ++++++++++++++++++++------------
5 files changed, 53 insertions(+), 29 deletions(-)
diff --git a/Action.php b/Action.php
index 43f848a..a52cb58 100644
--- a/Action.php
+++ b/Action.php
@@ -101,11 +101,11 @@ class Meting_Action extends Typecho_Widget implements Widget_Interface_Do {
$music=array_merge($music,$t);
}
$player=array(
- 'theme' => $setting['theme']?:Typecho_Widget::widget('Widget_Options')->plugin('Meting')->theme?:'red',
- 'preload' => $setting['preload']?:Typecho_Widget::widget('Widget_Options')->plugin('Meting')->preload?:'auto',
- 'autoplay' => $setting['autoplay']?:Typecho_Widget::widget('Widget_Options')->plugin('Meting')->autoplay?:'false',
- 'height' => $setting['height']?:Typecho_Widget::widget('Widget_Options')->plugin('Meting')->height?:'340px',
- 'mode' => $setting['mode']?:Typecho_Widget::widget('Widget_Options')->plugin('Meting')->mode?:'circulation',
+ 'theme' => isset($setting['theme'])?$setting['theme']:Typecho_Widget::widget('Widget_Options')->plugin('Meting')->theme?:'red',
+ 'preload' => isset($setting['preload'])?$setting['preload']:Typecho_Widget::widget('Widget_Options')->plugin('Meting')->preload?:'auto',
+ 'autoplay' => isset($setting['autoplay'])?$setting['autoplay']:Typecho_Widget::widget('Widget_Options')->plugin('Meting')->autoplay?:'false',
+ 'height' => isset($setting['height'])?$setting['height']:Typecho_Widget::widget('Widget_Options')->plugin('Meting')->height?:'340px',
+ 'mode' => isset($setting['mode'])?$setting['mode']:Typecho_Widget::widget('Widget_Options')->plugin('Meting')->mode?:'circulation',
'music' => array(),
);
foreach($music as $vo){
@@ -143,15 +143,21 @@ class Meting_Action extends Typecho_Widget implements Widget_Interface_Do {
$id=$this->request->get('id');
$site=$this->request->get('site');
$rate=Typecho_Widget::widget('Widget_Options')->plugin('Meting')->bitrate;
+ $cookie=Typecho_Widget::widget('Widget_Options')->plugin('Meting')->cookie;
$cachekey="url/{$site}/{$id}/{$rate}";
$data=self::cacheRead($cachekey,60*15);
if(!$data){
- $data=(new \Metowolf\Meting($site))->format()->url($id,$rate);
+ $api=(new \Metowolf\Meting($site));
+ if($cookie!='')$api->cookie($cookie);
+ $data=$api->format(true)->url($id,$rate);
$data=json_decode($data,1);
self::cacheWrite($cachekey,$data);
}
if(empty($data['url']))$data['url']="https://api.i-meto.com/Public/music/empty.mp3";
+ if($site=='netease'){
+ $data['url']=str_replace("http://","https://",$data['url']);
+ }
$this->response->redirect($data['url']);
}
@@ -230,6 +236,12 @@ class Meting_Action extends Typecho_Widget implements Widget_Interface_Do {
else return false;
}
+ /*private function cacheFlush(){
+ $db=Typecho_Db::get();
+ $delete=$db->delete('table.metingv1')->where('last',time());
+ $db->query($delete);
+ }*/
+
private function filterReferer(){
if(isset($_SERVER['HTTP_REFERER'])&&strpos($_SERVER['HTTP_REFERER'],$_SERVER['HTTP_HOST'])===false){
http_response_code(403);
diff --git a/Plugin.php b/Plugin.php
index 81d3777..2521563 100644
--- a/Plugin.php
+++ b/Plugin.php
@@ -6,13 +6,13 @@ if(!defined('__TYPECHO_ROOT_DIR__'))exit;
*
* @package Meting
* @author METO
- * @version 1.2.4
+ * @version 1.2.5
* @dependence 14.10.10-*
* @link https://github.com/metowolf/Meting-Typecho-Plugin
*
*/
-define('METING_VERSION','1.2.4');
+define('METING_VERSION','1.2.5');
class Meting_Plugin extends Typecho_Widget implements Typecho_Plugin_Interface
{
@@ -91,6 +91,11 @@ class Meting_Plugin extends Typecho_Widget implements Typecho_Plugin_Interface
_t('默认音质'),
_t(''));
$form->addInput($t);
+ $t = new Typecho_Widget_Helper_Form_Element_Text(
+ 'cookie', null, '',
+ _t('自定义 Cookie (高级)'),
+ _t('通过更改 Cookie,使其享受与客户端一样的体验'));
+ $form->addInput($t);
}
public static function personalConfig(Typecho_Widget_Helper_Form $form){}
@@ -107,15 +112,13 @@ class Meting_Plugin extends Typecho_Widget implements Typecho_Plugin_Interface
$ver=METING_VERSION;
echo "\n";
echo "\n";
- if(Typecho_Widget::widget('Widget_Options')->plugin('Meting')->cloudapi=='true'){
- echo "\n";
- }
echo "\n";
}
public static function footer(){
+ $ver=METING_VERSION;
if(Typecho_Widget::widget('Widget_Options')->plugin('Meting')->cloudapi=='true'){
- echo "\n";
+ echo "\n";
}
}
diff --git a/README.md b/README.md
index 7788f88..4e28852 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,8 @@
-![](http://ww2.sinaimg.cn/large/a15b4afegw1fbg1l7wn09j20fw05gq34)
+
+
+
-# Meting for Typecho
+# APlayer for Typecho (Meting)
在 Typecho 中使用 APlayer 播放在线音乐吧~
[发布页面](https://i-meto.com/meting-typecho/)
@@ -8,7 +10,7 @@
1. 支持国内五大音乐平台(网易云、QQ、虾米、百度、酷狗)的单曲/专辑/歌单播放
2. 简单快捷,复制音乐详情页面网址,后台自动生成播放代码
3. **支持不同音乐平台歌曲混合播放**
- 4. 前端 Aplayer,后端 Meting 及时更新,保证兼容性及 API 高可用性
+ 4. 前端 APlayer,后端 Meting 及时更新,保证兼容性及 API 高可用性
5. 支持 MySql、SQLite 数据库
## 声明
@@ -65,4 +67,4 @@ A: 为了减少服务器压力,插件设置对歌单、歌词数据进行缓
更多问题可以通过 issue 页面提交,或者通过 Telegram、邮件向我反馈
## LICENSE
-Meting-Typecho-Plugin is under the MIT license.
+APlayer-Typecho-Plugin is under the MIT license.
diff --git a/assets/APlayer.min.js b/assets/APlayer.min.js
index 0f0d4ba..eae8e04 100644
--- a/assets/APlayer.min.js
+++ b/assets/APlayer.min.js
@@ -1,2 +1 @@
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("APlayer",[],t):"object"==typeof exports?exports.APlayer=t():e.APlayer=t()}(this,function(){return function(e){function t(n){if(a[n])return a[n].exports;var r=a[n]={i:n,l:!1,exports:{}};return e[n].call(r.exports,r,r.exports,t),r.l=!0,r.exports}var a={};return t.m=e,t.c=a,t.i=function(e){return e},t.d=function(e,a,n){t.o(e,a)||Object.defineProperty(e,a,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var a=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(a,"a",a),a},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=1)}([function(e,t,a){var n=a(2);"string"==typeof n&&(n=[[e.i,n,""]]);var r={};r.transform=void 0;a(4)(n,r);n.locals&&(e.exports=n.locals)},function(e,t,a){"use strict";function n(e){if(Array.isArray(e)){for(var t=0,a=Array(e.length);t\n \n \n \n '},this.isMobile=/mobile/i.test(window.navigator.userAgent),this.isMobile&&(t.autoplay=!1);var s={element:document.getElementsByClassName("aplayer")[0],narrow:!1,autoplay:!1,mutex:!0,showlrc:0,theme:"#b7daff",mode:"circulation"};for(var p in s)s.hasOwnProperty(p)&&!t.hasOwnProperty(p)&&(t[p]=s[p]);if(this.option=t,this.audios=[],this.mode=t.mode,this.secondToTime=function(e){if(isNaN(e))return"00:00";var t=function(e){return e<10?"0"+e:""+e},a=parseInt(e/60),n=parseInt(e-60*a),r=parseInt(a/60),i=parseInt(e/60-60*parseInt(e/60/60));return e>=3600?t(r)+":"+t(i)+":"+t(n):t(a)+":"+t(n)},this.element=this.option.element,2===this.option.showlrc||!0===this.option.showlrc){this.savelrc=[];for(var c=0;c0?t:0,t=t<1?t:1,m[e+"Bar"].style[a]=100*t+"%"},this.updateLrc=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i.audio.currentTime;if(i.lrcIndex>i.lrc.length-1||e=i.lrc[i.lrcIndex+1][0])for(var t=0;t=i.lrc[t][0]&&(!i.lrc[t+1]||e1&&this.element.classList.add("aplayer-withlist"),this.multiple||"circulation"===this.mode||"order"===this.mode||(this.mode="circulation"),this.getRandomOrder();for(var y='\n \n
\n \n
\n
\n \n
\n \n \n
\n
\n
\n
\n
\n
\n - 00:00 / 00:00\n \n
\n
\n
\n
\n
\n \n
\n
\n
\n \n
',h=0;h\n \n '+(h+1)+'\n '+this.option.music[h].title+'\n '+this.option.music[h].author+"\n ";y+="\n
\n
",this.element.innerHTML=y,this.element.offsetWidth<300&&(this.element.getElementsByClassName("aplayer-icon-mode")[0].style.display="none"),this.ptime=this.element.getElementsByClassName("aplayer-ptime")[0],this.element.getElementsByClassName("aplayer-info")[0].offsetWidth<200&&this.element.getElementsByClassName("aplayer-time")[0].classList.add("aplayer-time-narrow");var m={};m.barWrap=this.element.getElementsByClassName("aplayer-bar-wrap")[0],this.option.narrow&&this.element.classList.add("aplayer-narrow"),this.button=this.element.getElementsByClassName("aplayer-button")[0],this.button.addEventListener("click",function(e){i.toggle()});var f=this.element.getElementsByClassName("aplayer-list")[0];f.addEventListener("click",function(e){var t=void 0;t="LI"===e.target.tagName.toUpperCase()?e.target:e.target.parentElement;var a=parseInt(t.getElementsByClassName("aplayer-list-index")[0].innerHTML)-1;a!==i.playIndex?(i.setMusic(a),i.play()):i.toggle()}),m.playedBar=this.element.getElementsByClassName("aplayer-played")[0],m.loadedBar=this.element.getElementsByClassName("aplayer-loaded")[0];var v=this.element.getElementsByClassName("aplayer-thumb")[0],g=void 0;m.barWrap.addEventListener("click",function(e){var t=e||window.event;g=m.barWrap.clientWidth;var n=(t.clientX-a(m.barWrap))/g;isNaN(i.audio.duration)?i.updateBar("played",0,"width"):(i.updateBar("played",n,"width"),i.element.getElementsByClassName("aplayer-ptime")[0].innerHTML=i.secondToTime(n*i.audio.duration),i.audio.currentTime=parseFloat(m.playedBar.style.width)/100*i.audio.duration)}),v.addEventListener("mouseover",function(){v.style.background=i.option.theme}),v.addEventListener("mouseout",function(){v.style.background="#fff"});var b=function(e){var t=e||window.event,n=(t.clientX-a(m.barWrap))/g;n=n>0?n:0,n=n<1?n:1,i.updateBar("played",n,"width"),i.option.showlrc&&i.updateLrc(parseFloat(m.playedBar.style.width)/100*i.audio.duration),i.element.getElementsByClassName("aplayer-ptime")[0].innerHTML=i.secondToTime(n*i.audio.duration)},x=function e(){document.removeEventListener("mouseup",e),document.removeEventListener("mousemove",b),isNaN(i.audio.duration)?i.updateBar("played",0,"width"):(i.audio.currentTime=parseFloat(m.playedBar.style.width)/100*i.audio.duration,i.playedTime=setInterval(function(){i.updateBar("played",i.audio.currentTime/i.audio.duration,"width"),i.option.showlrc&&i.updateLrc(),i.element.getElementsByClassName("aplayer-ptime")[0].innerHTML=i.secondToTime(i.audio.currentTime),i.trigger("playing")},100))};v.addEventListener("mousedown",function(){g=m.barWrap.clientWidth,clearInterval(i.playedTime),document.addEventListener("mousemove",b),document.addEventListener("mouseup",x)}),m.volumeBar=this.element.getElementsByClassName("aplayer-volume")[0];var w=this.element.getElementsByClassName("aplayer-volume-bar")[0];this.volumeicon=this.element.getElementsByClassName("aplayer-time")[0].getElementsByTagName("button")[0];this.element.getElementsByClassName("aplayer-volume-bar-wrap")[0].addEventListener("click",function(e){var t=e||window.event,a=(35-t.clientY+n(w))/35;a=a>0?a:0,a=a<1?a:1,i.volume(a)}),this.volumeicon.addEventListener("click",function(){i.audio.muted?(i.audio.muted=!1,i.volumeicon.className=1===i.audio.volume?"aplayer-icon aplayer-icon-volume-up":"aplayer-icon aplayer-icon-volume-down",1===i.audio.volume?(i.volumeicon.className="aplayer-icon aplayer-icon-volume-up",i.volumeicon.innerHTML=i.getSVG("volume-up")):(i.volumeicon.className="aplayer-icon aplayer-icon-volume-down",i.volumeicon.innerHTML=i.getSVG("volume-down")),i.updateBar("volume",i.audio.volume,"height")):(i.audio.muted=!0,i.volumeicon.className="aplayer-icon aplayer-icon-volume-off",i.volumeicon.innerHTML=i.getSVG("volume-off"),i.updateBar("volume",0,"height"))});var A=this.element.getElementsByClassName("aplayer-icon-mode")[0];A.addEventListener("click",function(){i.multiple?"random"===i.mode?i.mode="single":"single"===i.mode?i.mode="order":"order"===i.mode?i.mode="circulation":"circulation"===i.mode&&(i.mode="random"):"circulation"===i.mode?i.mode="order":i.mode="circulation",A.innerHTML=i.getSVG(i.mode),i.audio.loop=!(i.multiple||"order"===i.mode)}),f.style.height=f.offsetHeight+"px",this.element.getElementsByClassName("aplayer-icon-menu")[0].addEventListener("click",function(){f.classList.contains("aplayer-list-hide")?f.classList.remove("aplayer-list-hide"):f.classList.add("aplayer-list-hide")}),"random"===this.mode?this.setMusic(this.randomOrder[0]):this.setMusic(0),l.push(this)}return i(e,[{key:"setMusic",value:function(e){var t=this;void 0!==e&&(this.playIndex=e);var a=this.playIndex;this.music=this.option.music[a],this.music.pic&&(this.element.getElementsByClassName("aplayer-pic")[0].style.backgroundImage="url('"+this.music.pic+"')"),this.element.getElementsByClassName("aplayer-title")[0].innerHTML=this.music.title,this.element.getElementsByClassName("aplayer-author")[0].innerHTML=" - "+this.music.author,this.element.getElementsByClassName("aplayer-list-light")[0]&&this.element.getElementsByClassName("aplayer-list-light")[0].classList.remove("aplayer-list-light"),this.element.getElementsByClassName("aplayer-list")[0].getElementsByTagName("li")[a].classList.add("aplayer-list-light"),!this.isMobile&&this.audio&&(this.pause(),this.audio.currentTime=0),this.element.getElementsByClassName("aplayer-list")[0].scrollTop=33*a,this.isMobile&&this.audio?(this.audio.src=this.music.url,this.play()):!this.isMobile&&this.audios[a]?(this.audio=this.audios[a],this.audio.volume=parseInt(this.element.getElementsByClassName("aplayer-volume")[0].style.height)/100,this.audio.currentTime=0):(this.audio=document.createElement("audio"),this.audio.src=this.music.url,this.audio.preload=this.option.preload?this.option.preload:"auto",this.audio.addEventListener("play",function(){if(t.button.classList.contains("aplayer-play")){if(t.button.classList.remove("aplayer-play"),t.button.classList.add("aplayer-pause"),t.button.innerHTML="",setTimeout(function(){t.button.innerHTML='\n "},100),t.option.mutex)for(var e=0;e'+t.getSVG("play")+" "},100),clearInterval(t.playedTime),t.trigger("pause"))}),this.audio.addEventListener("durationchange",function(){1!==t.audio.duration&&(t.element.getElementsByClassName("aplayer-dtime")[0].innerHTML=t.secondToTime(t.audio.duration))}),this.audio.addEventListener("progress",function(){var e=t.audio.buffered.length?t.audio.buffered.end(t.audio.buffered.length-1)/t.audio.duration:0;t.updateBar("loaded",e,"width")}),this.audio.addEventListener("error",function(){t.element.getElementsByClassName("aplayer-author")[0].innerHTML=" - Error happens ╥﹏╥",t.trigger("pause")}),this.audio.addEventListener("canplay",function(){t.trigger("canplay")}),this.ended=!1,this.audio.addEventListener("ended",function(){t.multiple?0!==t.audio.currentTime&&("random"===t.mode?t.setMusic(t.nextRandomNum()):"single"===t.mode?t.setMusic(t.playIndex):"order"===t.mode?t.playIndex=200&&o.status<300||304===o.status?(i=o.responseText,t.lrcs[r]=n(i)):(console.log("Request was unsuccessful: "+o.status),t.lrcs[r]=[["00:00","Not available"]]),t.lrc=t.lrcs[r];var e="";t.lrcContents=t.element.getElementsByClassName("aplayer-lrc-contents")[0];for(var a=0;a"+t.lrc[a][1]+"";t.lrcContents.innerHTML=e,t.lrcIndex||(t.lrcIndex=0),t.lrcContents.getElementsByTagName("p")[0].classList.add("aplayer-lrc-current"),t.lrcContents.style.transform="translateY(0px)",t.lrcContents.style.webkitTransform="translateY(0px)"}};var s=void 0;s=this.option.music[r].lrc,o.open("get",s,!0),o.send(null)}i?this.lrcs[r]=n(i):3===this.option.showlrc?this.lrcs[r]=[["00:00","Loading"]]:this.lrcs[r]=[["00:00","Not available"]]}this.lrc=this.lrcs[r];var p="";this.lrcContents=this.element.getElementsByClassName("aplayer-lrc-contents")[0];for(var c=0;c"+this.lrc[c][1]+"";this.lrcContents.innerHTML=p,this.lrcIndex||(this.lrcIndex=0),this.lrcContents.getElementsByTagName("p")[0].classList.add("aplayer-lrc-current"),this.lrcContents.style.transform="translateY(0px)",this.lrcContents.style.webkitTransform="translateY(0px)"}1!==this.audio.duration&&(this.element.getElementsByClassName("aplayer-dtime")[0].innerHTML=this.audio.duration?this.secondToTime(this.audio.duration):"00:00"),this.option.autoplay&&!this.isMobile&&this.play(),this.option.autoplay=!0}},{key:"play",value:function(e){"[object Number]"===Object.prototype.toString.call(e)&&(this.audio.currentTime=e),this.audio.paused&&this.audio.play()}},{key:"pause",value:function(){this.audio.paused||this.audio.pause()}},{key:"volume",value:function(e){this.updateBar("volume",e,"height"),this.audio.volume=e,this.audio.muted&&(this.audio.muted=!1),1===e?(this.volumeicon.className="aplayer-icon aplayer-icon-volume-up",this.volumeicon.innerHTML=this.getSVG("volume-up")):(this.volumeicon.className="aplayer-icon aplayer-icon-volume-down",this.volumeicon.innerHTML=this.getSVG("volume-down"))}},{key:"on",value:function(e,t){"function"==typeof t&&this.event[e].push(t)}},{key:"toggle",value:function(){this.button.classList.contains("aplayer-play")?this.play():this.button.classList.contains("aplayer-pause")&&this.pause()}},{key:"getRandomOrder",value:function(){function e(e,t){return null==t&&(t=e,e=0),e+Math.floor(Math.random()*(t-e+1))}this.multiple&&(this.randomOrder=function(t){for(var a,n=t.length,r=new Array(n),i=0;i\n \n '+(this.option.music.length-e.length+r+1)+'\n '+e[r].title+'\n '+e[r].author+"\n ";a.innerHTML+=n,this.multiple||(this.multiple=!0,this.element.classList.add("aplayer-withlist"),this.audio.loop=!1),t.style.height="auto",t.style.height=t.offsetHeight+"px",this.getRandomOrder()}}]),e}();e.exports=o},function(e,t,a){t=e.exports=a(3)(void 0),t.push([e.i,".aplayer-narrow {\n width: 66px; }\n .aplayer-narrow .aplayer-info {\n display: none; }\n\n.aplayer-withlrc.aplayer-narrow {\n width: 90px; }\n\n.aplayer-withlrc.aplayer .aplayer-pic {\n height: 90px;\n width: 90px; }\n\n.aplayer-withlrc.aplayer .aplayer-info {\n margin-left: 90px;\n height: 90px; }\n\n.aplayer-withlrc.aplayer .aplayer-lrc {\n display: block; }\n\n.aplayer-withlrc.aplayer .aplayer-info {\n padding: 10px 7px 0 7px; }\n\n.aplayer-withlist.aplayer .aplayer-info {\n border-bottom: 1px solid #e9e9e9; }\n\n.aplayer-withlist.aplayer .aplayer-list {\n display: block; }\n\n.aplayer-withlist.aplayer .aplayer-icon-menu {\n display: inline !important; }\n\n.aplayer {\n font-family: Arial, Helvetica, sans-serif;\n margin: 5px;\n -webkit-box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 1px 5px 0 rgba(0, 0, 0, 0.12);\n box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 1px 5px 0 rgba(0, 0, 0, 0.12);\n border-radius: 2px;\n overflow: hidden;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n line-height: initial; }\n .aplayer * {\n -webkit-box-sizing: content-box;\n box-sizing: content-box; }\n .aplayer .aplayer-icon {\n width: 15px;\n height: 15px;\n border: none;\n background-color: transparent;\n outline: none;\n cursor: pointer;\n opacity: .8;\n vertical-align: middle;\n padding: 0;\n font-size: 12px;\n margin: 0;\n display: inline; }\n .aplayer .aplayer-icon .aplayer-fill {\n -webkit-transition: all .2s ease-in-out;\n transition: all .2s ease-in-out; }\n .aplayer .aplayer-lrc-content {\n display: none; }\n .aplayer .aplayer-pic {\n position: relative;\n float: left;\n height: 66px;\n width: 66px;\n background-image: url("+a(6)+");\n background-size: 100%;\n -webkit-transition: all 0.3s ease;\n transition: all 0.3s ease; }\n .aplayer .aplayer-pic .aplayer-button {\n position: absolute;\n border-radius: 50%;\n opacity: 0.8;\n cursor: pointer;\n text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);\n -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);\n box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);\n background: rgba(0, 0, 0, 0.2);\n -webkit-transition: all 0.1s ease;\n transition: all 0.1s ease; }\n .aplayer .aplayer-pic .aplayer-button:hover {\n opacity: 1; }\n .aplayer .aplayer-pic .aplayer-button .aplayer-fill {\n fill: #fff; }\n .aplayer .aplayer-pic .aplayer-hide {\n display: none; }\n .aplayer .aplayer-pic .aplayer-play {\n width: 26px;\n height: 26px;\n border: 2px solid #fff;\n bottom: 50%;\n right: 50%;\n margin: 0 -15px -15px 0; }\n .aplayer .aplayer-pic .aplayer-play .aplayer-icon-play {\n position: absolute;\n top: 3px;\n left: 4px;\n height: 20px;\n width: 20px; }\n .aplayer .aplayer-pic .aplayer-pause {\n width: 16px;\n height: 16px;\n border: 2px solid #fff;\n bottom: 4px;\n right: 4px; }\n .aplayer .aplayer-pic .aplayer-pause .aplayer-icon-pause {\n position: absolute;\n top: 2px;\n left: 2px;\n height: 12px;\n width: 12px; }\n .aplayer .aplayer-info {\n margin-left: 66px;\n padding: 14px 7px 0 10px;\n height: 66px;\n -webkit-box-sizing: border-box;\n box-sizing: border-box; }\n .aplayer .aplayer-info .aplayer-music {\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n margin: 0 0 13px 5px;\n -webkit-user-select: text;\n -moz-user-select: text;\n -ms-user-select: text;\n user-select: text;\n cursor: default;\n padding-bottom: 2px; }\n .aplayer .aplayer-info .aplayer-music .aplayer-title {\n font-size: 14px; }\n .aplayer .aplayer-info .aplayer-music .aplayer-author {\n font-size: 12px;\n color: #666; }\n .aplayer .aplayer-info .aplayer-controller {\n position: relative;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex; }\n .aplayer .aplayer-info .aplayer-controller .aplayer-bar-wrap {\n margin: 0 0 0 5px;\n padding: 4px 0;\n cursor: pointer !important;\n -webkit-box-flex: 1;\n -ms-flex: 1;\n flex: 1; }\n .aplayer .aplayer-info .aplayer-controller .aplayer-bar-wrap .aplayer-bar {\n position: relative;\n height: 2px;\n width: 100%;\n background: #cdcdcd; }\n .aplayer .aplayer-info .aplayer-controller .aplayer-bar-wrap .aplayer-bar .aplayer-loaded {\n position: absolute;\n left: 0;\n top: 0;\n bottom: 0;\n background: #aaa;\n height: 2px;\n -webkit-transition: all 0.5s ease;\n transition: all 0.5s ease; }\n .aplayer .aplayer-info .aplayer-controller .aplayer-bar-wrap .aplayer-bar .aplayer-played {\n position: absolute;\n left: 0;\n top: 0;\n bottom: 0;\n height: 2px; }\n .aplayer .aplayer-info .aplayer-controller .aplayer-bar-wrap .aplayer-bar .aplayer-played .aplayer-thumb {\n position: absolute;\n top: 0;\n right: 5px;\n margin-top: -4px;\n margin-right: -10px;\n height: 8px;\n width: 8px;\n border-radius: 50%;\n background: #fff;\n cursor: pointer !important; }\n .aplayer .aplayer-info .aplayer-controller .aplayer-time {\n position: relative;\n right: 0;\n bottom: 3px;\n height: 17px;\n color: #999;\n font-size: 11px;\n padding-left: 7px; }\n .aplayer .aplayer-info .aplayer-controller .aplayer-time .aplayer-time-inner {\n vertical-align: middle; }\n .aplayer .aplayer-info .aplayer-controller .aplayer-time .aplayer-icon {\n cursor: pointer;\n -webkit-transition: all 0.2s ease;\n transition: all 0.2s ease; }\n .aplayer .aplayer-info .aplayer-controller .aplayer-time .aplayer-icon .aplayer-fill {\n fill: #666; }\n .aplayer .aplayer-info .aplayer-controller .aplayer-time .aplayer-icon.aplayer-icon-mode {\n margin-right: 4px; }\n .aplayer .aplayer-info .aplayer-controller .aplayer-time .aplayer-icon:hover .aplayer-fill {\n fill: #000; }\n .aplayer .aplayer-info .aplayer-controller .aplayer-time .aplayer-icon.aplayer-icon-menu {\n display: none; }\n .aplayer .aplayer-info .aplayer-controller .aplayer-time.aplayer-time-narrow .aplayer-icon-mode {\n display: none; }\n .aplayer .aplayer-info .aplayer-controller .aplayer-time.aplayer-time-narrow .aplayer-icon-menu {\n display: none; }\n .aplayer .aplayer-info .aplayer-controller .aplayer-volume-wrap {\n position: relative;\n display: inline-block;\n margin-left: 3px;\n cursor: pointer !important; }\n .aplayer .aplayer-info .aplayer-controller .aplayer-volume-wrap:hover .aplayer-volume-bar-wrap {\n display: block; }\n .aplayer .aplayer-info .aplayer-controller .aplayer-volume-wrap .aplayer-volume-bar-wrap {\n display: none;\n position: absolute;\n bottom: 15px;\n right: -3px;\n width: 25px;\n height: 40px;\n z-index: 99; }\n .aplayer .aplayer-info .aplayer-controller .aplayer-volume-wrap .aplayer-volume-bar-wrap .aplayer-volume-bar {\n position: absolute;\n bottom: 0;\n right: 10px;\n width: 5px;\n height: 35px;\n background: #aaa; }\n .aplayer .aplayer-info .aplayer-controller .aplayer-volume-wrap .aplayer-volume-bar-wrap .aplayer-volume-bar .aplayer-volume {\n position: absolute;\n bottom: 0;\n right: 0;\n width: 5px;\n -webkit-transition: all 0.1s ease;\n transition: all 0.1s ease; }\n .aplayer .aplayer-lrc {\n display: none;\n position: relative;\n height: 30px;\n text-align: center;\n overflow: hidden;\n margin: -10px 0 7px; }\n .aplayer .aplayer-lrc:before {\n position: absolute;\n top: 0;\n z-index: 1;\n display: block;\n overflow: hidden;\n width: 100%;\n height: 10%;\n content: ' ';\n background: -webkit-gradient(linear, left top, left bottom, from(white), to(rgba(255, 255, 255, 0)));\n background: linear-gradient(to bottom, white 0%, rgba(255, 255, 255, 0) 100%);\n filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#00ffffff',GradientType=0 ); }\n .aplayer .aplayer-lrc:after {\n position: absolute;\n bottom: 0;\n z-index: 1;\n display: block;\n overflow: hidden;\n width: 100%;\n height: 33%;\n content: ' ';\n background: -webkit-gradient(linear, left top, left bottom, from(rgba(255, 255, 255, 0)), to(rgba(255, 255, 255, 0.8)));\n background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.8) 100%);\n filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#00ffffff', endColorstr='#ccffffff',GradientType=0 ); }\n .aplayer .aplayer-lrc p {\n font-size: 12px;\n color: #666;\n line-height: 16px !important;\n height: 16px !important;\n padding: 0 !important;\n margin: 0 !important;\n -webkit-transition: all 0.5s ease-out;\n transition: all 0.5s ease-out;\n opacity: 0.4;\n overflow: hidden; }\n .aplayer .aplayer-lrc p.aplayer-lrc-current {\n opacity: 1;\n overflow: visible;\n height: initial !important; }\n .aplayer .aplayer-lrc .aplayer-lrc-contents {\n width: 100%;\n -webkit-transition: all 0.5s ease-out;\n transition: all 0.5s ease-out;\n -webkit-user-select: text;\n -moz-user-select: text;\n -ms-user-select: text;\n user-select: text;\n cursor: default; }\n .aplayer .aplayer-list {\n overflow: auto;\n -webkit-transition: all 0.5s ease;\n transition: all 0.5s ease;\n will-change: height;\n display: none; }\n .aplayer .aplayer-list.aplayer-list-hide {\n height: 0 !important; }\n .aplayer .aplayer-list::-webkit-scrollbar {\n width: 5px; }\n .aplayer .aplayer-list::-webkit-scrollbar-track {\n background-color: #f9f9f9; }\n .aplayer .aplayer-list::-webkit-scrollbar-thumb {\n border-radius: 3px;\n background-color: #eee; }\n .aplayer .aplayer-list::-webkit-scrollbar-thumb:hover {\n background-color: #ccc; }\n .aplayer .aplayer-list ol {\n list-style-type: none;\n margin: 0;\n padding: 0; }\n .aplayer .aplayer-list ol li {\n position: relative;\n height: 32px;\n line-height: 32px;\n padding: 0 15px;\n font-size: 12px;\n border-top: 1px solid #e9e9e9;\n cursor: pointer;\n -webkit-transition: all 0.2s ease;\n transition: all 0.2s ease;\n overflow: hidden; }\n .aplayer .aplayer-list ol li:first-child {\n border-top: none; }\n .aplayer .aplayer-list ol li:hover {\n background: #efefef; }\n .aplayer .aplayer-list ol li.aplayer-list-light {\n background: #e9e9e9; }\n .aplayer .aplayer-list ol li.aplayer-list-light .aplayer-list-cur {\n display: inline-block; }\n .aplayer .aplayer-list ol li .aplayer-list-cur {\n display: none;\n width: 3px;\n height: 22px;\n position: absolute;\n left: 0;\n top: 5px;\n cursor: pointer; }\n .aplayer .aplayer-list ol li .aplayer-list-index {\n color: #666;\n margin-right: 12px;\n cursor: pointer; }\n .aplayer .aplayer-list ol li .aplayer-list-author {\n color: #666;\n float: right;\n cursor: pointer; }\n\n@-webkit-keyframes aplayer-roll {\n 0% {\n left: 0; }\n 100% {\n left: -100%; } }\n\n@keyframes aplayer-roll {\n 0% {\n left: 0; }\n 100% {\n left: -100%; } }\n",""])},function(e,t){function a(e,t){var a=e[1]||"",r=e[3];if(!r)return a;if(t&&"function"==typeof btoa){var i=n(r);return[a].concat(r.sources.map(function(e){return"/*# sourceURL="+r.sourceRoot+e+" */"})).concat([i]).join("\n")}return[a].join("\n")}function n(e){return"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(e))))+" */"}e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var n=a(t,e);return t[2]?"@media "+t[2]+"{"+n+"}":n}).join("")},t.i=function(e,a){"string"==typeof e&&(e=[[null,e,""]]);for(var n={},r=0;r=0&&b.splice(t,1)}function o(e){var t=document.createElement("style");return e.attrs.type="text/css",p(t,e.attrs),i(e,t),t}function s(e){var t=document.createElement("link");return e.attrs.type="text/css",e.attrs.rel="stylesheet",p(t,e.attrs),i(e,t),t}function p(e,t){Object.keys(t).forEach(function(a){e.setAttribute(a,t[a])})}function c(e,t){var a,n,r,i;if(t.transform&&e.css){if(!(i=t.transform(e.css)))return function(){};e.css=i}if(t.singleton){var p=g++;a=v||(v=o(t)),n=u.bind(null,a,p,!1),r=u.bind(null,a,p,!0)}else e.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(a=s(t),n=y.bind(null,a,t),r=function(){l(a),a.href&&URL.revokeObjectURL(a.href)}):(a=o(t),n=d.bind(null,a),r=function(){l(a)});return n(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;n(e=t)}else r()}}function u(e,t,a,n){var r=a?"":n.css;if(e.styleSheet)e.styleSheet.cssText=w(t,r);else{var i=document.createTextNode(r),l=e.childNodes;l[t]&&e.removeChild(l[t]),l.length?e.insertBefore(i,l[t]):e.appendChild(i)}}function d(e,t){var a=t.css,n=t.media;if(n&&e.setAttribute("media",n),e.styleSheet)e.styleSheet.cssText=a;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(a))}}function y(e,t,a){var n=a.css,r=a.sourceMap,i=void 0===t.convertToAbsoluteUrls&&r;(t.convertToAbsoluteUrls||i)&&(n=x(n)),r&&(n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(r))))+" */");var l=new Blob([n],{type:"text/css"}),o=e.href;e.href=URL.createObjectURL(l),o&&URL.revokeObjectURL(o)}var h={},m=function(e){var t;return function(){return void 0===t&&(t=e.apply(this,arguments)),t}}(function(){return window&&document&&document.all&&!window.atob}),f=function(e){var t={};return function(a){return void 0===t[a]&&(t[a]=e.call(this,a)),t[a]}}(function(e){return document.querySelector(e)}),v=null,g=0,b=[],x=a(5);e.exports=function(e,t){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");t=t||{},t.attrs="object"==typeof t.attrs?t.attrs:{},t.singleton||(t.singleton=m()),t.insertInto||(t.insertInto="head"),t.insertAt||(t.insertAt="bottom");var a=r(e,t);return n(a,t),function(e){for(var i=[],l=0;l
* Released under the MIT license
@@ -106,7 +106,7 @@ class Meting
{
$t=explode('#', $rule);
foreach ($t as $vo) {
- if (is_null($array)) {
+ if (!isset($array[$vo])){
return array();
}
$array=$array[$vo];
@@ -140,7 +140,7 @@ class Meting
'type' => 1,
'limit' => $limit,
'total' => 'true',
- 'offset' => $page-1,
+ 'offset' => ($page-1)*$limit,
),
'url' => 'http://music.163.com/api/cloudsearch/pc',
),
@@ -151,7 +151,7 @@ class Meting
case 'tencent':
$API=array(
'method' => 'GET',
- 'url' => 'https://c.y.qq.com/soso/fcgi-bin/search_cp',
+ 'url' => 'https://c.y.qq.com/soso/fcgi-bin/client_search_cp',
'body' => array(
'p' => $page,
'n' => $limit,
@@ -159,6 +159,7 @@ class Meting
'aggr' => 1,
'lossless' => 1,
'cr' => 1,
+ 'platform' => 'yqq',
),
'decode' => 'jsonp2json',
'format' => 'data#song#list',
@@ -245,8 +246,9 @@ class Meting
'method' => 'GET',
'url' => 'https://c.y.qq.com/v8/fcg-bin/fcg_play_single_song.fcg',
'body' => array(
- 'songmid' => $id,
- 'format' => 'json',
+ 'songmid' => $id,
+ 'platform' => 'yqq',
+ 'format' => 'json',
),
'decode' => 'tencent_singlesong',
'format' => 'data',
@@ -268,7 +270,7 @@ class Meting
case 'kugou':
$API=array(
'method' => 'POST',
- 'url' => 'http://m.kugou.com/app/i/getSongInfo.php?',
+ 'url' => 'http://m.kugou.com/app/i/getSongInfo.php',
'body' => array(
"cmd" => "playInfo",
"hash" => $id,
@@ -322,6 +324,7 @@ class Meting
'url' => 'https://c.y.qq.com/v8/fcg-bin/fcg_v8_album_info_cp.fcg',
'body' => array(
'albummid' => $id,
+ 'platform' => 'yqq',
),
'format' => 'data#list',
);
@@ -402,6 +405,8 @@ class Meting
'singermid' => $id,
'begin' => 0,
'num' => $limit,
+ 'order' => 'listen',
+ 'platform' => 'yqq',
),
'format' => 'data#list',
);
@@ -481,9 +486,10 @@ class Meting
'method' => 'GET',
'url' => 'https://c.y.qq.com/qzone/fcg-bin/fcg_ucc_getcdinfo_byids_cp.fcg',
'body' => array(
- 'disstid' => $id,
- 'utf8' => 1,
- 'type' => 1,
+ 'disstid' => $id,
+ 'utf8' => 1,
+ 'type' => 1,
+ 'platform' => 'yqq',
),
'decode' => 'jsonp2json',
'format' => 'cdlist#0#songlist',
@@ -562,6 +568,7 @@ class Meting
'url' => 'https://c.y.qq.com/v8/fcg-bin/fcg_play_single_song.fcg',
'body' => array(
'songmid' => $id,
+ 'platform' => 'yqq',
'format' => 'json',
),
'decode' => 'tencent_url',
@@ -743,8 +750,8 @@ class Meting
'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' => 'http://y.qq.com/portal/player.html',
- 'cookie' => 'qqmusic_uin=12345678; qqmusic_key=12345678; qqmusic_fromtag=30; ts_last=y.qq.com/portal/player.html;',
+ 'referer' => 'https://y.qq.com/portal/player.html',
+ 'cookie' => 'pgv_pvi=3832878080; pgv_si=s4066364416; pgv_pvid=3938077488; yplayer_open=1; qqmusic_fromtag=66; ts_last=y.qq.com/portal/player.html; ts_uid=5141451452; player_exist=1; yq_index=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(
@@ -862,6 +869,7 @@ class Meting
$type=array(
'size_320mp3' => array(320,'M800','mp3'),
+ 'size_192aac' => array(192,'C600','m4a'),
'size_128mp3' => array(128,'M500','mp3'),
'size_96aac' => array(96 ,'C400','m4a'),
'size_48aac' => array(48 ,'C200','m4a'),