diff --git a/footer.php b/footer.php index 4e2a435..3641f35 100644 --- a/footer.php +++ b/footer.php @@ -148,11 +148,11 @@
- +
diff --git a/inc/api.php b/inc/api.php index a216104..fcfafdb 100755 --- a/inc/api.php +++ b/inc/api.php @@ -36,6 +36,10 @@ add_action('rest_api_init', function () { 'methods' => 'POST', 'callback' => 'bgm_bilibili', )); + register_rest_route('sakura/v1', '/meting/aplyer', array( + 'methods' => 'GET', + 'callback' => 'meting_aplyer', + )); }); /** diff --git a/inc/swicher.php b/inc/swicher.php index ad8c560..17494a8 100644 --- a/inc/swicher.php +++ b/inc/swicher.php @@ -67,8 +67,9 @@ mashiro_option.jsdelivr_css_src = "/cd mashiro_option.jsdelivr_css_src = "https://cdn.jsdelivr.net/gh/mashirozx/Sakura@/cdn/css/lib.min.css"; - + mashiro_option.float_player_on = true; +mashiro_option.meting_api_url = ; mashiro_option.cover_api = ""; diff --git a/js/sakura-app.js b/js/sakura-app.js index eb4c6cb..0b0bb9a 100644 --- a/js/sakura-app.js +++ b/js/sakura-app.js @@ -819,7 +819,7 @@ if (mashiro_option.float_player_on) { } }); } - var b = 'https://api.i-meto.com/meting/api?server=:server&type=:type&id=:id&r=:r'; + var b = mashiro_option.meting_api_url + '?server=:server&type=:type&id=:id&r=:r'; 'undefined' != typeof meting_api && (b = meting_api); for (var f = 0; f < aplayers.length; f++) try { aplayers[f].destroy() diff --git a/options.php b/options.php index b1cde48..147ba0e 100644 --- a/options.php +++ b/options.php @@ -923,11 +923,33 @@ function optionsframework_options() $options[] = array( 'name' => __('Footer float music player', 'sakura'), /*页脚悬浮播放器*/ - 'desc' => __('If you don\'t need the player just leave it blank.Fill in the "song list" ID of Netease Cloud Music, eg: https://music.163.com/#/playlist?id=2288037900 The ID is 2288037900', 'sakura'), /*如果不需要播放器留空即可。填写网易云音乐的「歌单」ID,eg:https://music.163.com/#/playlist?id=2288037900的ID是2288037900*/ - 'id' => 'playlist_id', + 'desc' => __('Choose which platform you\'ll use.', 'sakura'), + 'id' => 'aplayer_server', + 'std' => "netease", + 'type' => "radio", + 'options' => array( + 'netease' => __('Netease Cloud Music (default)', 'sakura'), + 'xiami' => __('Xiami Music', 'sakura'), + 'kugou' => __('KuGou Music', 'sakura'), + 'baidu' => __('Baidu Music', 'sakura'), + 'tencent' => __('QQ Music (may fail) ', 'sakura'), + 'off' => __('Off', 'sakura'), + )); + + $options[] = array( + 'name' => __('Song list ID', 'sakura'), + 'desc' => __('Fill in the "song list" ID, eg: https://music.163.com/#/playlist?id=2288037900 The ID is 2288037900', 'sakura'), + 'id' => 'aplayer_playlistid', 'std' => '2288037900', 'type' => 'text'); + $options[] = array( + 'name' => __('Netease Cloud Music cookie', 'sakura'), + 'desc' => __('For Netease Cloud Music, fill in your vip account\'s cookies if you want to play special tracks.', 'sakura'), + 'id' => 'aplayer_cookie', + 'std' => '', + 'type' => 'textarea'); + $options[] = array( 'name' => __('Version Control', 'sakura'), /*版本控制*/ 'desc' => __('Used to update frontend cookies and browser caches, any string can be used', 'sakura'), /*用于更新前端 cookie 及浏览器缓存,可使用任意字符串*/