This commit is contained in:
Color_yr committed 2023-01-08 17:26:38 +08:00
1 parent 21073d53ed
commit 37e77c2cf2
6 files changed
+43 -20

No files matched your search

+5 -4
View File
@@ -16,10 +16,11 @@
>重载插件
## 播放VIP歌曲
1. 在插件配置文件的`LoginUser`填写手机号
2. 重载插件或者重启服务器
3. 输入/music code 获取手机验证码
4. 输入/music login 验证码 登录账户
1. 手机号创建网易云账户并购买网易云音乐VIP
2. 在插件配置文件的`LoginUser`填写手机号
3. 重载插件或者重启服务器
4. 输入/music code 获取手机验证码
5. 输入/music login 验证码 登录账户
如果登录失效,请删除`cookie.json`再打`/music reload`
+1 -1
View File
@@ -3,7 +3,7 @@ plugins {
id 'maven-publish'
id 'com.github.johnrengelman.shadow' version '6.1.0'
}
version = "2.17.5"
version = "2.17.6"
repositories {
mavenCentral()
+1 -1
View File
@@ -39,7 +39,7 @@ public class AllMusic {
/**
* 插件版本号
*/
public static final String version = "2.17.5";
public static final String version = "2.17.6";
/**
* 配置文件版本号
*/
@@ -52,7 +52,7 @@ public class LyricDo {
if (temp2 != null && !temp2.isEmpty()) {
String[] klyric = temp2.split("\n");
for (String item : klyric) {
Map<Integer, String> temp4 = getKTime(item);
Map<Integer, String> temp4 = getKTime(item, obj.getVersion());
if (temp4 != null) {
kly.putAll(temp4);
}
@@ -119,7 +119,7 @@ public class LyricDo {
return res;
}
private Map<Integer, String> getKTime(String lyric) {
private Map<Integer, String> getKTime(String lyric, boolean yrc) {
Map<Integer, String> res = new LinkedHashMap<>();
if (!lyric.startsWith("[") || !lyric.contains("]("))
return null;
@@ -134,19 +134,28 @@ public class LyricDo {
for (int a = 1; a < temp1.length; a++) {
String time = temp1[a];
int temp2 = time.indexOf(')');
String temp3 = time.substring(2, temp2);
int temp7 = Function.countChar(temp3, ',');
String temp3 = time.substring(0, temp2);
String[] temp8 = temp3.split(",");
int temp5;
if (temp7 == 2) {
String[] temp8 = temp3.split(",");
temp5 = (Integer.parseInt(temp8[1]) / 10 * 10);
} else {
temp5 = (Integer.parseInt(temp3) / 10 * 10);
if (yrc) {
temp5 = (Integer.parseInt(temp8[0]) / 10 * 10);
if (temp5 > 0 && temp5 + AllMusic.getConfig().KDelay > 0)
temp5 += (AllMusic.getConfig().KDelay / 10 * 10);
res.put(temp5, time.substring(temp2 + 1));
} else {
try {
temp5 = (Integer.parseInt(temp8[1]) / 10 * 10);
} catch (Exception e) {
AllMusic.log.warning("不支持的Ktv歌词");
AllMusic.log.warning("请带上音乐ID联系开发者");
return null;
}
if (temp5 > 0 && temp5 + AllMusic.getConfig().KDelay > 0)
temp5 += (AllMusic.getConfig().KDelay / 10 * 10);
res.put(now, time.substring(temp2 + 1));
now += temp5;
}
if (temp5 > 0 && temp5 + AllMusic.getConfig().KDelay > 0)
temp5 += (AllMusic.getConfig().KDelay / 10 * 10);
res.put(now, time.substring(temp2 + 1));
now += temp5;
}
return res;
@@ -34,6 +34,10 @@ public class WLyricOBJ {
return yrc.getLyric();
}
public boolean getVersion(){
return yrc != null;
}
public boolean isNone() {
return nolyric || uncollected;
}
@@ -58,7 +62,11 @@ class tlyric {
class klyric
{
private String lyric;
private int version;
public int getVersion() {
return version;
}
public String getLyric() {
return lyric == null ? "" : lyric;
}
@@ -66,8 +74,13 @@ class klyric
class yrc
{
private int version;
private String lyric;
public int getVersion() {
return version;
}
public String getLyric() {
return lyric == null ? "" : lyric;
}
+1 -1
View File
@@ -13,7 +13,7 @@ public class RunTest implements IMyLogger {
// {
//
// }
LyricSave obj = AllMusic.getMusicApi().getLyric("26201959");
LyricSave obj = AllMusic.getMusicApi().getLyric("1449790719");
if (obj.isHaveLyric()) {
int time = 0;
while (true) {