Skip to content

Commit

Permalink
ClipInfo添加favTime、cTime字段,并在收藏夹解析中解析这俩信息
Browse files Browse the repository at this point in the history
  • Loading branch information
nICEnnnnnnnLee committed Oct 16, 2021
1 parent f2b1f9f commit 66aeca1
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/nicelee/bilibili/model/ClipInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ public class ClipInfo {
String picPreview;
String listName; // 收藏夹名称 或其它集合名称(不一定存在)
String listOwnerName; // 收藏夹主人 或其它集合的拥有者(不一定存在)
// 解析器太多,不想一个一个再去改,只有收藏夹有下面俩
long favTime; // 收藏时间
long cTime; // 发布、更新时间
String upName;
String upId;
HashMap<Integer, String> links;
Expand Down Expand Up @@ -150,4 +153,20 @@ public void setUpId(String upId) {
this.upId = upId;
}

public long getFavTime() {
return favTime;
}

public void setFavTime(long favTime) {
this.favTime = favTime;
}

public long getcTime() {
return cTime;
}

public void setcTime(long cTime) {
this.cTime = cTime;
}

}
4 changes: 4 additions & 0 deletions src/nicelee/bilibili/parsers/impl/MLParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ protected boolean query(int page, int min, int max, Object... obj) {
String avTitle = jAV.getString("title");
String upName = jAV.getJSONObject("upper").getString("name");
String upId = "" + jAV.getJSONObject("upper").getLong("mid");
long favTime = jAV.optLong("fav_time") * 1000;
long cTime = jAV.optLong("ctime") * 1000;
JSONArray jClips = jAV.optJSONArray("pages");
if(jClips == null) {
continue;
Expand All @@ -113,6 +115,8 @@ protected boolean query(int page, int min, int max, Object... obj) {
clip.setUpId(upId);
clip.setAvTitle(avTitle);
clip.setTitle(jClip.getString("title"));
clip.setFavTime(favTime);
clip.setcTime(cTime);

LinkedHashMap<Integer, String> links = new LinkedHashMap<Integer, String>();
// TODO json这里的清晰度到底是什么鬼哦??不知道怎么解析
Expand Down

0 comments on commit 66aeca1

Please sign in to comment.