Clean code
This commit is contained in:
parent
2c2c1d5498
commit
a7a541e9ff
|
|
@ -135,7 +135,7 @@ public class Bili extends Spider {
|
||||||
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 {
|
||||||
String order = extend.containsKey("order") ? extend.get("order") : "totalrank";
|
String order = extend.containsKey("order") ? extend.get("order") : "totalrank";
|
||||||
String duration = extend.containsKey("duration") ? extend.get("duration") : "0";
|
String duration = extend.containsKey("duration") ? extend.get("duration") : "0";
|
||||||
tid = extend.containsKey("tid") ? extend.get("tid") : tid;
|
if (extend.containsKey("tid")) tid = tid + " " + extend.get("tid");
|
||||||
String api = "https://api.bilibili.com/x/web-interface/search/type?search_type=video&keyword=" + URLEncoder.encode(tid) + "&order=" + order + "&duration=" + duration + "&page=" + pg;
|
String api = "https://api.bilibili.com/x/web-interface/search/type?search_type=video&keyword=" + URLEncoder.encode(tid) + "&order=" + order + "&duration=" + duration + "&page=" + pg;
|
||||||
String json = OkHttp.string(api, getGuest());
|
String json = OkHttp.string(api, getGuest());
|
||||||
Resp resp = Resp.objectFrom(json);
|
Resp resp = Resp.objectFrom(json);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue