2023年6月16日16:37:48

master
zhangmeng 2023-06-16 16:37:59 +08:00
parent 2abdf60f37
commit c17148d199
2 changed files with 16 additions and 4 deletions

View File

@ -102,7 +102,7 @@ public class MusicDownloadController {
@FXML @FXML
public TextField name; public TextField name;
private final SimpleIntegerProperty index = new SimpleIntegerProperty(0); private static final SimpleIntegerProperty index = new SimpleIntegerProperty(0);
public static final String ku_wo_vip_api = "http://www.kuwo.cn/api/www/search/searchMusicBykeyWord?pn=1&rn=30&httpsStatus=1&reqId=a3d144b0-9570-11ed-9918-83c8c32b357d&key="; public static final String ku_wo_vip_api = "http://www.kuwo.cn/api/www/search/searchMusicBykeyWord?pn=1&rn=30&httpsStatus=1&reqId=a3d144b0-9570-11ed-9918-83c8c32b357d&key=";
@ -404,6 +404,7 @@ public class MusicDownloadController {
songInfo.setArtist(song.getArtists().get(0).getName()); songInfo.setArtist(song.getArtists().get(0).getName());
songInfo.setAlbum(song.getAlbum().getName()); songInfo.setAlbum(song.getAlbum().getName());
songInfo.setId(id); songInfo.setId(id);
songInfo.setMp3Url(song.getMp3Url());
list.add(songInfo); list.add(songInfo);
id++; id++;
} }
@ -414,9 +415,19 @@ public class MusicDownloadController {
public static void set_songInfo(SongInfo listBean) { public static void set_songInfo(SongInfo listBean) {
String req_id = data_bean.getValue().getReqId(); String url = null;
int mid = listBean.getRid(); //判断音乐类型
String url = download_url + "&reqId=" + req_id + "&mid=" + mid; switch (index.get()){
case 0://网易云
url = listBean.getMp3Url();
break;
case 3://酷我
String req_id = data_bean.getValue().getReqId();
int mid = listBean.getRid();
url = download_url + "&reqId=" + req_id + "&mid=" + mid;
break;
}
if (restTemplate == null) { if (restTemplate == null) {
restTemplate = new RestTemplate(); restTemplate = new RestTemplate();
} }

View File

@ -73,4 +73,5 @@ public class SongInfo {
private PayInfo payInfo; private PayInfo payInfo;
private String tme_musician_adtype; private String tme_musician_adtype;
private int id; private int id;
private String mp3Url;
} }