another method category for grandpa & grandma
This commit is contained in:
parent
2889988623
commit
7a8b7bedf2
|
|
@ -104,12 +104,12 @@ public class Bili extends Spider {
|
||||||
@Override
|
@Override
|
||||||
public String homeVideoContent() throws Exception {
|
public String homeVideoContent() throws Exception {
|
||||||
fetchRule();
|
fetchRule();
|
||||||
return categoryContent("窗 白噪音", "1", true, new HashMap<>());
|
return categoryContent(ext.optJSONArray("classes").optJSONObject(0).optString("type_id"), "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 {
|
||||||
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");
|
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(OkHttp.string(url, header));
|
JSONObject resp = new JSONObject(OkHttp.string(url, header));
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue