Clean code

This commit is contained in:
FongMi 2023-08-10 01:16:06 +08:00
parent 5cf47666bd
commit 574d6b7132
3 changed files with 8 additions and 12 deletions

View File

@ -122,8 +122,7 @@ public class Bili extends Spider {
} }
@Override @Override
public String homeVideoContent() throws Exception { public String homeVideoContent() {
if (extend.has("json")) {
String api = "https://api.bilibili.com/x/web-interface/popular?ps=20"; String api = "https://api.bilibili.com/x/web-interface/popular?ps=20";
String json = OkHttp.string(api, getGuest()); String json = OkHttp.string(api, getGuest());
Resp resp = Resp.objectFrom(json); Resp resp = Resp.objectFrom(json);
@ -131,9 +130,6 @@ public class Bili extends Spider {
for (Resp.Result item : Resp.Result.arrayFrom(resp.getData().getList())) list.add(item.getVod()); for (Resp.Result item : Resp.Result.arrayFrom(resp.getData().getList())) list.add(item.getVod());
return Result.string(list); return Result.string(list);
} }
String[] types = extend.get("type").getAsString().split("#");
return categoryContent(types[0], "1", true, new HashMap<>());
}
@Override @Override
public String categoryContent(String tid, String pg, boolean filter, HashMap<String, String> extend) throws Exception { public String categoryContent(String tid, String pg, boolean filter, HashMap<String, String> extend) throws Exception {

Binary file not shown.

View File

@ -1 +1 @@
1763b7d2459b598d1ccb6a10b0e81b73 edae7af0ef2089cfc135c90ce085aacd