Fix bug
This commit is contained in:
parent
6039aab6f8
commit
fcbb86067b
|
|
@ -66,6 +66,7 @@ public class Bili extends Spider {
|
||||||
@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 {
|
||||||
String duration = extend.containsKey("duration") ? extend.get("duration") : "0";
|
String duration = extend.containsKey("duration") ? extend.get("duration") : "0";
|
||||||
|
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;
|
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(OkHttpUtil.string(url, header));
|
JSONObject resp = new JSONObject(OkHttpUtil.string(url, header));
|
||||||
JSONArray result = resp.getJSONObject("data").getJSONArray("result");
|
JSONArray result = resp.getJSONObject("data").getJSONArray("result");
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue