From 7a8b7bedf282e7b513fbe4583e1f2c7ed39f031c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=94=90=E4=B8=89?= <89683694+Tangsan99999@users.noreply.github.com> Date: Thu, 25 May 2023 18:54:03 +0800 Subject: [PATCH] another method category for grandpa & grandma --- app/src/main/java/com/github/catvod/spider/Bili.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/github/catvod/spider/Bili.java b/app/src/main/java/com/github/catvod/spider/Bili.java index 2a25e1ce..b4c9358c 100644 --- a/app/src/main/java/com/github/catvod/spider/Bili.java +++ b/app/src/main/java/com/github/catvod/spider/Bili.java @@ -104,12 +104,12 @@ public class Bili extends Spider { @Override public String homeVideoContent() throws Exception { fetchRule(); - return categoryContent("窗 白噪音", "1", true, new HashMap<>()); + return categoryContent(ext.optJSONArray("classes").optJSONObject(0).optString("type_id"), "1", true, new HashMap<>()); } @Override public String categoryContent(String tid, String pg, boolean filter, HashMap extend) throws Exception { - String duration = extend.containsKey("duration") ? extend.get("duration") : "0"; + String duration = extend.containsKey("duration") ? extend.get("duration") : "4"; if (extend.containsKey("tid")) tid = tid + " " + extend.get("tid"); String url = "https://api.bilibili.com/x/web-interface/search/type?search_type=video&keyword=" + URLEncoder.encode(tid) + "&duration=" + duration + "&page=" + pg; JSONObject resp = new JSONObject(OkHttp.string(url, header));