88 *
99 * @package APlayer for Typecho | Meting
1010 * @author METO
11- * @version 2.1.1
11+ * @version 2.1.2
1212 * @dependence 14.10.10-*
1313 * @link https://github.com/MoePlayer/APlayer-Typecho
1414 *
1515 */
1616
17- define ('METING_VERSION ' , '2.1.1 ' );
17+ define ('METING_VERSION ' , '2.1.2 ' );
1818
1919class Meting_Plugin extends Typecho_Widget implements Typecho_Plugin_Interface
2020{
@@ -84,9 +84,9 @@ public static function config(Typecho_Widget_Helper_Form $form)
8484 );
8585 $ form ->addInput ($ t );
8686 $ t = new Typecho_Widget_Helper_Form_Element_Radio (
87- 'mode ' ,
88- array ('circulation ' => _t ('循环 ' ), ' single ' => _t ( ' 单曲 ' ), ' order ' => _t ( ' 列表 ' ),'random ' => _t ('随机 ' )),
89- 'circulation ' ,
87+ 'order ' ,
88+ array ('list ' => _t ('列表 ' ), 'random ' => _t ('随机 ' )),
89+ 'list ' ,
9090 _t ('全局播放模式 ' ),
9191 _t ('' )
9292 );
@@ -143,7 +143,7 @@ public static function config(Typecho_Widget_Helper_Form $form)
143143 $ t = new Typecho_Widget_Helper_Form_Element_Text (
144144 'api ' ,
145145 null ,
146- Typecho_Common::url ('action/metingapi ' , Helper::options ()->index )."?server=:server&type=:type&id=:id&r=:r " ,
146+ Typecho_Common::url ('action/metingapi ' , Helper::options ()->index )."?server=:server&type=:type&id=:id&auth=:auth& r=:r " ,
147147 _t ('* 云解析地址 ' ),
148148 _t ('示例:https://api.i-meto.com/meting/api?server=:server&type=:type&id=:id&r=:r ' )
149149 );
@@ -177,7 +177,7 @@ public static function configHandle($config, $is_init)
177177 {
178178 if (!$ is_init ) {
179179 if (empty ($ config ['api ' ])) {
180- $ config ['api ' ] = Typecho_Common::url ('action/metingapi ' , Helper::options ()->index )."?server=:server&type=:type&id=:id&r=:r " ;
180+ $ config ['api ' ] = Typecho_Common::url ('action/metingapi ' , Helper::options ()->index )."?server=:server&type=:type&id=:id&auth=:auth& r=:r " ;
181181 }
182182 if ($ config ['cachetype ' ] != 'none ' ) {
183183 require_once 'driver/cache.interface.php ' ;
@@ -215,6 +215,7 @@ public static function header()
215215 $ api = Typecho_Widget::widget ('Widget_Options ' )->plugin ('Meting ' )->api ;
216216 $ dir = Helper::options ()->pluginUrl .'/Meting/assets ' ;
217217 $ ver = METING_VERSION ;
218+ echo "<link rel= \"stylesheet \" href= \"{$ dir }/APlayer.min.css?v= {$ ver }\"> \n" ;
218219 echo "<script type= \"text/javascript \" src= \"{$ dir }/APlayer.min.js?v= {$ ver }\"></script> \n" ;
219220 echo "<script>var meting_api= \"{$ api }\";</script> " ;
220221 }
@@ -258,8 +259,8 @@ public static function parseMusic($matches, $setting)
258259 'theme ' => Typecho_Widget::widget ('Widget_Options ' )->plugin ('Meting ' )->theme ?:'red ' ,
259260 'preload ' => Typecho_Widget::widget ('Widget_Options ' )->plugin ('Meting ' )->preload ?:'auto ' ,
260261 'autoplay ' => Typecho_Widget::widget ('Widget_Options ' )->plugin ('Meting ' )->autoplay ?:'false ' ,
261- 'listmaxheight ' => Typecho_Widget::widget ('Widget_Options ' )->plugin ('Meting ' )->height ?:'340px ' ,
262- 'mode ' => Typecho_Widget::widget ('Widget_Options ' )->plugin ('Meting ' )->mode ?:'circulation ' ,
262+ 'listMaxHeight ' => Typecho_Widget::widget ('Widget_Options ' )->plugin ('Meting ' )->height ?:'340px ' ,
263+ 'order ' => Typecho_Widget::widget ('Widget_Options ' )->plugin ('Meting ' )->order ?:'list ' ,
263264 );
264265 if (isset ($ t ['server ' ])) {
265266 if (!in_array ($ t ['server ' ], array ('netease ' ,'tencent ' ,'xiami ' ,'baidu ' ,'kugou ' ))) {
@@ -270,7 +271,10 @@ public static function parseMusic($matches, $setting)
270271 }
271272 $ data = $ t ;
272273
273- $ str .= "<div class= \"aplayer \" data-id= \"{$ data ['id ' ]}\" data-server= \"{$ data ['server ' ]}\" data-type= \"{$ data ['type ' ]}\"" ;
274+ $ salt = Typecho_Widget::widget ('Widget_Options ' )->plugin ('Meting ' )->salt ;
275+ $ auth = md5 ($ salt .$ data ['server ' ].$ data ['type ' ].$ data ['id ' ].$ salt );
276+
277+ $ str .= "<div class= \"aplayer \" data-id= \"{$ data ['id ' ]}\" data-server= \"{$ data ['server ' ]}\" data-type= \"{$ data ['type ' ]}\" data-auth= \"{$ auth }\"" ;
274278 if (is_array ($ setting )) {
275279 foreach ($ setting as $ key => $ vo ) {
276280 $ player [$ key ] = $ vo ;
@@ -283,7 +287,7 @@ public static function parseMusic($matches, $setting)
283287 } else {
284288 $ data = $ t ;
285289
286- $ str .= "<div class= \"aplayer \" data-title = \"{$ data ['title ' ]}\" data-author = \"{$ data ['author ' ]}\" data-url= \"{$ data ['url ' ]}\" data-pic = \"{$ data ['pic ' ]}\" data-lrc= \"{$ data ['lrc ' ]}\"" ;
290+ $ str .= "<div class= \"aplayer \" data-name = \"{$ data ['title ' ]}\" data-artist = \"{$ data ['author ' ]}\" data-url= \"{$ data ['url ' ]}\" data-cover = \"{$ data ['pic ' ]}\" data-lrc= \"{$ data ['lrc ' ]}\"" ;
287291 if (is_array ($ setting )) {
288292 foreach ($ setting as $ key => $ vo ) {
289293 $ player [$ key ] = $ vo ;
0 commit comments