书源新增请求头配置

pull/5/head
fengyuecanzhu 4 years ago
parent abe39c5eb9
commit cf8f5b797f
  1. 3
      app/build.gradle
  2. 105
      app/src/main/java/xyz/fycz/myreader/entity/JsonModel.java
  3. 2
      app/src/main/java/xyz/fycz/myreader/entity/sourceedit/EditEntityUtil.kt
  4. 35
      app/src/main/java/xyz/fycz/myreader/enums/FindType.java
  5. 22
      app/src/main/java/xyz/fycz/myreader/enums/ReadStyle.java
  6. 21
      app/src/main/java/xyz/fycz/myreader/greendao/entity/rule/BookSource.java
  7. 4
      app/src/main/java/xyz/fycz/myreader/ui/activity/SourceDebugActivity.java
  8. 38
      app/src/main/java/xyz/fycz/myreader/ui/dialog/DialogCreator.java
  9. 14
      app/src/main/java/xyz/fycz/myreader/ui/fragment/FindFragment.java
  10. 4
      app/src/main/java/xyz/fycz/myreader/util/utils/OkHttpUtils.java
  11. 22
      app/src/main/java/xyz/fycz/myreader/webapi/CommonApi.java
  12. 14
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/base/BaseLocalCrawler.java
  13. 26
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/base/BaseSourceCrawler.java
  14. 6
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/base/BaseSourceCrawlerNoInfo.java
  15. 2
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/base/ReadCrawler.java
  16. 179
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/find/Ben100FindCrawler.java
  17. 119
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/find/MiaoBiFindCrawler.java
  18. 158
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/find/QB5FindCrawler.java
  19. 123
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/find/XS7FindCrawler.java
  20. 2
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/find/XS7Rank.java
  21. 133
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/read/Ben100ReadCrawler.java
  22. 3
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/read/BiJianReadCrawler.java
  23. 3
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/read/BiQuGe44ReadCrawler.java
  24. 3
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/read/BiQuGeReadCrawler.java
  25. 3
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/read/CansShu99ReadCrawler.java
  26. 3
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/read/ChaoXingReadCrawler.java
  27. 3
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/read/ChuanQiReadCrawler.java
  28. 3
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/read/DSTQReadCrawler.java
  29. 3
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/read/Du1DuReadCrawler.java
  30. 3
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/read/EWenXueReadCrawler.java
  31. 3
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/read/FYReadCrawler.java
  32. 3
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/read/HongChenReadCrawler.java
  33. 3
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/read/JiuTaoReadCrawler.java
  34. 3
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/read/LaoYaoReadCrawler.java
  35. 3
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/read/LiuLangCatReadCrawler.java
  36. 3
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/read/LuoQiuReadCrawler.java
  37. 3
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/read/MiQuReadCrawler.java
  38. 88
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/read/MiaoBiReadCrawler.java
  39. 3
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/read/PiaoTianReadCrawler.java
  40. 3
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/read/PinShuReadCrawler.java
  41. 3
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/read/PinShuReadCrawler2.java
  42. 136
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/read/QB5ReadCrawler.java
  43. 3
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/read/QiQiReadCrawler.java
  44. 3
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/read/QianDianReadCrawler.java
  45. 3
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/read/QuanNovelReadCrawler.java
  46. 3
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/read/ReXueReadCrawler.java
  47. 3
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/read/ShiGuangReadCrawler.java
  48. 14
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/read/ShuHaiGeReadCrawler.java
  49. 14
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/read/SoNovelReadCrawler.java
  50. 3
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/read/TianLaiReadCrawler.java
  51. 3
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/read/WoLongReadCrawler.java
  52. 3
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/read/XBiQuGeReadCrawler.java
  53. 94
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/read/XS7ReadCrawler.java
  54. 3
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/read/XS7ReadCrawler2.java
  55. 3
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/read/XiaGuReadCrawler.java
  56. 3
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/read/XingXingReadCrawler.java
  57. 3
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/read/YanQingLouReadCrawler.java
  58. 3
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/read/YunZhongReadCrawler.java
  59. 3
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/read/ZW37ReadCrawler.java
  60. 3
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/read/ZaiShuYuanReadCrawler.java
  61. 3
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/read/ZuoPinReadCrawler.java
  62. 1
      app/src/main/res/values/strings.xml

@ -204,10 +204,11 @@ dependencies {
//JS //JS
//noinspection GradleDependency //noinspection GradleDependency
implementation 'com.github.gedoor:rhino-android:1.3' implementation 'com.github.gedoor:rhino-android:1.3'
} }
greendao { greendao {
schemaVersion 23 schemaVersion 24
daoPackage 'xyz.fycz.myreader.greendao.gen' daoPackage 'xyz.fycz.myreader.greendao.gen'
// targetGenDir 'src/main/java' // targetGenDir 'src/main/java'
} }

@ -1,105 +0,0 @@
package xyz.fycz.myreader.entity;
import java.io.Serializable;
public class JsonModel implements Serializable {
private static final long serialVersionUID = -7169864463597942730L;
private int error;//错误码
private boolean success;//请求是否成功
private String result;//服务器返回的json数据存放与此
private String token;
private int datasize;
private String publicKey;
private int visibleLastIndex = 0;
private int visibleItemCount;
public JsonModel() {
}
public String getPublicKey() {
return publicKey;
}
public void setPublicKey(String publicKey) {
this.publicKey = publicKey;
}
public int getError() {
return this.error;
}
public void setError(int error) {
this.error = error;
}
public String getResult() {
return this.result;
}
public void setResult(String result) {
this.result = result;
}
public String getToken() {
return this.token;
}
public void setToken(String token) {
this.token = token;
}
public boolean isSuccess() {
return this.success;
}
public void setSuccess(boolean success) {
this.success = success;
}
public int getVisibleLastIndex() {
return this.visibleLastIndex;
}
public void setVisibleLastIndex(int visibleLastIndex) {
this.visibleLastIndex = visibleLastIndex;
}
public int getVisibleItemCount() {
return this.visibleItemCount;
}
public void setVisibleItemCount(int visibleItemCount) {
this.visibleItemCount = visibleItemCount;
}
public int getDatasize() {
return this.datasize;
}
public void setDatasize(int datasize) {
this.datasize = datasize;
}
@Override
public String toString() {
return "JsonModel{" +
"error=" + error +
", success=" + success +
", result='" + result + '\'' +
", token='" + token + '\'' +
", datasize=" + datasize +
", visibleLastIndex=" + visibleLastIndex +
", visibleItemCount=" + visibleItemCount +
'}';
}
}

@ -16,6 +16,7 @@ object EditEntityUtil {
add(EditEntity("sourceName", source?.sourceName, R.string.source_name, "不能为空")) add(EditEntity("sourceName", source?.sourceName, R.string.source_name, "不能为空"))
add(EditEntity("sourceGroup", source?.sourceGroup, R.string.source_group, "不同分组以;/,隔开")) add(EditEntity("sourceGroup", source?.sourceGroup, R.string.source_group, "不同分组以;/,隔开"))
add(EditEntity("sourceCharset", source?.sourceCharset, R.string.source_charset, "默认UTF-8")) add(EditEntity("sourceCharset", source?.sourceCharset, R.string.source_charset, "默认UTF-8"))
add(EditEntity("sourceHeaders", source?.sourceHeaders, R.string.source_headers, "json格式"))
add(EditEntity("sourceComment", source?.sourceComment, R.string.comment, "这是您留给使用者的说明")) add(EditEntity("sourceComment", source?.sourceComment, R.string.comment, "这是您留给使用者的说明"))
} }
return sourceEntities return sourceEntities
@ -104,6 +105,7 @@ object EditEntityUtil {
"sourceName" -> source.sourceName = it.value "sourceName" -> source.sourceName = it.value
"sourceGroup" -> source.sourceGroup = it.value "sourceGroup" -> source.sourceGroup = it.value
"sourceCharset" -> source.sourceCharset = it.value "sourceCharset" -> source.sourceCharset = it.value
"sourceHeaders" -> source.sourceHeaders = it.value
"sourceComment" -> source.sourceComment = it.value "sourceComment" -> source.sourceComment = it.value
} }
} }

@ -1,35 +0,0 @@
package xyz.fycz.myreader.enums;
import java.io.Serializable;
public enum FindType implements Serializable {
qidian("排行榜[起点中文网]", "https://www.qidian.com/rank"),
qidianns("排行榜[起点女生网]", "https://www.qidian.com/mm/rank"),
qb5("书城[全本小说]", "https://www.qb5.tw"),
biquge("书城[笔趣阁]", "https://www.52bqg.com");
private String text;
private String url;
private static final long serialVersionUID = 1L;
FindType(String text, String url) {
this.text = text;
this.url = url;
}
public static FindType get(int var0) {
return values()[var0];
}
public static FindType fromString(String string) {
return valueOf(string);
}
public String getText() {
return text;
}
public String getUrl() {
return url;
}
}

@ -1,22 +0,0 @@
package xyz.fycz.myreader.enums;
public enum ReadStyle {
protectedEye,//护眼
common,//普通
blueDeep,//深蓝
leather,//羊皮纸
breen,//
custom;
ReadStyle() {
}
public static ReadStyle get(int var0) {
return values()[var0];
}
public static ReadStyle fromString(String string) {
return ReadStyle.valueOf(string);
}
}

