修复YYDS清晰度选择问题

This commit is contained in:
小黄瓜 2021-10-25 10:07:08 +08:00
parent c1064db9ea
commit 7dd47cb166
1 changed files with 3 additions and 4 deletions

View File

@ -11,15 +11,12 @@ import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.net.URL;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import javax.net.ssl.HttpsURLConnection;
import okhttp3.MediaType;
import okhttp3.RequestBody;
@ -89,7 +86,7 @@ public class YydsAli extends XPath {
SpiderReqResult srr = SpiderReq.postBody("https://api.aliyundrive.com/v2/file/get_share_link_video_preview_play_info", RequestBody.create(MediaType.parse("application/json; charset=utf-8"), json.toString()), headers);
JSONArray playList = new JSONObject(srr.content).getJSONObject("video_preview_play_info").getJSONArray("live_transcoding_task_list");
String videoUrl = "";
String[] orders = new String[]{"HD", "SD"};
String[] orders = new String[]{"FHD", "HD", "SD"};
for (String or : orders) {
for (int i = 0; i < playList.length(); i++) {
JSONObject obj = playList.getJSONObject(i);
@ -98,6 +95,8 @@ public class YydsAli extends XPath {
break;
}
}
if (!videoUrl.isEmpty())
break;
}
if (videoUrl.isEmpty() && playList.length() > 0) {
videoUrl = playList.getJSONObject(0).getString("url");