File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed
zmusic-plugin/src/main/java/me/zhenxin/zmusic Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ public final class ZMusic {
2828
2929 public static File dataFolder ;
3030 public static String thisVer ;
31- public static int thisVerCode = 202402210 ;
31+ public static int thisVerCode = 202402211 ;
3232 public static boolean isVip = false ;
3333 public static boolean isViaVer = true ;
3434 public static boolean isEnable = true ;
Original file line number Diff line number Diff line change @@ -45,8 +45,15 @@ public static JsonObject getMusic(String keyword) {
4545 data .addProperty ("secret" , Config .vipSecret );
4646 data .addProperty ("id" , "bilibili_" + musicId );
4747 data .addProperty ("url" , musicUrl );
48- musicUrl = NetUtils .postNetString ("https://api.zhenxin.me/zmusic/vip/m4a2mp3" , null , data );
49-
48+ String res = NetUtils .postNetString ("https://api.zhenxin.me/zmusic/vip/m4a2mp3" , null , data );
49+ JsonObject resJson = gson .fromJson (res , JsonObject .class );
50+ if (resJson .get ("code" ).getAsInt () == 200 ) {
51+ JsonObject dataJson = resJson .get ("data" ).getAsJsonObject ();
52+ String name = dataJson .get ("name" ).getAsString ();
53+ musicUrl = "https://api.zhenxin.me/zmusic/vip/download/" + name ;
54+ } else {
55+ throw new Exception ("M4A转MP3失败" );
56+ }
5057 JsonObject returnJSON = new JsonObject ();
5158 returnJSON .addProperty ("id" , musicId );
5259 returnJSON .addProperty ("url" , musicUrl );
You can’t perform that action at this time.
0 commit comments