@ -42,6 +42,7 @@ public class BookSource implements Parcelable, Cloneable {
private String sourceGroup; private String sourceGroup;
private String sourceCharset; private String sourceCharset;
private String sourceType; private String sourceType;
private String sourceHeaders;
private String sourceComment; private String sourceComment;
private Long lastUpdateTime; private Long lastUpdateTime;
@ -71,17 +72,18 @@ public class BookSource implements Parcelable, Cloneable {
@Convert(converter = FindRuleConvert.class, columnType = String.class) @Convert(converter = FindRuleConvert.class, columnType = String.class)
private FindRule findRule; private FindRule findRule;
@Generated(hash = 441434718) @Generated(hash = 1082429073)
public BookSource(String sourceUrl, String sourceEName, String sourceName, String sourceGroup, public BookSource(String sourceUrl, String sourceEName, String sourceName, String sourceGroup,
String sourceCharset, String sourceType, String sourceComment, Long lastUpdateTime, String sourceCharset, String sourceType, String sourceHeaders, String sourceComment,
int orderNum, int weight, boolean enable, SearchRule searchRule, InfoRule infoRule, Long lastUpdateTime, int orderNum, int weight, boolean enable, SearchRule searchRule,
TocRule tocRule, ContentRule contentRule, FindRule findRule) { InfoRule infoRule, TocRule tocRule, ContentRule contentRule, FindRule findRule) {
this.sourceUrl = sourceUrl; this.sourceUrl = sourceUrl;
this.sourceEName = sourceEName; this.sourceEName = sourceEName;
this.sourceName = sourceName; this.sourceName = sourceName;
this.sourceGroup = sourceGroup; this.sourceGroup = sourceGroup;
this.sourceCharset = sourceCharset; this.sourceCharset = sourceCharset;
this.sourceType = sourceType; this.sourceType = sourceType;
this.sourceHeaders = sourceHeaders;
this.sourceComment = sourceComment; this.sourceComment = sourceComment;
this.lastUpdateTime = lastUpdateTime; this.lastUpdateTime = lastUpdateTime;
this.orderNum = orderNum; this.orderNum = orderNum;
@ -106,6 +108,7 @@ public class BookSource implements Parcelable, Cloneable {
sourceGroup = in.readString(); sourceGroup = in.readString();
sourceCharset = in.readString(); sourceCharset = in.readString();
sourceType = in.readString(); sourceType = in.readString();
sourceHeaders = in.readString();
sourceComment = in.readString(); sourceComment = in.readString();
if (in.readByte() == 0) { if (in.readByte() == 0) {
lastUpdateTime = null; lastUpdateTime = null;
@ -130,6 +133,7 @@ public class BookSource implements Parcelable, Cloneable {
dest.writeString(sourceGroup); dest.writeString(sourceGroup);
dest.writeString(sourceCharset); dest.writeString(sourceCharset);
dest.writeString(sourceType); dest.writeString(sourceType);
dest.writeString(sourceHeaders);
dest.writeString(sourceComment); dest.writeString(sourceComment);
if (lastUpdateTime == null) { if (lastUpdateTime == null) {
dest.writeByte((byte) 0); dest.writeByte((byte) 0);
@ -176,6 +180,7 @@ public class BookSource implements Parcelable, Cloneable {
stringEquals(sourceGroup, source.sourceGroup) && stringEquals(sourceGroup, source.sourceGroup) &&
stringEquals(sourceCharset, source.sourceCharset) && stringEquals(sourceCharset, source.sourceCharset) &&
stringEquals(sourceType, source.sourceType) && stringEquals(sourceType, source.sourceType) &&
stringEquals(sourceHeaders, source.sourceHeaders) &&
stringEquals(sourceComment, source.sourceComment) && stringEquals(sourceComment, source.sourceComment) &&
Objects.equals(searchRule, source.searchRule) && Objects.equals(searchRule, source.searchRule) &&
Objects.equals(infoRule, source.infoRule) && Objects.equals(infoRule, source.infoRule) &&
@ -370,4 +375,12 @@ public class BookSource implements Parcelable, Cloneable {
public void setSourceType(String sourceType) { public void setSourceType(String sourceType) {
this.sourceType = sourceType; this.sourceType = sourceType;
} }
public String getSourceHeaders() {
return this.sourceHeaders;
}
public void setSourceHeaders(String sourceHeaders) {
this.sourceHeaders = sourceHeaders;
}
} }

@ -158,9 +158,9 @@ public class SourceDebugActivity extends BaseActivity {
String body = urlInfo[1]; String body = urlInfo[1];
MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded"); MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
RequestBody requestBody = RequestBody.create(mediaType, body); RequestBody requestBody = RequestBody.create(mediaType, body);
debugEntity.setHtml(OkHttpUtils.getHtml(url, requestBody, rc.getCharset())); debugEntity.setHtml(OkHttpUtils.getHtml(url, requestBody, rc.getCharset(), rc.getHeaders()));
} else { } else {
debugEntity.setHtml(OkHttpUtils.getHtml(NetworkUtils.getAbsoluteURL(rc.getNameSpace(), url), rc.getCharset())); debugEntity.setHtml(OkHttpUtils.getHtml(NetworkUtils.getAbsoluteURL(rc.getNameSpace(), url), rc.getCharset(), rc.getHeaders()));
} }
ListResult listResult = new ListResult(); ListResult listResult = new ListResult();
switch (debugEntity.getDebugMode()) { switch (debugEntity.getDebugMode()) {

@ -5,20 +5,20 @@ import android.app.ProgressDialog;
import android.content.Context; import android.content.Context;
import android.content.DialogInterface; import android.content.DialogInterface;
import android.view.View; import android.view.View;
import android.widget.*; import android.widget.SeekBar;
import android.widget.TextView;
import androidx.appcompat.app.AlertDialog; import androidx.appcompat.app.AlertDialog;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import xyz.fycz.myreader.R; import xyz.fycz.myreader.R;
import xyz.fycz.myreader.application.App; import xyz.fycz.myreader.application.App;
import xyz.fycz.myreader.enums.ReadStyle;
import xyz.fycz.myreader.util.IOUtils; import xyz.fycz.myreader.util.IOUtils;
import xyz.fycz.myreader.util.StringHelper; import xyz.fycz.myreader.util.StringHelper;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class DialogCreator { public class DialogCreator {
/** /**
@ -280,32 +280,6 @@ public class DialogCreator {
void onClick(Dialog dialog, View view); void onClick(Dialog dialog, View view);
} }
/**
* 白天黑夜切换监听
*/
public interface OnClickNightAndDayListener {
void onClick(Dialog dialog, View view, boolean isDayStyle);
}
/**
* 阅读style切换监听器
*/
public interface OnReadStyleChangeListener {
void onChange(ReadStyle readStyle);
}
public interface OnBrightFollowSystemChangeListener {
void onChange(boolean isFollowSystem);
}
public interface OnClickDownloadAllChapterListener {
void onClick(Dialog dialog, View view,TextView tvDownloadProgress);
}
public interface OnPageModeChangeListener {
void onChange(TextView tvPageMode);
}
public interface OnSkipChapterListener{ public interface OnSkipChapterListener{
void onClick(TextView chapterTitle, TextView chapterUrl, SeekBar sbReadChapterProgress); void onClick(TextView chapterTitle, TextView chapterUrl, SeekBar sbReadChapterProgress);
} }

@ -10,12 +10,10 @@ import xyz.fycz.myreader.common.APPCONST;
import xyz.fycz.myreader.databinding.FragmentFindBinding; import xyz.fycz.myreader.databinding.FragmentFindBinding;
import xyz.fycz.myreader.ui.activity.BookstoreActivity; import xyz.fycz.myreader.ui.activity.BookstoreActivity;
import xyz.fycz.myreader.webapi.crawler.base.FindCrawler; import xyz.fycz.myreader.webapi.crawler.base.FindCrawler;
import xyz.fycz.myreader.webapi.crawler.find.Ben100FindCrawler;
import xyz.fycz.myreader.webapi.crawler.find.MiaoBiFindCrawler;
import xyz.fycz.myreader.webapi.crawler.find.QB5FindCrawler;
import xyz.fycz.myreader.webapi.crawler.find.QiDianMobileRank; import xyz.fycz.myreader.webapi.crawler.find.QiDianMobileRank;
import xyz.fycz.myreader.webapi.crawler.find.XS7Rank;
import xyz.fycz.myreader.webapi.crawler.read.Ben100ReadCrawler;
import xyz.fycz.myreader.webapi.crawler.read.MiaoBiReadCrawler;
import xyz.fycz.myreader.webapi.crawler.read.QB5ReadCrawler;
import xyz.fycz.myreader.webapi.crawler.read.XS7ReadCrawler;
/** /**
* @author fengyue * @author fengyue
@ -39,9 +37,9 @@ public class FindFragment extends BaseFragment {
//binding.findRlXs7Top.setOnClickListener(v -> comeToBookstore(new XS7Rank())); //binding.findRlXs7Top.setOnClickListener(v -> comeToBookstore(new XS7Rank()));
binding.findRlQidianSort.setOnClickListener(v -> comeToBookstore(new QiDianMobileRank(false, true))); binding.findRlQidianSort.setOnClickListener(v -> comeToBookstore(new QiDianMobileRank(false, true)));
binding.findRlQidianNsSort.setOnClickListener(v -> comeToBookstore(new QiDianMobileRank(true, true))); binding.findRlQidianNsSort.setOnClickListener(v -> comeToBookstore(new QiDianMobileRank(true, true)));
binding.findRlQb5Store.setOnClickListener(v -> comeToBookstore(new QB5ReadCrawler())); binding.findRlQb5Store.setOnClickListener(v -> comeToBookstore(new QB5FindCrawler()));
binding.findRlBen100Store.setOnClickListener(v -> comeToBookstore(new Ben100ReadCrawler())); binding.findRlBen100Store.setOnClickListener(v -> comeToBookstore(new Ben100FindCrawler()));
binding.findRlMiaoquStore.setOnClickListener(v -> comeToBookstore(new MiaoBiReadCrawler())); binding.findRlMiaoquStore.setOnClickListener(v -> comeToBookstore(new MiaoBiFindCrawler()));
//binding.findRlXs7Store.setOnClickListener(v -> comeToBookstore(new XS7ReadCrawler())); //binding.findRlXs7Store.setOnClickListener(v -> comeToBookstore(new XS7ReadCrawler()));
} }

@ -52,6 +52,10 @@ public class OkHttpUtils {
return getHtml(url, null, encodeType); return getHtml(url, null, encodeType);
} }
public static String getHtml(String url, String encodeType, Map<String, String> headers) throws IOException {
return getHtml(url, null, encodeType, headers);
}
public static String getHtml(String url, RequestBody requestBody, String encodeType) throws IOException { public static String getHtml(String url, RequestBody requestBody, String encodeType) throws IOException {
return getHtml(url, requestBody, encodeType, null); return getHtml(url, requestBody, encodeType, null);
} }

@ -32,7 +32,7 @@ public class CommonApi {
url = NetworkUtils.getAbsoluteURL(rc.getNameSpace(), url); url = NetworkUtils.getAbsoluteURL(rc.getNameSpace(), url);
String finalUrl = url; String finalUrl = url;
return Observable.create(emitter -> { return Observable.create(emitter -> {
emitter.onNext(rc.getChaptersFromHtml(OkHttpUtils.getHtml(finalUrl, charset))); emitter.onNext(rc.getChaptersFromHtml(OkHttpUtils.getHtml(finalUrl, charset, rc.getHeaders())));
emitter.onComplete(); emitter.onComplete();
}); });
} }
@ -48,7 +48,7 @@ public class CommonApi {
url = NetworkUtils.getAbsoluteURL(rc.getNameSpace(), url); url = NetworkUtils.getAbsoluteURL(rc.getNameSpace(), url);
String finalUrl = url; String finalUrl = url;
return Observable.create(emitter -> { return Observable.create(emitter -> {
emitter.onNext(rc.getContentFormHtml(OkHttpUtils.getHtml(finalUrl, charset))); emitter.onNext(rc.getContentFormHtml(OkHttpUtils.getHtml(finalUrl, charset, rc.getHeaders())));
emitter.onComplete(); emitter.onComplete();
}); });
} }
@ -84,20 +84,9 @@ public class CommonApi {
String body = makeSearchUrl(urlInfo[1], key); String body = makeSearchUrl(urlInfo[1], key);
MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded"); MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
RequestBody requestBody = RequestBody.create(mediaType, body); RequestBody requestBody = RequestBody.create(mediaType, body);
if (rc.getNameSpace().contains("soxs.cc") || emitter.onNext(rc.getBooksFromSearchHtml(OkHttpUtils.getHtml(url, requestBody, finalCharset, rc.getHeaders())));
rc.getNameSpace().contains("xinshuhaige.org") ||
rc.getNameSpace().contains("bxwxorg.com") ||
rc.getNameSpace().contains("soshuw.com")) {
String cookie = "Hm_lvt_46329db612a10d9ae3a668a40c152e0e=1612793811,1612795781,1613200980,1613218588; "
+ "__cfduid=d0ebd0275436b7b0c3ccf4c9eb7394abd1619231977 ";
Map<String, String> headers = new HashMap<>();
headers.put("Cookie", cookie);
emitter.onNext(rc.getBooksFromSearchHtml(OkHttpUtils.getHtml(url, requestBody, finalCharset, headers)));
} else { } else {
emitter.onNext(rc.getBooksFromSearchHtml(OkHttpUtils.getHtml(url, requestBody, finalCharset))); emitter.onNext(rc.getBooksFromSearchHtml(OkHttpUtils.getHtml(makeSearchUrl(rc.getSearchLink(), key), finalCharset, rc.getHeaders())));
}
} else {
emitter.onNext(rc.getBooksFromSearchHtml(OkHttpUtils.getHtml(makeSearchUrl(rc.getSearchLink(), key), finalCharset)));
} }
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
@ -126,7 +115,8 @@ public class CommonApi {
url = NetworkUtils.getAbsoluteURL(bic.getNameSpace(), url); url = NetworkUtils.getAbsoluteURL(bic.getNameSpace(), url);
String finalUrl = url; String finalUrl = url;
return Observable.create(emitter -> { return Observable.create(emitter -> {
emitter.onNext(bic.getBookInfo(OkHttpUtils.getHtml(finalUrl, bic.getCharset()), book)); emitter.onNext(bic.getBookInfo(OkHttpUtils.getHtml(finalUrl, bic.getCharset(),
((ReadCrawler) bic).getHeaders()), book));
emitter.onComplete(); emitter.onComplete();
}); });
} }

@ -0,0 +1,14 @@
package xyz.fycz.myreader.webapi.crawler.base;
import java.util.Map;
/**
* @author fengyue
* @date 2021/5/13 22:29
*/
public abstract class BaseLocalCrawler implements ReadCrawler {
@Override
public Map<String, String> getHeaders() {
return null;
}
}

@ -2,9 +2,15 @@ package xyz.fycz.myreader.webapi.crawler.base;
import android.text.TextUtils; import android.text.TextUtils;
import org.json.JSONException;
import org.json.JSONObject;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List; import java.util.List;
import java.util.Map;
import xyz.fycz.myreader.entity.SearchBookBean; import xyz.fycz.myreader.entity.SearchBookBean;
import xyz.fycz.myreader.greendao.entity.Book; import xyz.fycz.myreader.greendao.entity.Book;
@ -339,6 +345,26 @@ public abstract class BaseSourceCrawler implements ReadCrawler, BookInfoCrawler
return book; return book;
} }
@Override
public Map<String, String> getHeaders() {
if (!StringUtils.isJsonObject(source.getSourceHeaders()))
return null;
try {
JSONObject headersJson = new JSONObject(source.getSourceHeaders());
Map<String, String> headers = new HashMap<>();
Iterator<String> it = headersJson.keys();
while (it.hasNext()){
String key = it.next();
String value = String.valueOf(headersJson.get(key));
headers.put(key, value);
}
return headers;
} catch (JSONException e) {
e.printStackTrace();
}
return null;
}
/** /**
* 从列表中获取单个书籍/章节对象 * 从列表中获取单个书籍/章节对象
* *

@ -1,6 +1,7 @@
package xyz.fycz.myreader.webapi.crawler.base; package xyz.fycz.myreader.webapi.crawler.base;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Map;
import xyz.fycz.myreader.entity.SearchBookBean; import xyz.fycz.myreader.entity.SearchBookBean;
import xyz.fycz.myreader.greendao.entity.Book; import xyz.fycz.myreader.greendao.entity.Book;
@ -58,4 +59,9 @@ public class BaseSourceCrawlerNoInfo implements ReadCrawler {
public String getContentFormHtml(String html) { public String getContentFormHtml(String html) {
return crawler.getContentFormHtml(html); return crawler.getContentFormHtml(html);
} }
@Override
public Map<String, String> getHeaders() {
return crawler.getHeaders();
}
} }

@ -6,6 +6,7 @@ import xyz.fycz.myreader.greendao.entity.Chapter;
import xyz.fycz.myreader.model.mulvalmap.ConcurrentMultiValueMap; import xyz.fycz.myreader.model.mulvalmap.ConcurrentMultiValueMap;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Map;
/** /**
* @author fengyue * @author fengyue
@ -18,6 +19,7 @@ public interface ReadCrawler {
String getSearchCharset(); // 书源搜索关键字的字符编码,和书源的字符编码就行 String getSearchCharset(); // 书源搜索关键字的字符编码,和书源的字符编码就行
String getNameSpace(); // 书源主页地址 String getNameSpace(); // 书源主页地址
Boolean isPost(); // 是否以post请求搜索 Boolean isPost(); // 是否以post请求搜索
Map<String, String> getHeaders();// 自定义请求头,可添加cookie等
ConcurrentMultiValueMap<SearchBookBean, Book> getBooksFromSearchHtml(String html); // 搜索书籍规则 ConcurrentMultiValueMap<SearchBookBean, Book> getBooksFromSearchHtml(String html); // 搜索书籍规则
ArrayList<Chapter> getChaptersFromHtml(String html); // 获取书籍章节列表规则 ArrayList<Chapter> getChaptersFromHtml(String html); // 获取书籍章节列表规则
String getContentFormHtml(String html); // 获取书籍内容规则 String getContentFormHtml(String html); // 获取书籍内容规则

@ -0,0 +1,179 @@
package xyz.fycz.myreader.webapi.crawler.find;
import android.text.Html;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import xyz.fycz.myreader.entity.SearchBookBean;
import xyz.fycz.myreader.entity.bookstore.BookType;
import xyz.fycz.myreader.enums.LocalBookSource;
import xyz.fycz.myreader.greendao.entity.Book;
import xyz.fycz.myreader.greendao.entity.Chapter;
import xyz.fycz.myreader.model.mulvalmap.ConcurrentMultiValueMap;
import xyz.fycz.myreader.webapi.crawler.base.BookInfoCrawler;
import xyz.fycz.myreader.webapi.crawler.base.FindCrawler;
import xyz.fycz.myreader.webapi.crawler.base.ReadCrawler;
@Deprecated
public class Ben100FindCrawler extends FindCrawler {
public static final String NAME_SPACE = "https://www.100ben.net";
public static final String CHARSET = "UTF-8";
public static final String SEARCH_CHARSET = "utf-8";
public static final String FIND_NAME = "书城[100本书·实体]";
private LinkedHashMap<String, String> mBookTypes = new LinkedHashMap<>();
@Override
public String getCharset() {
return CHARSET;
}
@Override
public String getFindName() {
return FIND_NAME;
}
@Override
public String getFindUrl() {
return NAME_SPACE;
}
@Override
public boolean hasImg() {
return true;
}
@Override
public boolean needSearch() {
return false;
}
/**
* 获取书籍详细信息
*
* @param book
*/
public Book getBookInfo(String html, Book book) {
Document doc = Jsoup.parse(html);
Element img = doc.getElementById("fmimg");
book.setImgUrl(img.getElementsByTag("img").get(0).attr("src"));
Element desc = doc.getElementById("intro");
book.setDesc(desc.getElementsByTag("p").get(0).text());
Element type = doc.getElementsByClass("con_top").get(0);
book.setType(type.getElementsByTag("a").get(2).text());
return book;
}
@Override
public List<BookType> getBookTypes(String html) {
List<BookType> bookTypes = new ArrayList<>();
Document doc = Jsoup.parse(html);
Element menu = doc.getElementsByClass("menu").first();
for (Element a : menu.children()) {
String name = a.text();
String url = a.attr("href");
if ("首页".equals(name)) {
name = "100本书";
} else if (name.contains("全部小说")) {
name = "全部小说";
}
BookType bookType = new BookType();
bookType.setTypeName(name);
bookType.setUrl(url);
bookTypes.add(bookType);
System.out.println("bookTypes.put(\"" + bookType.getTypeName() + "\", \"" + bookType.getUrl() + "\");");
}
return bookTypes;
}
@Override
public List<BookType> getBookTypes() {
initBookTypes();
List<BookType> bookTypes = new ArrayList<>();
for (String name : mBookTypes.keySet()) {
BookType bookType = new BookType();
bookType.setTypeName(name);
bookType.setUrl(mBookTypes.get(name));
bookTypes.add(bookType);
}
return bookTypes;
}
private void initBookTypes() {
mBookTypes.put("世界名著", "https://www.100ben.net/shijiemingzhu/");
mBookTypes.put("现代文学", "https://www.100ben.net/xiandaiwenxue/");
mBookTypes.put("外国小说", "https://www.100ben.net/waiguoxiaoshuo/");
mBookTypes.put("励志书籍", "https://www.100ben.net/lizhishuji/");
mBookTypes.put("古典文学", "https://www.100ben.net/gudianwenxue/");
mBookTypes.put("武侠小说", "https://www.100ben.net/wuxiaxiaoshuo/");
mBookTypes.put("言情小说", "https://www.100ben.net/yanqingxiaoshuo/");
mBookTypes.put("推理小说", "https://www.100ben.net/tuilixiaoshuo/");
mBookTypes.put("科幻小说", "https://www.100ben.net/kehuanxiaoshuo/");
mBookTypes.put("人物传记", "https://www.100ben.net/renwuzhuanji/");
mBookTypes.put("盗墓悬疑", "https://www.100ben.net/daomuxuanyi/");
mBookTypes.put("玄幻穿越", "https://www.100ben.net/xuanhuanchuanyue/");
mBookTypes.put("科普书籍", "https://www.100ben.net/kepushuji/");
mBookTypes.put("100本书", "https://www.100ben.net/");
mBookTypes.put("全部小说", "https://www.100ben.net/all/");
}
@Override
public List<Book> getFindBooks(String html, BookType bookType) {
List<Book> books = new ArrayList<>();
Document doc = Jsoup.parse(html);
try {
Element pageDiv = doc.getElementsByClass("page").first();
String page = pageDiv.getElementsByTag("a").last().text();
String pageStr = page.replace("末页(", "").replace(")", "");
bookType.setPageSize(Integer.parseInt(pageStr));
} catch (Exception ignored) {
}
Elements divs = doc.getElementsByClass("recommand");
Element div = divs.get(0);
Elements elementsByTag = div.getElementsByTag("li");
for (Element element : elementsByTag) {
Book book = new Book();
String name = element.getElementsByClass("titles").first().getElementsByTag("a").first().text();
book.setName(name);
String author = element.getElementsByClass("author").first().text().replace("作者:", "");
book.setAuthor(author);
String imgUrl = element.getElementsByTag("img").first().attr("src");
book.setImgUrl(imgUrl);
String chapterUrl = element.getElementsByClass("titles").first().getElementsByTag("a").first().attr("href");
book.setChapterUrl(chapterUrl);
String desc = element.getElementsByClass("intro").first().text();
book.setDesc(desc);
book.setNewestChapterTitle("");
book.setType(bookType.getTypeName());
book.setSource(LocalBookSource.ben100.toString());
books.add(book);
}
return books;
}
@Override
public boolean getTypePage(BookType curType, int page) {
if (curType.getPageSize() <= 0) {
curType.setPageSize(1);
}
if (page > curType.getPageSize()) {
return true;
}
if (curType.getTypeName().equals("100本书")) return false;
if (curType.getUrl().contains("list")) {
curType.setUrl(curType.getUrl().substring(0, curType.getUrl().lastIndexOf("_") + 1) + page + ".html");
} else {
curType.setUrl(curType.getUrl() + "list_" + page + ".html");
}
return false;
}
}

@ -0,0 +1,119 @@
package xyz.fycz.myreader.webapi.crawler.find;
import android.text.Html;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import xyz.fycz.myreader.entity.SearchBookBean;
import xyz.fycz.myreader.entity.bookstore.BookType;
import xyz.fycz.myreader.enums.LocalBookSource;
import xyz.fycz.myreader.greendao.entity.Book;
import xyz.fycz.myreader.greendao.entity.Chapter;
import xyz.fycz.myreader.model.mulvalmap.ConcurrentMultiValueMap;
import xyz.fycz.myreader.webapi.crawler.base.FindCrawler;
import xyz.fycz.myreader.webapi.crawler.base.ReadCrawler;
public class MiaoBiFindCrawler extends FindCrawler {
public static final String NAME_SPACE = "https://www.imiaobige.com";
public static final String CHARSET = "UTF-8";
public static final String SEARCH_CHARSET = "UTF-8";
public static final String FIND_NAME = "书城[妙笔阁]";
private final LinkedHashMap<String, String> mBookTypes = new LinkedHashMap<>();
@Override
public String getCharset() {
return CHARSET;
}
@Override
public String getFindName() {
return FIND_NAME;
}
@Override
public String getFindUrl() {
return NAME_SPACE;
}
@Override
public boolean hasImg() {
return true;
}
@Override
public boolean needSearch() {
return false;
}
@Override
public List<BookType> getBookTypes() {
initBookTypes();
List<BookType> bookTypes = new ArrayList<>();
for (String name : mBookTypes.keySet()) {
BookType bookType = new BookType();
bookType.setTypeName(name);
bookType.setUrl(mBookTypes.get(name));
bookType.setPageSize(100);
bookTypes.add(bookType);
}
return bookTypes;
}
private void initBookTypes() {
mBookTypes.put("玄幻奇幻", "https://www.imiaobige.com/xuanhuan/1.html");
mBookTypes.put("武侠仙侠", "https://www.imiaobige.com/wuxia/1.html");
mBookTypes.put("都市生活", "https://www.imiaobige.com/dushi/1.html");
mBookTypes.put("历史军事", "https://www.imiaobige.com/lishi/1.html");
mBookTypes.put("游戏竞技", "https://www.imiaobige.com/youxi/1.html");
mBookTypes.put("科幻未来", "https://www.imiaobige.com/kehuan/1.html");
}
/*
<dl>
<dt><a href="/novel/225809.html"><img src="https://img.imiaobige.com/225809/1177644.jpg" alt="重生之我变成了火星" height="155" width="120"></a></dt>
<dd><span class="uptime">20-11-26 16:57</span><a href="/novel/225809.html"><h3>重生之我变成了火星</h3></a></dd>
<dd class="book_other">作者<a href="/author/仰望黑夜/">仰望黑夜</a>状态<span>连载中</span></dd>
<dd class="book_des">重生成了火星第一阶段科技进化第二阶段高魔进化第三阶段超魔进化宇宙之间除了人类还有无数可怕存在让我带领人类征服宇宙我们的目标是星辰大海~</dd>
<dd class="book_other">最新章节<a href="/read/225809/863539.html">第三百一十六章 时空道兵</a></dd>
</dl>
*/
@Override
public List<Book> getFindBooks(String html, BookType bookType) {
List<Book> books = new ArrayList<>();
Document doc = Jsoup.parse(html);
Element div = doc.getElementById("sitebox");
Elements dls = div.getElementsByTag("dl");
for (Element dl : dls) {
Book book = new Book();
Elements as = dl.getElementsByTag("a");
book.setName(as.get(1).text());
book.setAuthor(as.get(2).text());
book.setType(bookType.getTypeName());
book.setNewestChapterTitle(as.get(3).text());
book.setDesc(dl.getElementsByClass("book_des").first().text());
book.setImgUrl(as.first().getElementsByTag("img").attr("src"));
book.setChapterUrl(as.get(1).attr("href").replace("novel", "read").replace(".html", "/"));
book.setUpdateDate(dl.getElementsByClass("uptime").first().text());
book.setSource(LocalBookSource.miaobi.toString());
books.add(book);
}
return books;
}
@Override
public boolean getTypePage(BookType curType, int page) {
if (page > curType.getPageSize()) {
return true;
}
curType.setUrl(curType.getUrl().substring(0, curType.getUrl().lastIndexOf("/") + 1) + page + ".html");
return false;
}
}

@ -0,0 +1,158 @@
package xyz.fycz.myreader.webapi.crawler.find;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;
import java.util.ArrayList;
import java.util.List;
import xyz.fycz.myreader.entity.bookstore.BookType;
import xyz.fycz.myreader.enums.LocalBookSource;
import xyz.fycz.myreader.greendao.entity.Book;
import xyz.fycz.myreader.util.StringHelper;
import xyz.fycz.myreader.webapi.crawler.base.FindCrawler;
public class QB5FindCrawler extends FindCrawler {
public static final String FIND_URL = "https://www.qb50.com";
public static final String FIND_NAME = "书城[全本小说]";
private static final String CHARSET = "GBK";
@Override
public String getCharset() {
return CHARSET;
}
@Override
public String getFindName() {
return FIND_NAME;
}
@Override
public String getFindUrl() {
return FIND_URL;
}
@Override
public boolean hasImg() {
return false;
}
@Override
public boolean needSearch() {
return false;
}
/**
* 获取书城小说分类列表
*
* @param html
* @return
*/
public List<BookType> getBookTypes(String html) {
List<BookType> bookTypes = new ArrayList<>();
Document doc = Jsoup.parse(html);
Elements divs = doc.getElementsByClass("nav_cont");
if (divs.size() > 0) {
Elements uls = divs.get(0).getElementsByTag("ul");
if (uls.size() > 0) {
for (Element li : uls.get(0).children()) {
Element a = li.child(0);
BookType bookType = new BookType();
bookType.setTypeName(a.attr("title"));
bookType.setUrl(a.attr("href"));
if (bookType.getTypeName().contains("首页") || bookType.getTypeName().contains("热门小说"))
continue;
if (!StringHelper.isEmpty(bookType.getTypeName())) {
bookTypes.add(bookType);
}
}
}
}
return bookTypes;
}
/**
* 获取某一分类小说排行榜列表
*
* @param html
* @return
*/
public List<Book> getBookRankList(String html) {
List<Book> books = new ArrayList<>();
Document doc = Jsoup.parse(html);
Elements divs = doc.getElementsByClass("r");
if (divs.size() > 0) {
Elements uls = divs.get(0).getElementsByTag("ul");
if (uls.size() > 0) {
for (Element li : uls.get(0).children()) {
Book book = new Book();
Element scanS1 = li.getElementsByClass("s1").get(0);
Element scanS2 = li.getElementsByClass("s2").get(0);
Element scanS5 = li.getElementsByClass("s5").get(0);
book.setType(scanS1.html().replace("[", "").replace("]", ""));
Element a = scanS2.getElementsByTag("a").get(0);
book.setName(a.attr("title"));
book.setChapterUrl(a.attr("href"));
book.setAuthor(scanS5.html());
book.setSource(LocalBookSource.biquge.toString());
books.add(book);
}
}
}
return books;
}
public List<Book> getFindBooks(String html, BookType bookType) {
List<Book> books = new ArrayList<>();
Document doc = Jsoup.parse(html);
try {
int pageSize = Integer.parseInt(doc.getElementsByClass("last").first().text());
bookType.setPageSize(pageSize);
} catch (Exception ignored) {
}
String type = doc.select("meta[name=keywords]").attr("content").replace(",全本小说网", "");
Element div = doc.getElementById("tlist");
Elements uls = div.getElementsByTag("ul");
if (uls.size() > 0) {
for (Element li : uls.get(0).children()) {
Book book = new Book();
Element aName = li.getElementsByClass("name").get(0);
Element divZz = li.getElementsByClass("zz").get(0);
Element divAuthor = li.getElementsByClass("author").get(0);
Element divSj = li.getElementsByClass("sj").get(0);
book.setType(type);
book.setName(aName.attr("title"));
book.setChapterUrl(aName.attr("href"));
book.setNewestChapterTitle(divZz.text());
book.setAuthor(divAuthor.text());
book.setUpdateDate(divSj.text());
book.setSource(LocalBookSource.qb5.toString());
books.add(book);
}
}
return books;
}
public boolean getTypePage(BookType curType, int page) {
if (curType.getPageSize() <= 0) {
curType.setPageSize(10);
}
if (page > curType.getPageSize()) {
return true;
}
if (!curType.getTypeName().equals("完本小说")) {
curType.setUrl(curType.getUrl().substring(0, curType.getUrl().lastIndexOf("_") + 1) + page + "/");
} else {
curType.setUrl(curType.getUrl().substring(0, curType.getUrl().lastIndexOf("/") + 1) + page);
}
return false;
}
}

@ -0,0 +1,123 @@
package xyz.fycz.myreader.webapi.crawler.find;
import android.text.Html;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;
import java.util.ArrayList;
import java.util.List;
import xyz.fycz.myreader.entity.SearchBookBean;
import xyz.fycz.myreader.entity.bookstore.BookType;
import xyz.fycz.myreader.enums.LocalBookSource;
import xyz.fycz.myreader.greendao.entity.Book;
import xyz.fycz.myreader.greendao.entity.Chapter;
import xyz.fycz.myreader.model.mulvalmap.ConcurrentMultiValueMap;
import xyz.fycz.myreader.webapi.crawler.base.FindCrawler;
import xyz.fycz.myreader.webapi.crawler.base.ReadCrawler;
public class XS7FindCrawler extends FindCrawler{
public static final String NAME_SPACE = "https://www.xs7.la";
public static final String CHARSET = "GBK";
public static final String SEARCH_CHARSET = "GBK";
public static final String FIND_NAME = "书城[小说旗]";
@Override
public String getCharset() {
return CHARSET;
}
@Override
public String getFindName() {
return FIND_NAME;
}
@Override
public String getFindUrl() {
return NAME_SPACE;
}
@Override
public boolean hasImg() {
return true;
}
@Override
public boolean needSearch() {
return false;
}
@Override
public List<BookType> getBookTypes(String html) {
List<BookType> bookTypes = new ArrayList<>();
Document doc = Jsoup.parse(html);
Element div = doc.getElementsByClass("subnav-hot").first();
Elements as = div.getElementsByTag("a");
for (Element a : as) {
BookType bookType = new BookType();
bookType.setUrl(a.attr("href"));
bookType.setTypeName(a.text());
bookTypes.add(bookType);
}
return bookTypes;
}
/*
<div id="alistbox">
<div class="pic"><a target="_blank" href="https://www.xs7.la/book/1_1201/" title="带着农场混异界最新章节列表"><img src="https://www.xs7.la/files/article/image/1/1201/1201s.jpg"
alt="带着农场混异界" title="带着农场混异界" width="115" height="160"></a></div>
<div class="info">
<div class="title">
<h2><a target="_blank" href="https://www.xs7.la/book/1_1201/">带着农场混异界</a></h2>
<span>作者明宇</span>
</div>
<div class="sys">最新更新<a href="https://www.xs7.la/book/1_1201/47219709.html" target="_blank" title="第四百四十七章 小山">第四百四十七章
小山</a></div>
<div class="intro"> 他横任他横我自种我田若要来惹我过不了明年
宅男赵海带着QQ农场穿越到了异界附身到了一个落迫的小贵族身上他的封地是一片种不出东西的黑土地而最主要的是...</div>
<div class="yuedu">
<a target="_blank" href="https://www.xs7.la/book/1_1201/">全文阅读</a>
<a href="https://www.xs7.la/modules/article/addbookcase.php?bid=1201">加入书架</a>
</div>
</div>
</div>
*/
@Override
public List<Book> getFindBooks(String html, BookType bookType) {
List<Book> books = new ArrayList<>();
Document doc = Jsoup.parse(html);
Element last = doc.getElementsByClass("last").first();
bookType.setPageSize(Integer.parseInt(last.text()));
Element div = doc.getElementById("alist");
Elements bDivs = div.select("div[id=alistbox]");
for (Element bDiv : bDivs) {
Book book = new Book();
Element title = bDiv.getElementsByClass("title").first();
Element sys = bDiv.getElementsByClass("sys").first();
Element intro = bDiv.getElementsByClass("intro").first();
book.setName(title.getElementsByTag("a").first().text());
book.setAuthor(title.getElementsByTag("span").first().text().replace("作者:", ""));
book.setNewestChapterTitle(sys.getElementsByTag("a").first().text());
book.setImgUrl(bDiv.getElementsByTag("img").attr("src"));
book.setDesc(intro.text());
book.setType(bookType.getTypeName());
book.setChapterUrl(title.getElementsByTag("a").first().attr("href"));
book.setSource(LocalBookSource.xs7.toString());
books.add(book);
}
return books;
}
@Override
public boolean getTypePage(BookType curType, int page) {
if (page != 1 && page > curType.getPageSize()) {
return true;
}
curType.setUrl(curType.getUrl().substring(0, curType.getUrl().lastIndexOf("_") + 1) + page + ".html");
return false;
}
}

@ -20,7 +20,7 @@ import xyz.fycz.myreader.webapi.crawler.read.XS7ReadCrawler;
*/ */
@Deprecated @Deprecated
public class XS7Rank extends FindCrawler { public class XS7Rank extends FindCrawler {
private FindCrawler xs7 = new XS7ReadCrawler(); private FindCrawler xs7 = new XS7FindCrawler();
public static final String CHARSET = "GBK"; public static final String CHARSET = "GBK";
public static final String FIND_NAME = "排行榜[小说旗]"; public static final String FIND_NAME = "排行榜[小说旗]";
public static final String FIND_URL = "https://www.xs7.la/top/lastupdate/1.html"; public static final String FIND_URL = "https://www.xs7.la/top/lastupdate/1.html";

@ -13,6 +13,7 @@ import xyz.fycz.myreader.enums.LocalBookSource;
import xyz.fycz.myreader.greendao.entity.Book; import xyz.fycz.myreader.greendao.entity.Book;
import xyz.fycz.myreader.greendao.entity.Chapter; import xyz.fycz.myreader.greendao.entity.Chapter;
import xyz.fycz.myreader.model.mulvalmap.ConcurrentMultiValueMap; import xyz.fycz.myreader.model.mulvalmap.ConcurrentMultiValueMap;
import xyz.fycz.myreader.webapi.crawler.base.BaseLocalCrawler;
import xyz.fycz.myreader.webapi.crawler.base.BookInfoCrawler; import xyz.fycz.myreader.webapi.crawler.base.BookInfoCrawler;
import xyz.fycz.myreader.webapi.crawler.base.FindCrawler; import xyz.fycz.myreader.webapi.crawler.base.FindCrawler;
import xyz.fycz.myreader.webapi.crawler.base.ReadCrawler; import xyz.fycz.myreader.webapi.crawler.base.ReadCrawler;
@ -22,14 +23,11 @@ import java.util.LinkedHashMap;
import java.util.List; import java.util.List;
@Deprecated @Deprecated
public class Ben100ReadCrawler extends FindCrawler implements ReadCrawler, BookInfoCrawler { public class Ben100ReadCrawler extends BaseLocalCrawler implements BookInfoCrawler {
public static final String NAME_SPACE = "https://www.100ben.net"; public static final String NAME_SPACE = "https://www.100ben.net";
public static final String NOVEL_SEARCH = "https://www.100ben.net/plus/search.php?keyword={key}"; public static final String NOVEL_SEARCH = "https://www.100ben.net/plus/search.php?keyword={key}";
public static final String CHARSET = "UTF-8"; public static final String CHARSET = "UTF-8";
public static final String SEARCH_CHARSET = "utf-8"; public static final String SEARCH_CHARSET = "utf-8";
public static final String FIND_NAME = "书城[100本书·实体]";
private LinkedHashMap<String, String> mBookTypes = new LinkedHashMap<>();
@Override @Override
public String getSearchLink() { public String getSearchLink() {
@ -41,26 +39,6 @@ public class Ben100ReadCrawler extends FindCrawler implements ReadCrawler, BookI
return CHARSET; return CHARSET;
} }
@Override
public String getFindName() {
return FIND_NAME;
}
@Override
public String getFindUrl() {
return NAME_SPACE;
}
@Override
public boolean hasImg() {
return true;
}
@Override
public boolean needSearch() {
return false;
}
@Override @Override
public String getNameSpace() { public String getNameSpace() {
return NAME_SPACE; return NAME_SPACE;
@ -175,111 +153,4 @@ public class Ben100ReadCrawler extends FindCrawler implements ReadCrawler, BookI
book.setType(type.getElementsByTag("a").get(2).text()); book.setType(type.getElementsByTag("a").get(2).text());
return book; return book;
} }
@Override
public List<BookType> getBookTypes(String html) {
List<BookType> bookTypes = new ArrayList<>();
Document doc = Jsoup.parse(html);
Element menu = doc.getElementsByClass("menu").first();
for (Element a : menu.children()) {
String name = a.text();
String url = a.attr("href");
if ("首页".equals(name)) {
name = "100本书";
} else if (name.contains("全部小说")) {
name = "全部小说";
}
BookType bookType = new BookType();
bookType.setTypeName(name);
bookType.setUrl(url);
bookTypes.add(bookType);
System.out.println("bookTypes.put(\"" + bookType.getTypeName() + "\", \"" + bookType.getUrl() + "\");");
}
return bookTypes;
}
@Override
public List<BookType> getBookTypes() {
initBookTypes();
List<BookType> bookTypes = new ArrayList<>();
for (String name : mBookTypes.keySet()) {
BookType bookType = new BookType();
bookType.setTypeName(name);
bookType.setUrl(mBookTypes.get(name));
bookTypes.add(bookType);
}
return bookTypes;
}
private void initBookTypes() {
mBookTypes.put("世界名著", "https://www.100ben.net/shijiemingzhu/");
mBookTypes.put("现代文学", "https://www.100ben.net/xiandaiwenxue/");
mBookTypes.put("外国小说", "https://www.100ben.net/waiguoxiaoshuo/");
mBookTypes.put("励志书籍", "https://www.100ben.net/lizhishuji/");
mBookTypes.put("古典文学", "https://www.100ben.net/gudianwenxue/");
mBookTypes.put("武侠小说", "https://www.100ben.net/wuxiaxiaoshuo/");
mBookTypes.put("言情小说", "https://www.100ben.net/yanqingxiaoshuo/");
mBookTypes.put("推理小说", "https://www.100ben.net/tuilixiaoshuo/");
mBookTypes.put("科幻小说", "https://www.100ben.net/kehuanxiaoshuo/");
mBookTypes.put("人物传记", "https://www.100ben.net/renwuzhuanji/");
mBookTypes.put("盗墓悬疑", "https://www.100ben.net/daomuxuanyi/");
mBookTypes.put("玄幻穿越", "https://www.100ben.net/xuanhuanchuanyue/");
mBookTypes.put("科普书籍", "https://www.100ben.net/kepushuji/");
mBookTypes.put("100本书", "https://www.100ben.net/");
mBookTypes.put("全部小说", "https://www.100ben.net/all/");
}
@Override
public List<Book> getFindBooks(String html, BookType bookType) {
List<Book> books = new ArrayList<>();
Document doc = Jsoup.parse(html);
try {
Element pageDiv = doc.getElementsByClass("page").first();
String page = pageDiv.getElementsByTag("a").last().text();
String pageStr = page.replace("末页(", "").replace(")", "");
bookType.setPageSize(Integer.parseInt(pageStr));
} catch (Exception ignored) {
}
Elements divs = doc.getElementsByClass("recommand");
Element div = divs.get(0);
Elements elementsByTag = div.getElementsByTag("li");
for (Element element : elementsByTag) {
Book book = new Book();
String name = element.getElementsByClass("titles").first().getElementsByTag("a").first().text();
book.setName(name);
String author = element.getElementsByClass("author").first().text().replace("作者:", "");
book.setAuthor(author);
String imgUrl = element.getElementsByTag("img").first().attr("src");
book.setImgUrl(imgUrl);
String chapterUrl = element.getElementsByClass("titles").first().getElementsByTag("a").first().attr("href");
book.setChapterUrl(chapterUrl);
String desc = element.getElementsByClass("intro").first().text();
book.setDesc(desc);
book.setNewestChapterTitle("");
book.setType(bookType.getTypeName());
book.setSource(LocalBookSource.ben100.toString());
books.add(book);
}
return books;
}
@Override
public boolean getTypePage(BookType curType, int page) {
if (curType.getPageSize() <= 0) {
curType.setPageSize(1);
}
if (page > curType.getPageSize()) {
return true;
}
if (curType.getTypeName().equals("100本书")) return false;
if (curType.getUrl().contains("list")) {
curType.setUrl(curType.getUrl().substring(0, curType.getUrl().lastIndexOf("_") + 1) + page + ".html");
} else {
curType.setUrl(curType.getUrl() + "list_" + page + ".html");
}
return false;
}
} }

@ -14,10 +14,11 @@ import xyz.fycz.myreader.enums.LocalBookSource;
import xyz.fycz.myreader.greendao.entity.Book; import xyz.fycz.myreader.greendao.entity.Book;
import xyz.fycz.myreader.greendao.entity.Chapter; import xyz.fycz.myreader.greendao.entity.Chapter;
import xyz.fycz.myreader.model.mulvalmap.ConcurrentMultiValueMap; import xyz.fycz.myreader.model.mulvalmap.ConcurrentMultiValueMap;
import xyz.fycz.myreader.webapi.crawler.base.BaseLocalCrawler;
import xyz.fycz.myreader.webapi.crawler.base.ReadCrawler; import xyz.fycz.myreader.webapi.crawler.base.ReadCrawler;
public class BiJianReadCrawler implements ReadCrawler { public class BiJianReadCrawler extends BaseLocalCrawler {
public static final String NAME_SPACE = "http://www.bjcan.com"; public static final String NAME_SPACE = "http://www.bjcan.com";
public static final String NOVEL_SEARCH = "http://www.bjcan.com/home/search/index.html?keyword={key}"; public static final String NOVEL_SEARCH = "http://www.bjcan.com/home/search/index.html?keyword={key}";
public static final String CHARSET = "UTF-8"; public static final String CHARSET = "UTF-8";

@ -13,13 +13,14 @@ import xyz.fycz.myreader.greendao.entity.Book;
import xyz.fycz.myreader.greendao.entity.Chapter; import xyz.fycz.myreader.greendao.entity.Chapter;
import xyz.fycz.myreader.model.mulvalmap.ConcurrentMultiValueMap; import xyz.fycz.myreader.model.mulvalmap.ConcurrentMultiValueMap;
import xyz.fycz.myreader.util.StringHelper; import xyz.fycz.myreader.util.StringHelper;
import xyz.fycz.myreader.webapi.crawler.base.BaseLocalCrawler;
import xyz.fycz.myreader.webapi.crawler.base.BookInfoCrawler; import xyz.fycz.myreader.webapi.crawler.base.BookInfoCrawler;
import xyz.fycz.myreader.webapi.crawler.base.ReadCrawler; import xyz.fycz.myreader.webapi.crawler.base.ReadCrawler;
import java.util.ArrayList; import java.util.ArrayList;
public class BiQuGe44ReadCrawler implements ReadCrawler, BookInfoCrawler { public class BiQuGe44ReadCrawler extends BaseLocalCrawler implements BookInfoCrawler {
// public static final String NAME_SPACE = "http://www.wqge.net"; // public static final String NAME_SPACE = "http://www.wqge.net";
public static final String NAME_SPACE = "https://www.wqge.cc"; public static final String NAME_SPACE = "https://www.wqge.cc";
public static final String NOVEL_SEARCH = "https://www.wqge.cc/modules/article/search.php?searchkey={key}"; public static final String NOVEL_SEARCH = "https://www.wqge.cc/modules/article/search.php?searchkey={key}";

@ -12,6 +12,7 @@ import xyz.fycz.myreader.greendao.entity.Book;
import xyz.fycz.myreader.greendao.entity.Chapter; import xyz.fycz.myreader.greendao.entity.Chapter;
import xyz.fycz.myreader.model.mulvalmap.ConcurrentMultiValueMap; import xyz.fycz.myreader.model.mulvalmap.ConcurrentMultiValueMap;
import xyz.fycz.myreader.util.StringHelper; import xyz.fycz.myreader.util.StringHelper;
import xyz.fycz.myreader.webapi.crawler.base.BaseLocalCrawler;
import xyz.fycz.myreader.webapi.crawler.base.BookInfoCrawler; import xyz.fycz.myreader.webapi.crawler.base.BookInfoCrawler;
import xyz.fycz.myreader.webapi.crawler.base.ReadCrawler; import xyz.fycz.myreader.webapi.crawler.base.ReadCrawler;
@ -21,7 +22,7 @@ import java.util.regex.Matcher;
import java.util.regex.Pattern; import java.util.regex.Pattern;
public class BiQuGeReadCrawler implements ReadCrawler, BookInfoCrawler { public class BiQuGeReadCrawler extends BaseLocalCrawler implements BookInfoCrawler {
private static final String NAME_SPACE = "https://www.52bqg.net"; private static final String NAME_SPACE = "https://www.52bqg.net";
private static final String NOVEL_SEARCH = "https://www.52bqg.net/modules/article/search.php?searchkey={key}"; private static final String NOVEL_SEARCH = "https://www.52bqg.net/modules/article/search.php?searchkey={key}";
private static final String CHARSET = "GBK"; private static final String CHARSET = "GBK";

@ -12,12 +12,13 @@ import xyz.fycz.myreader.enums.LocalBookSource;
import xyz.fycz.myreader.greendao.entity.Book; import xyz.fycz.myreader.greendao.entity.Book;
import xyz.fycz.myreader.greendao.entity.Chapter; import xyz.fycz.myreader.greendao.entity.Chapter;
import xyz.fycz.myreader.model.mulvalmap.ConcurrentMultiValueMap; import xyz.fycz.myreader.model.mulvalmap.ConcurrentMultiValueMap;
import xyz.fycz.myreader.webapi.crawler.base.BaseLocalCrawler;
import xyz.fycz.myreader.webapi.crawler.base.ReadCrawler; import xyz.fycz.myreader.webapi.crawler.base.ReadCrawler;
import java.util.ArrayList; import java.util.ArrayList;
public class CansShu99ReadCrawler implements ReadCrawler { public class CansShu99ReadCrawler extends BaseLocalCrawler {
public static final String NAME_SPACE = "http://www.99csw.com"; public static final String NAME_SPACE = "http://www.99csw.com";
public static final String NOVEL_SEARCH = "http://www.99csw.com/book/search.php?type=all&keyword={key}"; public static final String NOVEL_SEARCH = "http://www.99csw.com/book/search.php?type=all&keyword={key}";
public static final String CHARSET = "UTF-8"; public static final String CHARSET = "UTF-8";

@ -13,12 +13,13 @@ import xyz.fycz.myreader.enums.LocalBookSource;
import xyz.fycz.myreader.greendao.entity.Book; import xyz.fycz.myreader.greendao.entity.Book;
import xyz.fycz.myreader.greendao.entity.Chapter; import xyz.fycz.myreader.greendao.entity.Chapter;
import xyz.fycz.myreader.model.mulvalmap.ConcurrentMultiValueMap; import xyz.fycz.myreader.model.mulvalmap.ConcurrentMultiValueMap;
import xyz.fycz.myreader.webapi.crawler.base.BaseLocalCrawler;
import xyz.fycz.myreader.webapi.crawler.base.ReadCrawler; import xyz.fycz.myreader.webapi.crawler.base.ReadCrawler;
import java.util.ArrayList; import java.util.ArrayList;
public class ChaoXingReadCrawler implements ReadCrawler { public class ChaoXingReadCrawler extends BaseLocalCrawler {
public static final String NAME_SPACE = "http://yz4.chaoxing.com"; public static final String NAME_SPACE = "http://yz4.chaoxing.com";
public static final String NOVEL_SEARCH = "http://yz4.chaoxing.com/circlemarket/getsearch,start=0&size=25&sw={key}&channelId=52"; public static final String NOVEL_SEARCH = "http://yz4.chaoxing.com/circlemarket/getsearch,start=0&size=25&sw={key}&channelId=52";
public static final String CHAPTERS_URL = "https://special.zhexuezj.cn/mobile/mooc/tocourse/"; public static final String CHAPTERS_URL = "https://special.zhexuezj.cn/mobile/mooc/tocourse/";

@ -15,10 +15,11 @@ import xyz.fycz.myreader.enums.LocalBookSource;
import xyz.fycz.myreader.greendao.entity.Book; import xyz.fycz.myreader.greendao.entity.Book;
import xyz.fycz.myreader.greendao.entity.Chapter; import xyz.fycz.myreader.greendao.entity.Chapter;
import xyz.fycz.myreader.model.mulvalmap.ConcurrentMultiValueMap; import xyz.fycz.myreader.model.mulvalmap.ConcurrentMultiValueMap;
import xyz.fycz.myreader.webapi.crawler.base.BaseLocalCrawler;
import xyz.fycz.myreader.webapi.crawler.base.ReadCrawler; import xyz.fycz.myreader.webapi.crawler.base.ReadCrawler;
@Deprecated @Deprecated
public class ChuanQiReadCrawler implements ReadCrawler { public class ChuanQiReadCrawler extends BaseLocalCrawler {
public static final String NAME_SPACE = "https://www.xs86.com"; public static final String NAME_SPACE = "https://www.xs86.com";
public static final String NOVEL_SEARCH = "https://www.xs86.com/search.php?key={key}"; public static final String NOVEL_SEARCH = "https://www.xs86.com/search.php?key={key}";
public static final String CHARSET = "UTF-8"; public static final String CHARSET = "UTF-8";

@ -14,10 +14,11 @@ import xyz.fycz.myreader.enums.LocalBookSource;
import xyz.fycz.myreader.greendao.entity.Book; import xyz.fycz.myreader.greendao.entity.Book;
import xyz.fycz.myreader.greendao.entity.Chapter; import xyz.fycz.myreader.greendao.entity.Chapter;
import xyz.fycz.myreader.model.mulvalmap.ConcurrentMultiValueMap; import xyz.fycz.myreader.model.mulvalmap.ConcurrentMultiValueMap;
import xyz.fycz.myreader.webapi.crawler.base.BaseLocalCrawler;
import xyz.fycz.myreader.webapi.crawler.base.ReadCrawler; import xyz.fycz.myreader.webapi.crawler.base.ReadCrawler;
public class DSTQReadCrawler implements ReadCrawler { public class DSTQReadCrawler extends BaseLocalCrawler {
public static final String NAME_SPACE = "https://www.dstiejuan.com"; public static final String NAME_SPACE = "https://www.dstiejuan.com";
public static final String NOVEL_SEARCH = "https://www.dstiejuan.com/search.html,searchkey={key}"; public static final String NOVEL_SEARCH = "https://www.dstiejuan.com/search.html,searchkey={key}";
public static final String CHARSET = "UTF-8"; public static final String CHARSET = "UTF-8";

@ -13,13 +13,14 @@ import xyz.fycz.myreader.enums.LocalBookSource;
import xyz.fycz.myreader.greendao.entity.Book; import xyz.fycz.myreader.greendao.entity.Book;
import xyz.fycz.myreader.greendao.entity.Chapter; import xyz.fycz.myreader.greendao.entity.Chapter;
import xyz.fycz.myreader.model.mulvalmap.ConcurrentMultiValueMap; import xyz.fycz.myreader.model.mulvalmap.ConcurrentMultiValueMap;
import xyz.fycz.myreader.webapi.crawler.base.BaseLocalCrawler;
import xyz.fycz.myreader.webapi.crawler.base.BookInfoCrawler; import xyz.fycz.myreader.webapi.crawler.base.BookInfoCrawler;
import xyz.fycz.myreader.webapi.crawler.base.ReadCrawler; import xyz.fycz.myreader.webapi.crawler.base.ReadCrawler;
/** /**
* 此小说源书籍详情页可添加推荐书籍暂未开始做 * 此小说源书籍详情页可添加推荐书籍暂未开始做
*/ */
public class Du1DuReadCrawler implements ReadCrawler, BookInfoCrawler { public class Du1DuReadCrawler extends BaseLocalCrawler implements BookInfoCrawler {
public static final String NAME_SPACE = "http://du1du.org"; public static final String NAME_SPACE = "http://du1du.org";
public static final String NOVEL_SEARCH = "http://du1du.org/search.htm?keyword={key}"; public static final String NOVEL_SEARCH = "http://du1du.org/search.htm?keyword={key}";
public static final String CHARSET = "GBK"; public static final String CHARSET = "GBK";

@ -15,11 +15,12 @@ import xyz.fycz.myreader.greendao.entity.Book;
import xyz.fycz.myreader.greendao.entity.Chapter; import xyz.fycz.myreader.greendao.entity.Chapter;
import xyz.fycz.myreader.model.mulvalmap.ConcurrentMultiValueMap; import xyz.fycz.myreader.model.mulvalmap.ConcurrentMultiValueMap;
import xyz.fycz.myreader.util.StringHelper; import xyz.fycz.myreader.util.StringHelper;
import xyz.fycz.myreader.webapi.crawler.base.BaseLocalCrawler;
import xyz.fycz.myreader.webapi.crawler.base.BookInfoCrawler; import xyz.fycz.myreader.webapi.crawler.base.BookInfoCrawler;
import xyz.fycz.myreader.webapi.crawler.base.ReadCrawler; import xyz.fycz.myreader.webapi.crawler.base.ReadCrawler;
public class EWenXueReadCrawler implements ReadCrawler, BookInfoCrawler { public class EWenXueReadCrawler extends BaseLocalCrawler implements BookInfoCrawler {
public static final String NAME_SPACE = "http://ewenxue.org"; public static final String NAME_SPACE = "http://ewenxue.org";
public static final String NOVEL_SEARCH = "http://ewenxue.org/search.htm?keyword={key}"; public static final String NOVEL_SEARCH = "http://ewenxue.org/search.htm?keyword={key}";
public static final String CHARSET = "GBK"; public static final String CHARSET = "GBK";

@ -12,6 +12,7 @@ import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element; import org.jsoup.nodes.Element;
import org.jsoup.select.Elements; import org.jsoup.select.Elements;
import xyz.fycz.myreader.model.mulvalmap.ConcurrentMultiValueMap; import xyz.fycz.myreader.model.mulvalmap.ConcurrentMultiValueMap;
import xyz.fycz.myreader.webapi.crawler.base.BaseLocalCrawler;
import xyz.fycz.myreader.webapi.crawler.base.ReadCrawler; import xyz.fycz.myreader.webapi.crawler.base.ReadCrawler;
import java.util.ArrayList; import java.util.ArrayList;
@ -22,7 +23,7 @@ import java.util.regex.Pattern;
* 风月小说网html解析工具 * 风月小说网html解析工具
*/ */
public class FYReadCrawler implements ReadCrawler { public class FYReadCrawler extends BaseLocalCrawler {
public static final String NAME_SPACE = "https://novel.fycz.xyz"; public static final String NAME_SPACE = "https://novel.fycz.xyz";
public static final String NOVEL_SEARCH = "https://novel.fycz.xyz/search.html?keyword={key}"; public static final String NOVEL_SEARCH = "https://novel.fycz.xyz/search.html?keyword={key}";
public static final String CHARSET = "utf-8"; public static final String CHARSET = "utf-8";

@ -15,10 +15,11 @@ import xyz.fycz.myreader.enums.LocalBookSource;
import xyz.fycz.myreader.greendao.entity.Book; import xyz.fycz.myreader.greendao.entity.Book;
import xyz.fycz.myreader.greendao.entity.Chapter; import xyz.fycz.myreader.greendao.entity.Chapter;
import xyz.fycz.myreader.model.mulvalmap.ConcurrentMultiValueMap; import xyz.fycz.myreader.model.mulvalmap.ConcurrentMultiValueMap;
import xyz.fycz.myreader.webapi.crawler.base.BaseLocalCrawler;
import xyz.fycz.myreader.webapi.crawler.base.ReadCrawler; import xyz.fycz.myreader.webapi.crawler.base.ReadCrawler;
public class HongChenReadCrawler implements ReadCrawler { public class HongChenReadCrawler extends BaseLocalCrawler {
public static final String NAME_SPACE = "https://www.zuxs.net"; public static final String NAME_SPACE = "https://www.zuxs.net";
public static final String NOVEL_SEARCH = "https://www.zuxs.net/search.php?key={key}"; public static final String NOVEL_SEARCH = "https://www.zuxs.net/search.php?key={key}";
public static final String CHARSET = "gb2312"; public static final String CHARSET = "gb2312";

@ -12,12 +12,13 @@ import xyz.fycz.myreader.enums.LocalBookSource;
import xyz.fycz.myreader.greendao.entity.Book; import xyz.fycz.myreader.greendao.entity.Book;
import xyz.fycz.myreader.greendao.entity.Chapter; import xyz.fycz.myreader.greendao.entity.Chapter;
import xyz.fycz.myreader.model.mulvalmap.ConcurrentMultiValueMap; import xyz.fycz.myreader.model.mulvalmap.ConcurrentMultiValueMap;
import xyz.fycz.myreader.webapi.crawler.base.BaseLocalCrawler;
import xyz.fycz.myreader.webapi.crawler.base.ReadCrawler; import xyz.fycz.myreader.webapi.crawler.base.ReadCrawler;
import java.util.ArrayList; import java.util.ArrayList;
public class JiuTaoReadCrawler implements ReadCrawler { public class JiuTaoReadCrawler extends BaseLocalCrawler {
public static final String NAME_SPACE = "https://www.9txs.org"; public static final String NAME_SPACE = "https://www.9txs.org";
public static final String NOVEL_SEARCH = "https://so.9txs.org/www/,searchkey={key}"; public static final String NOVEL_SEARCH = "https://so.9txs.org/www/,searchkey={key}";
public static final String CHARSET = "UTF-8"; public static final String CHARSET = "UTF-8";

@ -15,10 +15,11 @@ import xyz.fycz.myreader.enums.LocalBookSource;
import xyz.fycz.myreader.greendao.entity.Book; import xyz.fycz.myreader.greendao.entity.Book;
import xyz.fycz.myreader.greendao.entity.Chapter; import xyz.fycz.myreader.greendao.entity.Chapter;
import xyz.fycz.myreader.model.mulvalmap.ConcurrentMultiValueMap; import xyz.fycz.myreader.model.mulvalmap.ConcurrentMultiValueMap;
import xyz.fycz.myreader.webapi.crawler.base.BaseLocalCrawler;
import xyz.fycz.myreader.webapi.crawler.base.ReadCrawler; import xyz.fycz.myreader.webapi.crawler.base.ReadCrawler;
@Deprecated @Deprecated
public class LaoYaoReadCrawler implements ReadCrawler { public class LaoYaoReadCrawler extends BaseLocalCrawler {
public static final String NAME_SPACE = "https://www.laoyao.org"; public static final String NAME_SPACE = "https://www.laoyao.org";
public static final String NOVEL_SEARCH = "https://www.laoyao.org/search.php?key={key}"; public static final String NOVEL_SEARCH = "https://www.laoyao.org/search.php?key={key}";
public static final String CHARSET = "UTF-8"; public static final String CHARSET = "UTF-8";

@ -16,13 +16,14 @@ import xyz.fycz.myreader.entity.SearchBookBean;
import xyz.fycz.myreader.greendao.entity.Book; import xyz.fycz.myreader.greendao.entity.Book;
import xyz.fycz.myreader.greendao.entity.Chapter; import xyz.fycz.myreader.greendao.entity.Chapter;
import xyz.fycz.myreader.model.mulvalmap.ConcurrentMultiValueMap; import xyz.fycz.myreader.model.mulvalmap.ConcurrentMultiValueMap;
import xyz.fycz.myreader.webapi.crawler.base.BaseLocalCrawler;
import xyz.fycz.myreader.webapi.crawler.base.ReadCrawler; import xyz.fycz.myreader.webapi.crawler.base.ReadCrawler;
/** /**
* @author fengyue * @author fengyue
* @date 2020/11/27 14:09 * @date 2020/11/27 14:09
*/ */
public class LiuLangCatReadCrawler implements ReadCrawler { public class LiuLangCatReadCrawler extends BaseLocalCrawler {
public static final String NAME_SPACE = "http://m.liulangcat.com"; public static final String NAME_SPACE = "http://m.liulangcat.com";
public static final String NOVEL_SEARCH = "http://m.liulangcat.com/get/get_search_result.php?page=0&keyword={key}"; public static final String NOVEL_SEARCH = "http://m.liulangcat.com/get/get_search_result.php?page=0&keyword={key}";
// public static final String NOVEL_SEARCH = "http://www.liulangcat.com/search.php?k={key}&submit=搜索&wgxojg=wc0yz&uwzgzw=yi1p7&amlmvy=mcp50&rybwbm=1s0y7"; // public static final String NOVEL_SEARCH = "http://www.liulangcat.com/search.php?k={key}&submit=搜索&wgxojg=wc0yz&uwzgzw=yi1p7&amlmvy=mcp50&rybwbm=1s0y7";

@ -15,11 +15,12 @@ import xyz.fycz.myreader.greendao.entity.Book;
import xyz.fycz.myreader.greendao.entity.Chapter; import xyz.fycz.myreader.greendao.entity.Chapter;
import xyz.fycz.myreader.model.mulvalmap.ConcurrentMultiValueMap; import xyz.fycz.myreader.model.mulvalmap.ConcurrentMultiValueMap;
import xyz.fycz.myreader.util.StringHelper; import xyz.fycz.myreader.util.StringHelper;
import xyz.fycz.myreader.webapi.crawler.base.BaseLocalCrawler;
import xyz.fycz.myreader.webapi.crawler.base.BookInfoCrawler; import xyz.fycz.myreader.webapi.crawler.base.BookInfoCrawler;
import xyz.fycz.myreader.webapi.crawler.base.ReadCrawler; import xyz.fycz.myreader.webapi.crawler.base.ReadCrawler;
public class LuoQiuReadCrawler implements ReadCrawler, BookInfoCrawler { public class LuoQiuReadCrawler extends BaseLocalCrawler implements BookInfoCrawler {
public static final String NAME_SPACE = "https://www.lqbook.com"; public static final String NAME_SPACE = "https://www.lqbook.com";
public static final String NOVEL_SEARCH = "https://www.lqbook.com/modules/article/search.php?searchkey={key}&submit=%CB%D1%CB%F7"; public static final String NOVEL_SEARCH = "https://www.lqbook.com/modules/article/search.php?searchkey={key}&submit=%CB%D1%CB%F7";
public static final String CHARSET = "GBK"; public static final String CHARSET = "GBK";

@ -12,13 +12,14 @@ import xyz.fycz.myreader.enums.LocalBookSource;
import xyz.fycz.myreader.greendao.entity.Book; import xyz.fycz.myreader.greendao.entity.Book;
import xyz.fycz.myreader.greendao.entity.Chapter; import xyz.fycz.myreader.greendao.entity.Chapter;
import xyz.fycz.myreader.model.mulvalmap.ConcurrentMultiValueMap; import xyz.fycz.myreader.model.mulvalmap.ConcurrentMultiValueMap;
import xyz.fycz.myreader.webapi.crawler.base.BaseLocalCrawler;
import xyz.fycz.myreader.webapi.crawler.base.BookInfoCrawler; import xyz.fycz.myreader.webapi.crawler.base.BookInfoCrawler;
import xyz.fycz.myreader.webapi.crawler.base.ReadCrawler; import xyz.fycz.myreader.webapi.crawler.base.ReadCrawler;
import java.util.ArrayList; import java.util.ArrayList;
@Deprecated @Deprecated
public class MiQuReadCrawler implements ReadCrawler, BookInfoCrawler { public class MiQuReadCrawler extends BaseLocalCrawler implements BookInfoCrawler {
public static final String NAME_SPACE = "https://www.meegoq.com"; public static final String NAME_SPACE = "https://www.meegoq.com";
public static final String NOVEL_SEARCH = "https://www.meegoq.com/search.htm?keyword={key}"; public static final String NOVEL_SEARCH = "https://www.meegoq.com/search.htm?keyword={key}";
public static final String CHARSET = "UTF-8"; public static final String CHARSET = "UTF-8";

@ -17,17 +17,16 @@ import xyz.fycz.myreader.enums.LocalBookSource;
import xyz.fycz.myreader.greendao.entity.Book; import xyz.fycz.myreader.greendao.entity.Book;
import xyz.fycz.myreader.greendao.entity.Chapter; import xyz.fycz.myreader.greendao.entity.Chapter;
import xyz.fycz.myreader.model.mulvalmap.ConcurrentMultiValueMap; import xyz.fycz.myreader.model.mulvalmap.ConcurrentMultiValueMap;
import xyz.fycz.myreader.webapi.crawler.base.BaseLocalCrawler;
import xyz.fycz.myreader.webapi.crawler.base.FindCrawler; import xyz.fycz.myreader.webapi.crawler.base.FindCrawler;
import xyz.fycz.myreader.webapi.crawler.base.ReadCrawler; import xyz.fycz.myreader.webapi.crawler.base.ReadCrawler;
public class MiaoBiReadCrawler extends FindCrawler implements ReadCrawler { public class MiaoBiReadCrawler extends BaseLocalCrawler {
public static final String NAME_SPACE = "https://www.imiaobige.com"; public static final String NAME_SPACE = "https://www.imiaobige.com";
public static final String NOVEL_SEARCH = "https://www.imiaobige.com/search.html,searchkey={key}"; public static final String NOVEL_SEARCH = "https://www.imiaobige.com/search.html,searchkey={key}";
public static final String CHARSET = "UTF-8"; public static final String CHARSET = "UTF-8";
public static final String SEARCH_CHARSET = "UTF-8"; public static final String SEARCH_CHARSET = "UTF-8";
public static final String FIND_NAME = "书城[妙笔阁]";
private final LinkedHashMap<String, String> mBookTypes = new LinkedHashMap<>();
@Override @Override
public String getSearchLink() { public String getSearchLink() {
@ -39,26 +38,6 @@ public class MiaoBiReadCrawler extends FindCrawler implements ReadCrawler {
return CHARSET; return CHARSET;
} }
@Override
public String getFindName() {
return FIND_NAME;
}
@Override
public String getFindUrl() {
return NAME_SPACE;
}
@Override
public boolean hasImg() {
return true;
}
@Override
public boolean needSearch() {
return false;
}
@Override @Override
public String getNameSpace() { public String getNameSpace() {
return NAME_SPACE; return NAME_SPACE;
@ -147,67 +126,4 @@ public class MiaoBiReadCrawler extends FindCrawler implements ReadCrawler {
return books; return books;
} }
@Override
public List<BookType> getBookTypes() {
initBookTypes();
List<BookType> bookTypes = new ArrayList<>();
for (String name : mBookTypes.keySet()) {
BookType bookType = new BookType();
bookType.setTypeName(name);
bookType.setUrl(mBookTypes.get(name));
bookType.setPageSize(100);
bookTypes.add(bookType);
}
return bookTypes;
}
private void initBookTypes() {
mBookTypes.put("玄幻奇幻", "https://www.imiaobige.com/xuanhuan/1.html");
mBookTypes.put("武侠仙侠", "https://www.imiaobige.com/wuxia/1.html");
mBookTypes.put("都市生活", "https://www.imiaobige.com/dushi/1.html");
mBookTypes.put("历史军事", "https://www.imiaobige.com/lishi/1.html");
mBookTypes.put("游戏竞技", "https://www.imiaobige.com/youxi/1.html");
mBookTypes.put("科幻未来", "https://www.imiaobige.com/kehuan/1.html");
}
/*
<dl>
<dt><a href="/novel/225809.html"><img src="https://img.imiaobige.com/225809/1177644.jpg" alt="重生之我变成了火星" height="155" width="120"></a></dt>
<dd><span class="uptime">20-11-26 16:57</span><a href="/novel/225809.html"><h3>重生之我变成了火星</h3></a></dd>
<dd class="book_other">作者<a href="/author/仰望黑夜/">仰望黑夜</a>状态<span>连载中</span></dd>
<dd class="book_des">重生成了火星第一阶段科技进化第二阶段高魔进化第三阶段超魔进化宇宙之间除了人类还有无数可怕存在让我带领人类征服宇宙我们的目标是星辰大海~</dd>
<dd class="book_other">最新章节<a href="/read/225809/863539.html">第三百一十六章 时空道兵</a></dd>
</dl>
*/
@Override
public List<Book> getFindBooks(String html, BookType bookType) {
List<Book> books = new ArrayList<>();
Document doc = Jsoup.parse(html);
Element div = doc.getElementById("sitebox");
Elements dls = div.getElementsByTag("dl");
for (Element dl : dls) {
Book book = new Book();
Elements as = dl.getElementsByTag("a");
book.setName(as.get(1).text());
book.setAuthor(as.get(2).text());
book.setType(bookType.getTypeName());
book.setNewestChapterTitle(as.get(3).text());
book.setDesc(dl.getElementsByClass("book_des").first().text());
book.setImgUrl(as.first().getElementsByTag("img").attr("src"));
book.setChapterUrl(as.get(1).attr("href").replace("novel", "read").replace(".html", "/"));
book.setUpdateDate(dl.getElementsByClass("uptime").first().text());
book.setSource(LocalBookSource.miaobi.toString());
books.add(book);
}
return books;
}
@Override
public boolean getTypePage(BookType curType, int page) {
if (page > curType.getPageSize()) {
return true;
}
curType.setUrl(curType.getUrl().substring(0, curType.getUrl().lastIndexOf("/") + 1) + page + ".html");
return false;
}
} }

@ -14,10 +14,11 @@ import xyz.fycz.myreader.enums.LocalBookSource;
import xyz.fycz.myreader.greendao.entity.Book; import xyz.fycz.myreader.greendao.entity.Book;
import xyz.fycz.myreader.greendao.entity.Chapter; import xyz.fycz.myreader.greendao.entity.Chapter;
import xyz.fycz.myreader.model.mulvalmap.ConcurrentMultiValueMap; import xyz.fycz.myreader.model.mulvalmap.ConcurrentMultiValueMap;
import xyz.fycz.myreader.webapi.crawler.base.BaseLocalCrawler;
import xyz.fycz.myreader.webapi.crawler.base.BookInfoCrawler; import xyz.fycz.myreader.webapi.crawler.base.BookInfoCrawler;
import xyz.fycz.myreader.webapi.crawler.base.ReadCrawler; import xyz.fycz.myreader.webapi.crawler.base.ReadCrawler;
public class PiaoTianReadCrawler implements ReadCrawler, BookInfoCrawler { public class PiaoTianReadCrawler extends BaseLocalCrawler implements BookInfoCrawler {
public static final String NAME_SPACE = "https://www.piaotian.org"; public static final String NAME_SPACE = "https://www.piaotian.org";
public static final String NOVEL_SEARCH = "https://www.piaotian.org/modules/article/search.php?searchkey={key}&submit=%CB%D1%CB%F7"; public static final String NOVEL_SEARCH = "https://www.piaotian.org/modules/article/search.php?searchkey={key}&submit=%CB%D1%CB%F7";
public static final String CHARSET = "GBK"; public static final String CHARSET = "GBK";

@ -12,6 +12,7 @@ import xyz.fycz.myreader.greendao.entity.Book;
import xyz.fycz.myreader.greendao.entity.Chapter; import xyz.fycz.myreader.greendao.entity.Chapter;
import xyz.fycz.myreader.model.mulvalmap.ConcurrentMultiValueMap; import xyz.fycz.myreader.model.mulvalmap.ConcurrentMultiValueMap;
import xyz.fycz.myreader.util.StringHelper; import xyz.fycz.myreader.util.StringHelper;
import xyz.fycz.myreader.webapi.crawler.base.BaseLocalCrawler;
import xyz.fycz.myreader.webapi.crawler.base.BookInfoCrawler; import xyz.fycz.myreader.webapi.crawler.base.BookInfoCrawler;
import xyz.fycz.myreader.webapi.crawler.base.ReadCrawler; import xyz.fycz.myreader.webapi.crawler.base.ReadCrawler;
@ -23,7 +24,7 @@ import java.util.ArrayList;
* 已失效 * 已失效
*/ */
@Deprecated @Deprecated
public class PinShuReadCrawler implements ReadCrawler, BookInfoCrawler { public class PinShuReadCrawler extends BaseLocalCrawler implements BookInfoCrawler {
public static final String NAME_SPACE = "https://www.vodtw.com"; public static final String NAME_SPACE = "https://www.vodtw.com";
public static final String NOVEL_SEARCH = "https://www.vodtw.com/Book/Search.aspx?SearchKey={key}&SearchClass=1"; public static final String NOVEL_SEARCH = "https://www.vodtw.com/Book/Search.aspx?SearchKey={key}&SearchClass=1";
public static final String CHARSET = "gbk"; public static final String CHARSET = "gbk";

@ -12,6 +12,7 @@ import xyz.fycz.myreader.greendao.entity.Book;
import xyz.fycz.myreader.greendao.entity.Chapter; import xyz.fycz.myreader.greendao.entity.Chapter;
import xyz.fycz.myreader.model.mulvalmap.ConcurrentMultiValueMap; import xyz.fycz.myreader.model.mulvalmap.ConcurrentMultiValueMap;
import xyz.fycz.myreader.util.StringHelper; import xyz.fycz.myreader.util.StringHelper;
import xyz.fycz.myreader.webapi.crawler.base.BaseLocalCrawler;
import xyz.fycz.myreader.webapi.crawler.base.BookInfoCrawler; import xyz.fycz.myreader.webapi.crawler.base.BookInfoCrawler;
import xyz.fycz.myreader.webapi.crawler.base.ReadCrawler; import xyz.fycz.myreader.webapi.crawler.base.ReadCrawler;
@ -21,7 +22,7 @@ import java.util.ArrayList;
* @author fengyue * @author fengyue
* @date 2020/5/19 19:50 * @date 2020/5/19 19:50
*/ */
public class PinShuReadCrawler2 implements ReadCrawler, BookInfoCrawler { public class PinShuReadCrawler2 extends BaseLocalCrawler implements BookInfoCrawler {
public static final String NAME_SPACE = "https://www.vodtw.la"; public static final String NAME_SPACE = "https://www.vodtw.la";
public static final String NOVEL_SEARCH = "https://www.vodtw.la/search.html"; public static final String NOVEL_SEARCH = "https://www.vodtw.la/search.html";
public static final String SEARCH_KEY = "q"; public static final String SEARCH_KEY = "q";

@ -14,6 +14,7 @@ import xyz.fycz.myreader.greendao.entity.Book;
import xyz.fycz.myreader.greendao.entity.Chapter; import xyz.fycz.myreader.greendao.entity.Chapter;
import xyz.fycz.myreader.model.mulvalmap.ConcurrentMultiValueMap; import xyz.fycz.myreader.model.mulvalmap.ConcurrentMultiValueMap;
import xyz.fycz.myreader.util.StringHelper; import xyz.fycz.myreader.util.StringHelper;
import xyz.fycz.myreader.webapi.crawler.base.BaseLocalCrawler;
import xyz.fycz.myreader.webapi.crawler.base.BookInfoCrawler; import xyz.fycz.myreader.webapi.crawler.base.BookInfoCrawler;
import xyz.fycz.myreader.webapi.crawler.base.FindCrawler; import xyz.fycz.myreader.webapi.crawler.base.FindCrawler;
import xyz.fycz.myreader.webapi.crawler.base.ReadCrawler; import xyz.fycz.myreader.webapi.crawler.base.ReadCrawler;
@ -22,11 +23,9 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
public class QB5ReadCrawler extends FindCrawler implements ReadCrawler, BookInfoCrawler { public class QB5ReadCrawler extends BaseLocalCrawler implements BookInfoCrawler {
private static final String NAME_SPACE = "https://www.qb50.com"; private static final String NAME_SPACE = "https://www.qb50.com";
private static final String NOVEL_SEARCH = "https://www.qb50.com/modules/article/search.php?searchkey={key}&submit=%CB%D1%CB%F7"; private static final String NOVEL_SEARCH = "https://www.qb50.com/modules/article/search.php?searchkey={key}&submit=%CB%D1%CB%F7";
public static final String FIND_URL = "https://www.qb50.com";
public static final String FIND_NAME = "书城[全本小说]";
private static final String CHARSET = "GBK"; private static final String CHARSET = "GBK";
public static final String SEARCH_CHARSET = "GBK"; public static final String SEARCH_CHARSET = "GBK";
@ -50,126 +49,11 @@ public class QB5ReadCrawler extends FindCrawler implements ReadCrawler, BookInfo
return CHARSET; return CHARSET;
} }
@Override
public String getFindName() {
return FIND_NAME;
}
@Override
public String getFindUrl() {
return FIND_URL;
}
@Override @Override
public String getSearchCharset() { public String getSearchCharset() {
return SEARCH_CHARSET; return SEARCH_CHARSET;
} }
@Override
public boolean hasImg() {
return false;
}
@Override
public boolean needSearch() {
return false;
}
/**
* 获取书城小说分类列表
*
* @param html
* @return
*/
public List<BookType> getBookTypes(String html) {
List<BookType> bookTypes = new ArrayList<>();
Document doc = Jsoup.parse(html);
Elements divs = doc.getElementsByClass("nav_cont");
if (divs.size() > 0) {
Elements uls = divs.get(0).getElementsByTag("ul");
if (uls.size() > 0) {
for (Element li : uls.get(0).children()) {
Element a = li.child(0);
BookType bookType = new BookType();
bookType.setTypeName(a.attr("title"));
bookType.setUrl(a.attr("href"));
if (bookType.getTypeName().contains("首页") || bookType.getTypeName().contains("热门小说"))
continue;
if (!StringHelper.isEmpty(bookType.getTypeName())) {
bookTypes.add(bookType);
}
}
}
}
return bookTypes;
}
/**
* 获取某一分类小说排行榜列表
*
* @param html
* @return
*/
public List<Book> getBookRankList(String html) {
List<Book> books = new ArrayList<>();
Document doc = Jsoup.parse(html);
Elements divs = doc.getElementsByClass("r");
if (divs.size() > 0) {
Elements uls = divs.get(0).getElementsByTag("ul");
if (uls.size() > 0) {
for (Element li : uls.get(0).children()) {
Book book = new Book();
Element scanS1 = li.getElementsByClass("s1").get(0);
Element scanS2 = li.getElementsByClass("s2").get(0);
Element scanS5 = li.getElementsByClass("s5").get(0);
book.setType(scanS1.html().replace("[", "").replace("]", ""));
Element a = scanS2.getElementsByTag("a").get(0);
book.setName(a.attr("title"));
book.setChapterUrl(a.attr("href"));
book.setAuthor(scanS5.html());
book.setSource(LocalBookSource.biquge.toString());
books.add(book);
}
}
}
return books;
}
public List<Book> getFindBooks(String html, BookType bookType) {
List<Book> books = new ArrayList<>();
Document doc = Jsoup.parse(html);
try {
int pageSize = Integer.parseInt(doc.getElementsByClass("last").first().text());
bookType.setPageSize(pageSize);
} catch (Exception ignored) {
}
String type = doc.select("meta[name=keywords]").attr("content").replace(",全本小说网", "");
Element div = doc.getElementById("tlist");
Elements uls = div.getElementsByTag("ul");
if (uls.size() > 0) {
for (Element li : uls.get(0).children()) {
Book book = new Book();
Element aName = li.getElementsByClass("name").get(0);
Element divZz = li.getElementsByClass("zz").get(0);
Element divAuthor = li.getElementsByClass("author").get(0);
Element divSj = li.getElementsByClass("sj").get(0);
book.setType(type);
book.setName(aName.attr("title"));
book.setChapterUrl(aName.attr("href"));
book.setNewestChapterTitle(divZz.text());
book.setAuthor(divAuthor.text());
book.setUpdateDate(divSj.text());
book.setSource(LocalBookSource.qb5.toString());
books.add(book);
}
}
return books;
}
@Override @Override
public String getContentFormHtml(String html) { public String getContentFormHtml(String html) {
Document doc = Jsoup.parse(html); Document doc = Jsoup.parse(html);
@ -277,20 +161,4 @@ public class QB5ReadCrawler extends FindCrawler implements ReadCrawler, BookInfo
return book; return book;
} }
public boolean getTypePage(BookType curType, int page) {
if (curType.getPageSize() <= 0) {
curType.setPageSize(10);
}
if (page > curType.getPageSize()) {
return true;
}
if (!curType.getTypeName().equals("完本小说")) {
curType.setUrl(curType.getUrl().substring(0, curType.getUrl().lastIndexOf("_") + 1) + page + "/");
} else {
curType.setUrl(curType.getUrl().substring(0, curType.getUrl().lastIndexOf("/") + 1) + page);
}
return false;
}
} }

@ -10,6 +10,7 @@ import xyz.fycz.myreader.entity.SearchBookBean;
import xyz.fycz.myreader.greendao.entity.Book; import xyz.fycz.myreader.greendao.entity.Book;
import xyz.fycz.myreader.greendao.entity.Chapter; import xyz.fycz.myreader.greendao.entity.Chapter;
import xyz.fycz.myreader.model.mulvalmap.ConcurrentMultiValueMap; import xyz.fycz.myreader.model.mulvalmap.ConcurrentMultiValueMap;
import xyz.fycz.myreader.webapi.crawler.base.BaseLocalCrawler;
import xyz.fycz.myreader.webapi.crawler.base.ReadCrawler; import xyz.fycz.myreader.webapi.crawler.base.ReadCrawler;
import java.util.ArrayList; import java.util.ArrayList;
@ -18,7 +19,7 @@ import java.util.ArrayList;
* 已失效 * 已失效
*/ */
@Deprecated @Deprecated
public class QiQiReadCrawler implements ReadCrawler { public class QiQiReadCrawler extends BaseLocalCrawler {
public static final String NAME_SPACE = "https://www.qq717.com"; public static final String NAME_SPACE = "https://www.qq717.com";
public static final String NOVEL_SEARCH = "https://www.qq717.com/search.php?keyword={key}"; public static final String NOVEL_SEARCH = "https://www.qq717.com/search.php?keyword={key}";
public static final String CHARSET = "UTF-8"; public static final String CHARSET = "UTF-8";

@ -14,10 +14,11 @@ import xyz.fycz.myreader.enums.LocalBookSource;
import xyz.fycz.myreader.greendao.entity.Book; import xyz.fycz.myreader.greendao.entity.Book;
import xyz.fycz.myreader.greendao.entity.Chapter; import xyz.fycz.myreader.greendao.entity.Chapter;
import xyz.fycz.myreader.model.mulvalmap.ConcurrentMultiValueMap; import xyz.fycz.myreader.model.mulvalmap.ConcurrentMultiValueMap;
import xyz.fycz.myreader.webapi.crawler.base.BaseLocalCrawler;
import xyz.fycz.myreader.webapi.crawler.base.ReadCrawler; import xyz.fycz.myreader.webapi.crawler.base.ReadCrawler;
public class QianDianReadCrawler implements ReadCrawler { public class QianDianReadCrawler extends BaseLocalCrawler {
public static final String NAME_SPACE = "https://www.qidian.com"; public static final String NAME_SPACE = "https://www.qidian.com";
public static final String NOVEL_SEARCH = "https://www.qidian.com/search?kw={key}"; public static final String NOVEL_SEARCH = "https://www.qidian.com/search?kw={key}";
public static final String CHARSET = "UTF-8"; public static final String CHARSET = "UTF-8";

@ -11,13 +11,14 @@ import xyz.fycz.myreader.enums.LocalBookSource;
import xyz.fycz.myreader.greendao.entity.Book; import xyz.fycz.myreader.greendao.entity.Book;
import xyz.fycz.myreader.greendao.entity.Chapter; import xyz.fycz.myreader.greendao.entity.Chapter;
import xyz.fycz.myreader.model.mulvalmap.ConcurrentMultiValueMap; import xyz.fycz.myreader.model.mulvalmap.ConcurrentMultiValueMap;
import xyz.fycz.myreader.webapi.crawler.base.BaseLocalCrawler;
import xyz.fycz.myreader.webapi.crawler.base.BookInfoCrawler; import xyz.fycz.myreader.webapi.crawler.base.BookInfoCrawler;
import xyz.fycz.myreader.webapi.crawler.base.ReadCrawler; import xyz.fycz.myreader.webapi.crawler.base.ReadCrawler;
import java.util.ArrayList; import java.util.ArrayList;
public class QuanNovelReadCrawler implements ReadCrawler, BookInfoCrawler { public class QuanNovelReadCrawler extends BaseLocalCrawler implements BookInfoCrawler {
public static final String NAME_SPACE = "https://qxs.la"; public static final String NAME_SPACE = "https://qxs.la";
public static final String NOVEL_SEARCH = "https://qxs.la/s_{key}"; public static final String NOVEL_SEARCH = "https://qxs.la/s_{key}";
public static final String CHARSET = "GBK"; public static final String CHARSET = "GBK";

@ -14,13 +14,14 @@ import xyz.fycz.myreader.entity.SearchBookBean;
import xyz.fycz.myreader.greendao.entity.Book; import xyz.fycz.myreader.greendao.entity.Book;
import xyz.fycz.myreader.greendao.entity.Chapter; import xyz.fycz.myreader.greendao.entity.Chapter;
import xyz.fycz.myreader.model.mulvalmap.ConcurrentMultiValueMap; import xyz.fycz.myreader.model.mulvalmap.ConcurrentMultiValueMap;
import xyz.fycz.myreader.webapi.crawler.base.BaseLocalCrawler;
import xyz.fycz.myreader.webapi.crawler.base.ReadCrawler; import xyz.fycz.myreader.webapi.crawler.base.ReadCrawler;
/** /**
* 已失效 * 已失效
*/ */
@Deprecated @Deprecated
public class ReXueReadCrawler implements ReadCrawler { public class ReXueReadCrawler extends BaseLocalCrawler {
public static final String NAME_SPACE = "https://www.rexue.org"; public static final String NAME_SPACE = "https://www.rexue.org";
public static final String NOVEL_SEARCH = "https://www.rexue.org/search.php?key={key}"; public static final String NOVEL_SEARCH = "https://www.rexue.org/search.php?key={key}";
public static final String CHARSET = "UTF-8"; public static final String CHARSET = "UTF-8";

@ -15,10 +15,11 @@ import xyz.fycz.myreader.enums.LocalBookSource;
import xyz.fycz.myreader.greendao.entity.Book; import xyz.fycz.myreader.greendao.entity.Book;
import xyz.fycz.myreader.greendao.entity.Chapter; import xyz.fycz.myreader.greendao.entity.Chapter;
import xyz.fycz.myreader.model.mulvalmap.ConcurrentMultiValueMap; import xyz.fycz.myreader.model.mulvalmap.ConcurrentMultiValueMap;
import xyz.fycz.myreader.webapi.crawler.base.BaseLocalCrawler;
import xyz.fycz.myreader.webapi.crawler.base.ReadCrawler; import xyz.fycz.myreader.webapi.crawler.base.ReadCrawler;
public class ShiGuangReadCrawler implements ReadCrawler { public class ShiGuangReadCrawler extends BaseLocalCrawler {
public static final String NAME_SPACE = "https://www.youxs.org"; public static final String NAME_SPACE = "https://www.youxs.org";
public static final String NOVEL_SEARCH = "https://www.youxs.org/search.php?key={key}"; public static final String NOVEL_SEARCH = "https://www.youxs.org/search.php?key={key}";
public static final String CHARSET = "gbk"; public static final String CHARSET = "gbk";

@ -8,7 +8,9 @@ import org.jsoup.select.Elements;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
import xyz.fycz.myreader.entity.SearchBookBean; import xyz.fycz.myreader.entity.SearchBookBean;
import xyz.fycz.myreader.enums.LocalBookSource; import xyz.fycz.myreader.enums.LocalBookSource;
@ -17,11 +19,12 @@ import xyz.fycz.myreader.greendao.entity.Chapter;
import xyz.fycz.myreader.model.mulvalmap.ConcurrentMultiValueMap; import xyz.fycz.myreader.model.mulvalmap.ConcurrentMultiValueMap;
import xyz.fycz.myreader.util.StringHelper; import xyz.fycz.myreader.util.StringHelper;
import xyz.fycz.myreader.util.utils.OkHttpUtils; import xyz.fycz.myreader.util.utils.OkHttpUtils;
import xyz.fycz.myreader.webapi.crawler.base.BaseLocalCrawler;
import xyz.fycz.myreader.webapi.crawler.base.BookInfoCrawler; import xyz.fycz.myreader.webapi.crawler.base.BookInfoCrawler;
import xyz.fycz.myreader.webapi.crawler.base.ReadCrawler; import xyz.fycz.myreader.webapi.crawler.base.ReadCrawler;
public class ShuHaiGeReadCrawler implements ReadCrawler, BookInfoCrawler { public class ShuHaiGeReadCrawler extends BaseLocalCrawler implements BookInfoCrawler {
public static final String NAME_SPACE = "https://www.xinshuhaige.org"; public static final String NAME_SPACE = "https://www.xinshuhaige.org";
public static final String NOVEL_SEARCH = "https://www.xinshuhaige.org/search.html,searchkey={key}&searchtype=all"; public static final String NOVEL_SEARCH = "https://www.xinshuhaige.org/search.html,searchkey={key}&searchtype=all";
public static final String CHARSET = "utf-8"; public static final String CHARSET = "utf-8";
@ -52,6 +55,15 @@ public class ShuHaiGeReadCrawler implements ReadCrawler, BookInfoCrawler {
return SEARCH_CHARSET; return SEARCH_CHARSET;
} }
@Override
public Map<String, String> getHeaders() {
String cookie = "Hm_lvt_46329db612a10d9ae3a668a40c152e0e=1612793811,1612795781,1613200980,1613218588; "
+ "__cfduid=d0ebd0275436b7b0c3ccf4c9eb7394abd1619231977 ";
Map<String, String> headers = new HashMap<>();
headers.put("Cookie", cookie);
return headers;
}
/** /**
* 从html中获取章节正文 * 从html中获取章节正文
* *

@ -11,14 +11,17 @@ import xyz.fycz.myreader.enums.LocalBookSource;
import xyz.fycz.myreader.greendao.entity.Book; import xyz.fycz.myreader.greendao.entity.Book;
import xyz.fycz.myreader.greendao.entity.Chapter; import xyz.fycz.myreader.greendao.entity.Chapter;
import xyz.fycz.myreader.model.mulvalmap.ConcurrentMultiValueMap; import xyz.fycz.myreader.model.mulvalmap.ConcurrentMultiValueMap;
import xyz.fycz.myreader.webapi.crawler.base.BaseLocalCrawler;
import xyz.fycz.myreader.webapi.crawler.base.BookInfoCrawler; import xyz.fycz.myreader.webapi.crawler.base.BookInfoCrawler;
import xyz.fycz.myreader.webapi.crawler.base.ReadCrawler; import xyz.fycz.myreader.webapi.crawler.base.ReadCrawler;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
public class SoNovelReadCrawler implements ReadCrawler, BookInfoCrawler { public class SoNovelReadCrawler extends BaseLocalCrawler implements BookInfoCrawler {
public static final String NAME_SPACE = "https://www.soxs.cc"; public static final String NAME_SPACE = "https://www.soxs.cc";
public static final String NOVEL_SEARCH = "https://www.soxs.cc/search.html,searchtype=all&searchkey={key}&action=search&submit= 搜 索 "; public static final String NOVEL_SEARCH = "https://www.soxs.cc/search.html,searchtype=all&searchkey={key}&action=search&submit= 搜 索 ";
public static final String CHARSET = "UTF-8"; public static final String CHARSET = "UTF-8";
@ -49,6 +52,15 @@ public class SoNovelReadCrawler implements ReadCrawler, BookInfoCrawler {
return SEARCH_CHARSET; return SEARCH_CHARSET;
} }
@Override
public Map<String, String> getHeaders() {
String cookie = "Hm_lvt_46329db612a10d9ae3a668a40c152e0e=1612793811,1612795781,1613200980,1613218588; "
+ "__cfduid=d0ebd0275436b7b0c3ccf4c9eb7394abd1619231977 ";
Map<String, String> headers = new HashMap<>();
headers.put("Cookie", cookie);
return headers;
}
/** /**
* 从html中获取章节正文 * 从html中获取章节正文
* *

@ -13,6 +13,7 @@ import xyz.fycz.myreader.greendao.entity.Book;
import xyz.fycz.myreader.greendao.entity.Chapter; import xyz.fycz.myreader.greendao.entity.Chapter;
import xyz.fycz.myreader.model.mulvalmap.ConcurrentMultiValueMap; import xyz.fycz.myreader.model.mulvalmap.ConcurrentMultiValueMap;
import xyz.fycz.myreader.util.StringHelper; import xyz.fycz.myreader.util.StringHelper;
import xyz.fycz.myreader.webapi.crawler.base.BaseLocalCrawler;
import xyz.fycz.myreader.webapi.crawler.base.ReadCrawler; import xyz.fycz.myreader.webapi.crawler.base.ReadCrawler;
import java.util.ArrayList; import java.util.ArrayList;
@ -21,7 +22,7 @@ import java.util.ArrayList;
* 天籁小说网html解析工具 * 天籁小说网html解析工具
*/ */
public class TianLaiReadCrawler implements ReadCrawler { public class TianLaiReadCrawler extends BaseLocalCrawler {
public static final String NAME_SPACE = "https://www.23txt.com"; public static final String NAME_SPACE = "https://www.23txt.com";
public static final String NOVEL_SEARCH = "https://www.23txt.com/search.php?q={key}"; public static final String NOVEL_SEARCH = "https://www.23txt.com/search.php?q={key}";
public static final String CHARSET = "GBK"; public static final String CHARSET = "GBK";

@ -14,10 +14,11 @@ import xyz.fycz.myreader.enums.LocalBookSource;
import xyz.fycz.myreader.greendao.entity.Book; import xyz.fycz.myreader.greendao.entity.Book;
import xyz.fycz.myreader.greendao.entity.Chapter; import xyz.fycz.myreader.greendao.entity.Chapter;
import xyz.fycz.myreader.model.mulvalmap.ConcurrentMultiValueMap; import xyz.fycz.myreader.model.mulvalmap.ConcurrentMultiValueMap;
import xyz.fycz.myreader.webapi.crawler.base.BaseLocalCrawler;
import xyz.fycz.myreader.webapi.crawler.base.ReadCrawler; import xyz.fycz.myreader.webapi.crawler.base.ReadCrawler;
public class WoLongReadCrawler implements ReadCrawler { public class WoLongReadCrawler extends BaseLocalCrawler {
public static final String NAME_SPACE = "http://www.paper027.com"; public static final String NAME_SPACE = "http://www.paper027.com";
public static final String NOVEL_SEARCH = "http://www.paper027.com/search.html?keyword={key}"; public static final String NOVEL_SEARCH = "http://www.paper027.com/search.html?keyword={key}";
public static final String CHARSET = "UTF-8"; public static final String CHARSET = "UTF-8";

@ -14,10 +14,11 @@ import xyz.fycz.myreader.enums.LocalBookSource;
import xyz.fycz.myreader.greendao.entity.Book; import xyz.fycz.myreader.greendao.entity.Book;
import xyz.fycz.myreader.greendao.entity.Chapter; import xyz.fycz.myreader.greendao.entity.Chapter;
import xyz.fycz.myreader.model.mulvalmap.ConcurrentMultiValueMap; import xyz.fycz.myreader.model.mulvalmap.ConcurrentMultiValueMap;
import xyz.fycz.myreader.webapi.crawler.base.BaseLocalCrawler;
import xyz.fycz.myreader.webapi.crawler.base.ReadCrawler; import xyz.fycz.myreader.webapi.crawler.base.ReadCrawler;
public class XBiQuGeReadCrawler implements ReadCrawler { public class XBiQuGeReadCrawler extends BaseLocalCrawler {
public static final String NAME_SPACE = "https://www.xquge.com"; public static final String NAME_SPACE = "https://www.xquge.com";
public static final String NOVEL_SEARCH = "https://www.xquge.com/search?keyword={key}&sign="; public static final String NOVEL_SEARCH = "https://www.xquge.com/search?keyword={key}&sign=";
public static final String CHARSET = "UTF-8"; public static final String CHARSET = "UTF-8";

@ -16,16 +16,16 @@ import xyz.fycz.myreader.enums.LocalBookSource;
import xyz.fycz.myreader.greendao.entity.Book; import xyz.fycz.myreader.greendao.entity.Book;
import xyz.fycz.myreader.greendao.entity.Chapter; import xyz.fycz.myreader.greendao.entity.Chapter;
import xyz.fycz.myreader.model.mulvalmap.ConcurrentMultiValueMap; import xyz.fycz.myreader.model.mulvalmap.ConcurrentMultiValueMap;
import xyz.fycz.myreader.webapi.crawler.base.BaseLocalCrawler;
import xyz.fycz.myreader.webapi.crawler.base.FindCrawler; import xyz.fycz.myreader.webapi.crawler.base.FindCrawler;
import xyz.fycz.myreader.webapi.crawler.base.ReadCrawler; import xyz.fycz.myreader.webapi.crawler.base.ReadCrawler;
public class XS7ReadCrawler extends FindCrawler implements ReadCrawler { public class XS7ReadCrawler extends BaseLocalCrawler {
public static final String NAME_SPACE = "https://www.xs7.la"; public static final String NAME_SPACE = "https://www.xs7.la";
public static final String NOVEL_SEARCH = "https://www.xs7.la/modules/article/search.php,searchkey={key}"; public static final String NOVEL_SEARCH = "https://www.xs7.la/modules/article/search.php,searchkey={key}";
public static final String CHARSET = "GBK"; public static final String CHARSET = "GBK";
public static final String SEARCH_CHARSET = "GBK"; public static final String SEARCH_CHARSET = "GBK";
public static final String FIND_NAME = "书城[小说旗]";
@Override @Override
public String getSearchLink() { public String getSearchLink() {
@ -37,26 +37,6 @@ public class XS7ReadCrawler extends FindCrawler implements ReadCrawler {
return CHARSET; return CHARSET;
} }
@Override
public String getFindName() {
return FIND_NAME;
}
@Override
public String getFindUrl() {
return NAME_SPACE;
}
@Override
public boolean hasImg() {
return true;
}
@Override
public boolean needSearch() {
return false;
}
@Override @Override
public String getNameSpace() { public String getNameSpace() {
return NAME_SPACE; return NAME_SPACE;
@ -144,74 +124,4 @@ public class XS7ReadCrawler extends FindCrawler implements ReadCrawler {
// } // }
return books; return books;
} }
@Override
public List<BookType> getBookTypes(String html) {
List<BookType> bookTypes = new ArrayList<>();
Document doc = Jsoup.parse(html);
Element div = doc.getElementsByClass("subnav-hot").first();
Elements as = div.getElementsByTag("a");
for (Element a : as) {
BookType bookType = new BookType();
bookType.setUrl(a.attr("href"));
bookType.setTypeName(a.text());
bookTypes.add(bookType);
}
return bookTypes;
}
/*
<div id="alistbox">
<div class="pic"><a target="_blank" href="https://www.xs7.la/book/1_1201/" title="带着农场混异界最新章节列表"><img src="https://www.xs7.la/files/article/image/1/1201/1201s.jpg"
alt="带着农场混异界" title="带着农场混异界" width="115" height="160"></a></div>
<div class="info">
<div class="title">
<h2><a target="_blank" href="https://www.xs7.la/book/1_1201/">带着农场混异界</a></h2>
<span>作者明宇</span>
</div>
<div class="sys">最新更新<a href="https://www.xs7.la/book/1_1201/47219709.html" target="_blank" title="第四百四十七章 小山">第四百四十七章
小山</a></div>
<div class="intro"> 他横任他横我自种我田若要来惹我过不了明年
宅男赵海带着QQ农场穿越到了异界附身到了一个落迫的小贵族身上他的封地是一片种不出东西的黑土地而最主要的是...</div>
<div class="yuedu">
<a target="_blank" href="https://www.xs7.la/book/1_1201/">全文阅读</a>
<a href="https://www.xs7.la/modules/article/addbookcase.php?bid=1201">加入书架</a>
</div>
</div>
</div>
*/
@Override
public List<Book> getFindBooks(String html, BookType bookType) {
List<Book> books = new ArrayList<>();
Document doc = Jsoup.parse(html);
Element last = doc.getElementsByClass("last").first();
bookType.setPageSize(Integer.parseInt(last.text()));
Element div = doc.getElementById("alist");
Elements bDivs = div.select("div[id=alistbox]");
for (Element bDiv : bDivs) {
Book book = new Book();
Element title = bDiv.getElementsByClass("title").first();
Element sys = bDiv.getElementsByClass("sys").first();
Element intro = bDiv.getElementsByClass("intro").first();
book.setName(title.getElementsByTag("a").first().text());
book.setAuthor(title.getElementsByTag("span").first().text().replace("作者:", ""));
book.setNewestChapterTitle(sys.getElementsByTag("a").first().text());
book.setImgUrl(bDiv.getElementsByTag("img").attr("src"));
book.setDesc(intro.text());
book.setType(bookType.getTypeName());
book.setChapterUrl(title.getElementsByTag("a").first().attr("href"));
book.setSource(LocalBookSource.xs7.toString());
books.add(book);
}
return books;
}
@Override
public boolean getTypePage(BookType curType, int page) {
if (page != 1 && page > curType.getPageSize()) {
return true;
}
curType.setUrl(curType.getUrl().substring(0, curType.getUrl().lastIndexOf("_") + 1) + page + ".html");
return false;
}
} }

@ -15,11 +15,12 @@ import xyz.fycz.myreader.greendao.entity.Book;
import xyz.fycz.myreader.greendao.entity.Chapter; import xyz.fycz.myreader.greendao.entity.Chapter;
import xyz.fycz.myreader.model.mulvalmap.ConcurrentMultiValueMap; import xyz.fycz.myreader.model.mulvalmap.ConcurrentMultiValueMap;
import xyz.fycz.myreader.util.StringHelper; import xyz.fycz.myreader.util.StringHelper;
import xyz.fycz.myreader.webapi.crawler.base.BaseLocalCrawler;
import xyz.fycz.myreader.webapi.crawler.base.BookInfoCrawler; import xyz.fycz.myreader.webapi.crawler.base.BookInfoCrawler;
import xyz.fycz.myreader.webapi.crawler.base.ReadCrawler; import xyz.fycz.myreader.webapi.crawler.base.ReadCrawler;
public class XS7ReadCrawler2 implements ReadCrawler, BookInfoCrawler { public class XS7ReadCrawler2 extends BaseLocalCrawler implements BookInfoCrawler {
public static final String NAME_SPACE = "https://www.xs7.co"; public static final String NAME_SPACE = "https://www.xs7.co";
public static final String NOVEL_SEARCH = "https://www.xs7.co/modules/article/search.php?searchkey={key}&submit=%CB%D1%CB%F7"; public static final String NOVEL_SEARCH = "https://www.xs7.co/modules/article/search.php?searchkey={key}&submit=%CB%D1%CB%F7";
public static final String CHARSET = "GBK"; public static final String CHARSET = "GBK";

@ -15,10 +15,11 @@ import xyz.fycz.myreader.enums.LocalBookSource;
import xyz.fycz.myreader.greendao.entity.Book; import xyz.fycz.myreader.greendao.entity.Book;
import xyz.fycz.myreader.greendao.entity.Chapter; import xyz.fycz.myreader.greendao.entity.Chapter;
import xyz.fycz.myreader.model.mulvalmap.ConcurrentMultiValueMap; import xyz.fycz.myreader.model.mulvalmap.ConcurrentMultiValueMap;
import xyz.fycz.myreader.webapi.crawler.base.BaseLocalCrawler;
import xyz.fycz.myreader.webapi.crawler.base.ReadCrawler; import xyz.fycz.myreader.webapi.crawler.base.ReadCrawler;
public class XiaGuReadCrawler implements ReadCrawler { public class XiaGuReadCrawler extends BaseLocalCrawler {
public static final String NAME_SPACE = "https://www.xiagu.org"; public static final String NAME_SPACE = "https://www.xiagu.org";
public static final String NOVEL_SEARCH = "https://www.xiagu.org/search/?keyword={key}&t=0"; public static final String NOVEL_SEARCH = "https://www.xiagu.org/search/?keyword={key}&t=0";
public static final String CHARSET = "UTF-8"; public static final String CHARSET = "UTF-8";

@ -14,10 +14,11 @@ import xyz.fycz.myreader.enums.LocalBookSource;
import xyz.fycz.myreader.greendao.entity.Book; import xyz.fycz.myreader.greendao.entity.Book;
import xyz.fycz.myreader.greendao.entity.Chapter; import xyz.fycz.myreader.greendao.entity.Chapter;
import xyz.fycz.myreader.model.mulvalmap.ConcurrentMultiValueMap; import xyz.fycz.myreader.model.mulvalmap.ConcurrentMultiValueMap;
import xyz.fycz.myreader.webapi.crawler.base.BaseLocalCrawler;
import xyz.fycz.myreader.webapi.crawler.base.ReadCrawler; import xyz.fycz.myreader.webapi.crawler.base.ReadCrawler;
public class XingXingReadCrawler implements ReadCrawler { public class XingXingReadCrawler extends BaseLocalCrawler {
public static final String NAME_SPACE = "https://www.hs918.com"; public static final String NAME_SPACE = "https://www.hs918.com";
public static final String NOVEL_SEARCH = "https://www.hs918.com/search.php?key={key}"; public static final String NOVEL_SEARCH = "https://www.hs918.com/search.php?key={key}";
public static final String CHARSET = "UTF-8"; public static final String CHARSET = "UTF-8";

@ -21,10 +21,11 @@ import xyz.fycz.myreader.greendao.entity.Chapter;
import xyz.fycz.myreader.model.mulvalmap.ConcurrentMultiValueMap; import xyz.fycz.myreader.model.mulvalmap.ConcurrentMultiValueMap;
import xyz.fycz.myreader.util.utils.OkHttpUtils; import xyz.fycz.myreader.util.utils.OkHttpUtils;
import xyz.fycz.myreader.util.utils.StringUtils; import xyz.fycz.myreader.util.utils.StringUtils;
import xyz.fycz.myreader.webapi.crawler.base.BaseLocalCrawler;
import xyz.fycz.myreader.webapi.crawler.base.ReadCrawler; import xyz.fycz.myreader.webapi.crawler.base.ReadCrawler;
@Deprecated @Deprecated
public class YanQingLouReadCrawler implements ReadCrawler { public class YanQingLouReadCrawler extends BaseLocalCrawler {
public static final String NAME_SPACE = "http://www.yanqinglou.com"; public static final String NAME_SPACE = "http://www.yanqinglou.com";
public static final String NOVEL_SEARCH = "http://www.yanqinglou.com/Home/Search,action=search&q={key}"; public static final String NOVEL_SEARCH = "http://www.yanqinglou.com/Home/Search,action=search&q={key}";
public static final String AJAX_CONTENT = "http://www.yanqinglou.com/home/index/ajaxchapter"; public static final String AJAX_CONTENT = "http://www.yanqinglou.com/home/index/ajaxchapter";

@ -11,13 +11,14 @@ import xyz.fycz.myreader.enums.LocalBookSource;
import xyz.fycz.myreader.greendao.entity.Book; import xyz.fycz.myreader.greendao.entity.Book;
import xyz.fycz.myreader.greendao.entity.Chapter; import xyz.fycz.myreader.greendao.entity.Chapter;
import xyz.fycz.myreader.model.mulvalmap.ConcurrentMultiValueMap; import xyz.fycz.myreader.model.mulvalmap.ConcurrentMultiValueMap;
import xyz.fycz.myreader.webapi.crawler.base.BaseLocalCrawler;
import xyz.fycz.myreader.webapi.crawler.base.BookInfoCrawler; import xyz.fycz.myreader.webapi.crawler.base.BookInfoCrawler;
import xyz.fycz.myreader.webapi.crawler.base.ReadCrawler; import xyz.fycz.myreader.webapi.crawler.base.ReadCrawler;
import java.util.ArrayList; import java.util.ArrayList;
public class YunZhongReadCrawler implements ReadCrawler, BookInfoCrawler { public class YunZhongReadCrawler extends BaseLocalCrawler implements BookInfoCrawler {
public static final String NAME_SPACE = "http://www.yunxs.com"; public static final String NAME_SPACE = "http://www.yunxs.com";
public static final String NOVEL_SEARCH = "http://www.yunxs.com/plus/search.php?q={key}"; public static final String NOVEL_SEARCH = "http://www.yunxs.com/plus/search.php?q={key}";
public static final String CHARSET = "UTF-8"; public static final String CHARSET = "UTF-8";

@ -15,11 +15,12 @@ import xyz.fycz.myreader.greendao.entity.Book;
import xyz.fycz.myreader.greendao.entity.Chapter; import xyz.fycz.myreader.greendao.entity.Chapter;
import xyz.fycz.myreader.model.mulvalmap.ConcurrentMultiValueMap; import xyz.fycz.myreader.model.mulvalmap.ConcurrentMultiValueMap;
import xyz.fycz.myreader.util.StringHelper; import xyz.fycz.myreader.util.StringHelper;
import xyz.fycz.myreader.webapi.crawler.base.BaseLocalCrawler;
import xyz.fycz.myreader.webapi.crawler.base.BookInfoCrawler; import xyz.fycz.myreader.webapi.crawler.base.BookInfoCrawler;
import xyz.fycz.myreader.webapi.crawler.base.ReadCrawler; import xyz.fycz.myreader.webapi.crawler.base.ReadCrawler;
public class ZW37ReadCrawler implements ReadCrawler, BookInfoCrawler { public class ZW37ReadCrawler extends BaseLocalCrawler implements BookInfoCrawler {
private static final String NAME_SPACE = "https://www.37zww.net"; private static final String NAME_SPACE = "https://www.37zww.net";
private static final String NOVEL_SEARCH = "https://www.37zww.net/modules/article/search.php?searchtype=articlename&searchkey={key}"; private static final String NOVEL_SEARCH = "https://www.37zww.net/modules/article/search.php?searchtype=articlename&searchkey={key}";
private static final String CHARSET = "GBK"; private static final String CHARSET = "GBK";

@ -14,10 +14,11 @@ import xyz.fycz.myreader.enums.LocalBookSource;
import xyz.fycz.myreader.greendao.entity.Book; import xyz.fycz.myreader.greendao.entity.Book;
import xyz.fycz.myreader.greendao.entity.Chapter; import xyz.fycz.myreader.greendao.entity.Chapter;
import xyz.fycz.myreader.model.mulvalmap.ConcurrentMultiValueMap; import xyz.fycz.myreader.model.mulvalmap.ConcurrentMultiValueMap;
import xyz.fycz.myreader.webapi.crawler.base.BaseLocalCrawler;
import xyz.fycz.myreader.webapi.crawler.base.ReadCrawler; import xyz.fycz.myreader.webapi.crawler.base.ReadCrawler;
public class ZaiShuYuanReadCrawler implements ReadCrawler { public class ZaiShuYuanReadCrawler extends BaseLocalCrawler{
public static final String NAME_SPACE = "https://www.zhaishuyuan.com"; public static final String NAME_SPACE = "https://www.zhaishuyuan.com";
public static final String NOVEL_SEARCH = "https://www.zhaishuyuan.com/search/,key={key}"; public static final String NOVEL_SEARCH = "https://www.zhaishuyuan.com/search/,key={key}";
public static final String CHARSET = "gbk"; public static final String CHARSET = "gbk";

@ -12,13 +12,14 @@ import xyz.fycz.myreader.enums.LocalBookSource;
import xyz.fycz.myreader.greendao.entity.Book; import xyz.fycz.myreader.greendao.entity.Book;
import xyz.fycz.myreader.greendao.entity.Chapter; import xyz.fycz.myreader.greendao.entity.Chapter;
import xyz.fycz.myreader.model.mulvalmap.ConcurrentMultiValueMap; import xyz.fycz.myreader.model.mulvalmap.ConcurrentMultiValueMap;
import xyz.fycz.myreader.webapi.crawler.base.BaseLocalCrawler;
import xyz.fycz.myreader.webapi.crawler.base.BookInfoCrawler; import xyz.fycz.myreader.webapi.crawler.base.BookInfoCrawler;
import xyz.fycz.myreader.webapi.crawler.base.ReadCrawler; import xyz.fycz.myreader.webapi.crawler.base.ReadCrawler;
import java.util.ArrayList; import java.util.ArrayList;
public class ZuoPinReadCrawler implements ReadCrawler, BookInfoCrawler { public class ZuoPinReadCrawler extends BaseLocalCrawler implements BookInfoCrawler {
public static final String NAME_SPACE = "http://zuopinj.com"; public static final String NAME_SPACE = "http://zuopinj.com";
public static final String NOVEL_SEARCH = "http://so.zuopinj.com/search/index.php,tbname=bookname&show=title&tempid=3&keyboard={key}"; public static final String NOVEL_SEARCH = "http://so.zuopinj.com/search/index.php,tbname=bookname&show=title&tempid=3&keyboard={key}";
public static final String CHARSET = "UTF-8"; public static final String CHARSET = "UTF-8";

@ -366,6 +366,7 @@
<string name="source_url">书源URL</string> <string name="source_url">书源URL</string>
<string name="source_group">书源分组</string> <string name="source_group">书源分组</string>
<string name="source_charset">书源字符编码</string> <string name="source_charset">书源字符编码</string>
<string name="source_headers">书源请求头</string>
<string name="diy_source_group">自定义源分组</string> <string name="diy_source_group">自定义源分组</string>
<string name="diy_edit_source_group">输入自定义源分组名称</string> <string name="diy_edit_source_group">输入自定义源分组名称</string>
<string name="diy_edit_source_group_title">【%s】</string> <string name="diy_edit_source_group_title">【%s】</string>

Loading…
Cancel
Save