Update Bili.java

This commit is contained in:
唐三 2023-08-17 13:47:11 +08:00 committed by GitHub
parent 8301daaa07
commit c2f7bd9c55
1 changed files with 8 additions and 7 deletions

View File

@ -148,17 +148,18 @@ public class Bili extends Spider {
public String detailContent(List<String> ids) throws Exception { public String detailContent(List<String> ids) throws Exception {
if (!login) checkLogin(); if (!login) checkLogin();
String id = ids.get(0); String[] split = ids.get(0).split("@");
String api = "https://api.bilibili.com/x/web-interface/archive/stat?bvid=" + id; // String api = "https://api.bilibili.com/x/web-interface/archive/stat?bvid=" + id;
String json = OkHttp.string(api, getMember()); // String json = OkHttp.string(api, getMember());
Resp resp = Resp.objectFrom(json); // Resp resp = Resp.objectFrom(json);
String aid = resp.getData().getAid(); String id = split[0];
String aid = split[1];
api = "https://api.bilibili.com/x/web-interface/view?aid=" + aid; api = "https://api.bilibili.com/x/web-interface/view?aid=" + aid;
json = OkHttp.string(api, getMember()); json = OkHttp.string(api, getMember());
Data detail = Resp.objectFrom(json).getData(); Data detail = Resp.objectFrom(json).getData();
Vod vod = new Vod(); Vod vod = new Vod();
vod.setVodId(id); vod.setVodId(ids.get(0));
vod.setVodPic(detail.getPic()); vod.setVodPic(detail.getPic());
vod.setVodName(detail.getTitle()); vod.setVodName(detail.getTitle());
vod.setTypeName(detail.getType()); vod.setTypeName(detail.getType());
@ -344,4 +345,4 @@ public class Bili extends Spider {
} catch (Exception ignored) { } catch (Exception ignored) {
} }
} }
} }