$(function() {
- if($('#wmd-button-row').length>0)$('#wmd-button-row').append('音乐');
+ if($('#wmd-button-row').length>0)$('#wmd-button-row').append('');
$(document).on('click', '#wmd-music-button', function() {
$('body').append(
''+
@@ -286,7 +291,6 @@ EOF;
}
}catch(Typecho_Db_Exception $e){
$code=$e->getCode();
- if($code=='42S01')return;
throw new Typecho_Plugin_Exception('数据表清空失败,插件禁用失败。错误号: '.$code);
}
}
diff --git a/README.md b/README.md
index f6e81d0..5f41075 100644
--- a/README.md
+++ b/README.md
@@ -19,7 +19,7 @@
4. 后台启用插件
## 使用
-在文章编辑页面,点击编辑器上的 **音乐** 按钮,在弹出的窗口中输入音乐地址(见支持列表),最后点击确定即可
+在文章编辑页面,点击编辑器上的 **音乐图标** 按钮,在弹出的窗口中输入音乐地址(见支持列表),最后点击确定即可
**歌曲混合特性:** 允许添加多个音乐地址,每行一个,插件会自动将所有歌曲合并在同一个歌单进行播放。
## 支持列表
@@ -28,6 +28,7 @@
- 专辑 http://music.163.com/#/album?id=34808540
- 歌手 http://music.163.com/#/artist?id=3681
- 歌单 http://music.163.com/#/playlist?id=436843836
+ - 榜单 http://music.163.com/#/discover/toplist?id=60198
QQ 音乐 http://y.qq.com
- 单曲 https://y.qq.com/portal/song/000jDQWP4JiB3y.html
diff --git a/include/Meting.php b/include/Meting.php
index 2c1b214..1870eb6 100644
--- a/include/Meting.php
+++ b/include/Meting.php
@@ -44,7 +44,7 @@ class Meting
}
curl_setopt($curl,CURLOPT_RETURNTRANSFER,1);
curl_setopt($curl,CURLOPT_CONNECTTIMEOUT,10);
- curl_setopt($curl,CURLOPT_TIMEOUT,10);
+ curl_setopt($curl,CURLOPT_TIMEOUT,20);
curl_setopt($curl,CURLOPT_COOKIE,$BASE['cookie']);
curl_setopt($curl,CURLOPT_REFERER,$BASE['referer']);
curl_setopt($curl,CURLOPT_USERAGENT,$BASE['useragent']);
@@ -854,14 +854,14 @@ class Meting
private function format_kugou($data){
$result=array(
'id' => $data['hash'],
- 'name' => "",
+ 'name' => $data['filename']?:$data['fileName'],
'artist' => array(),
'url_id' => $data['hash'],
'pic_id' => $data['hash'],
'lyric_id' => $data['hash'],
'source' => 'kugou',
);
- list($result['artist'],$result['name'])=explode(' - ',$data['filename']?:$data['fileName']);
+ list($result['artist'],$result['name'])=explode(' - ',$result['name'],2);
$result['artist']=explode('、',$result['artist']);
return $result;
}