Clean code

This commit is contained in:
FongMi 2025-01-23 18:22:58 +08:00
parent e89a446074
commit 55ad1d5dc6
3 changed files with 1 additions and 8 deletions

View File

@ -33,7 +33,6 @@ import java.util.Objects;
public class Living extends Spider {
private String host = "https://lemonlive.deno.dev";
private String cookie = "";
@Override
public void init(Context context, String extend) throws Exception {
@ -136,13 +135,7 @@ public class Living extends Spider {
} else {
String[] split = tid.split("_");
String url = host + "/api/" + split[0] + "/getCategoryRooms?id=" + split[1] + "&pid=" + (split[0].equals("bilibili") ? "2" : "1") + "&page=" + pg;
if (!TextUtils.isEmpty(cookie)) {
url = url + "&cookie=" + URLDecoder.decode(cookie, "UTF-8");
}
JSONObject json = request(url);
if (!TextUtils.isEmpty(json.optJSONObject("data").optString("cookie"))) {
cookie = json.optJSONObject("data").optString("cookie");
}
List<Vod> vodList = new ArrayList<>();
for (int i = 0; i < json.optJSONObject("data").optJSONArray("list").length(); i++) {
JSONObject data = json.optJSONObject("data").optJSONArray("list").optJSONObject(i);

Binary file not shown.

View File

@ -1 +1 @@
426c3863c5e4ff58a53ee449fc619266
1988877e7ba7cbd557417f95d5ca8f61