Skip to content

Commit

Permalink
Merge pull request #556 from tumuyan/sharebook
Browse files Browse the repository at this point in the history
增加复制小说网址、广告话术规则的功能,优化书源管理、替换规则管理、自动分段算法
  • Loading branch information
gedoor authored Nov 3, 2020
2 parents 8f91d21 + da7a243 commit e8d2414
Show file tree
Hide file tree
Showing 20 changed files with 973 additions and 98 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public class BookInfoBean implements Cloneable {
private String chapterUrl; //章节目录地址,本地目录正则
private long finalRefreshData; //章节最后更新时间
private String coverUrl; //小说封面
private String author;//作者
private String author="";//作者
private String introduce; //简介
private String origin; //来源
private String charset;//编码
Expand Down
14 changes: 11 additions & 3 deletions app/src/main/java/com/kunfei/bookshelf/bean/BookSource3Bean.java
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ private String searchUrl2RuleSearchUrl(String searchUrl) {
Gson gson = new Gson();
httpRequest request = gson.fromJson(strings[1], httpRequest.class);
if (gson.toJson(request).replaceAll("\\s", "").length() > 0) {
// 阅读2.0没有header,只有useragent
// 阅读2.0没有单独的header,只有useragent
if (request.headers != null) {
if (this.header == null)
this.header = request.headers;
Expand Down Expand Up @@ -208,6 +208,14 @@ public BookSourceBean toBookSourceBean() {
ruleFindUrl=exploreUrl.replaceAll("\\{\\{page\\}\\}","searchPage");
}

// 暂时只给发现和搜索添加了header
String header="";
if(this.header!=null){
if(this.header.trim().length()>0)
header="@Header:"+this.header.replaceAll("\\n"," ");
}


return new BookSourceBean(
bookSourceUrl,
bookSourceName,
Expand All @@ -218,7 +226,7 @@ public BookSourceBean toBookSourceBean() {
0, //u serialNumber,
weight,
true, //u enable,
ruleFindUrl,//发现规则 ruleFindUrl,
ruleFindUrl+header,//发现规则 ruleFindUrl,
ruleExplore.bookList, // 列表 ruleFindList,
ruleExplore.name,// ruleFindName,
ruleExplore.author,// ruleFindAuthor,
Expand All @@ -227,7 +235,7 @@ public BookSourceBean toBookSourceBean() {
ruleExplore.lastChapter,// ruleFindLastChapter,
ruleExplore.coverUrl,// ruleFindCoverUrl,
ruleExplore.bookUrl,//??? ruleFindNoteUrl,
RuleSearchUrl,// ruleSearchUrl,
RuleSearchUrl+header,// ruleSearchUrl,
ruleSearch.bookList,// ruleSearchList,
ruleSearch.name,// ruleSearchName,
ruleSearch.author,// ruleSearchAuthor,
Expand Down
Loading

0 comments on commit e8d2414

Please sign in to comment.