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

Binary file not shown.

View File

@ -1 +1 @@
1763b7d2459b598d1ccb6a10b0e81b73
edae7af0ef2089cfc135c90ce085aacd