兼容第三方书源

pull/5/head
fengyuecanzhu 4 years ago
parent 1e30cf0629
commit 58a25047d5
  1. 17
      app/src/main/java/xyz/fycz/myreader/model/SearchEngine.java
  2. 6
      app/src/main/java/xyz/fycz/myreader/model/mulvalmap/ConMVMap.java
  3. 10
      app/src/main/java/xyz/fycz/myreader/ui/activity/BookDetailedActivity.java
  4. 7
      app/src/main/java/xyz/fycz/myreader/ui/activity/SearchBookActivity.java
  5. 9
      app/src/main/java/xyz/fycz/myreader/ui/adapter/SearchBookAdapter.java
  6. 10
      app/src/main/java/xyz/fycz/myreader/ui/adapter/holder/SearchBookHolder.java
  7. 4
      app/src/main/java/xyz/fycz/myreader/ui/dialog/SourceExchangeDialog.java
  8. 13
      app/src/main/java/xyz/fycz/myreader/webapi/CommonApi.java
  9. 5
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/base/BaseReadCrawler.java
  10. 6
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/base/BaseSourceCrawler.java
  11. 5
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/base/BaseSourceCrawlerNoInfo.java
  12. 5
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/base/ReadCrawler.java
  13. 7
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/find/Ben100FindCrawler.java
  14. 6
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/find/MiaoBiFindCrawler.java
  15. 6
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/find/XS7FindCrawler.java
  16. 6
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/read/Ben100ReadCrawler.java
  17. 6
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/read/BiJianReadCrawler.java
  18. 6
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/read/BiQuGe44ReadCrawler.java
  19. 6
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/read/BiQuGeReadCrawler.java
  20. 6
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/read/CansShu99ReadCrawler.java
  21. 6
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/read/ChaoXingReadCrawler.java
  22. 6
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/read/ChuanQiReadCrawler.java
  23. 6
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/read/DSTQReadCrawler.java
  24. 6
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/read/Du1DuReadCrawler.java
  25. 6
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/read/EWenXueReadCrawler.java
  26. 6
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/read/FYReadCrawler.java
  27. 6
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/read/HongChenReadCrawler.java
  28. 6
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/read/JiuTaoReadCrawler.java
  29. 6
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/read/LaoYaoReadCrawler.java
  30. 10
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/read/LiuLangCatReadCrawler.java
  31. 6
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/read/LuoQiuReadCrawler.java
  32. 6
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/read/MiQuReadCrawler.java
  33. 6
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/read/MiaoBiReadCrawler.java
  34. 6
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/read/PiaoTianReadCrawler.java
  35. 6
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/read/PinShuReadCrawler.java
  36. 6
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/read/PinShuReadCrawler2.java
  37. 6
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/read/QB5ReadCrawler.java
  38. 6
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/read/QiQiReadCrawler.java
  39. 6
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/read/QianDianReadCrawler.java
  40. 6
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/read/QuanNovelReadCrawler.java
  41. 6
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/read/ReXueReadCrawler.java
  42. 6
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/read/ShiGuangReadCrawler.java
  43. 6
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/read/ShuHaiGeReadCrawler.java
  44. 6
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/read/SoNovelReadCrawler.java
  45. 6
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/read/TianLaiReadCrawler.java
  46. 6
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/read/WoLongReadCrawler.java
  47. 6
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/read/XBiQuGeReadCrawler.java
  48. 6
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/read/XS7ReadCrawler.java
  49. 6
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/read/XS7ReadCrawler2.java
  50. 6
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/read/XiaGuReadCrawler.java
  51. 6
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/read/XingXingReadCrawler.java
  52. 6
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/read/YanQingLouReadCrawler.java
  53. 6
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/read/YunZhongReadCrawler.java
  54. 6
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/read/ZW37ReadCrawler.java
  55. 6
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/read/ZaiShuYuanReadCrawler.java
  56. 6
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/read/ZuoPinReadCrawler.java
  57. 6
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/source/JsonPathCrawler.java
  58. 6
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/source/MatcherCrawler.java
  59. 8
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/source/ThirdCrawler.java
  60. 6
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/source/XpathCrawler.java

@ -13,15 +13,13 @@ import xyz.fycz.myreader.application.App;
import xyz.fycz.myreader.entity.SearchBookBean;
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.model.mulvalmap.ConMVMap;
import xyz.fycz.myreader.util.SharedPreUtils;
import xyz.fycz.myreader.util.ToastUtils;
import xyz.fycz.myreader.webapi.CommonApi;
import xyz.fycz.myreader.webapi.crawler.base.BookInfoCrawler;
import xyz.fycz.myreader.webapi.crawler.base.ReadCrawler;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.ExecutorService;
@ -140,14 +138,14 @@ public class SearchEngine {
CommonApi.search(keyword, crawler)
.subscribeOn(scheduler)
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Observer<ConcurrentMultiValueMap<SearchBookBean, Book>>() {
.subscribe(new Observer<ConMVMap<SearchBookBean, Book>>() {
@Override
public void onSubscribe(Disposable d) {
compositeDisposable.add(d);
}
@Override
public void onNext(ConcurrentMultiValueMap<SearchBookBean, Book> bookSearchBeans) {
public void onNext(ConMVMap<SearchBookBean, Book> bookSearchBeans) {
searchFinishNum++;
if (bookSearchBeans != null) {
searchSuccessNum++;
@ -183,17 +181,18 @@ public class SearchEngine {
searchSiteIndex++;
if (searchSiteIndex < mSourceList.size()) {
ReadCrawler crawler = mSourceList.get(searchSiteIndex);
CommonApi.search(title, crawler)
String searchKey = title;
CommonApi.search(searchKey, crawler)
.subscribeOn(scheduler)
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Observer<ConcurrentMultiValueMap<SearchBookBean, Book>>() {
.subscribe(new Observer<ConMVMap<SearchBookBean, Book>>() {
@Override
public void onSubscribe(Disposable d) {
compositeDisposable.add(d);
}
@Override
public void onNext(ConcurrentMultiValueMap<SearchBookBean, Book> bookSearchBeans) {
public void onNext(ConMVMap<SearchBookBean, Book> bookSearchBeans) {
searchFinishNum++;
if (bookSearchBeans != null) {
List<Book> books = bookSearchBeans.getValues(new SearchBookBean(title, author));
@ -262,7 +261,7 @@ public class SearchEngine {
void loadMoreFinish(Boolean isAll);
void loadMoreSearchBook(ConcurrentMultiValueMap<SearchBookBean, Book> items);
void loadMoreSearchBook(ConMVMap<SearchBookBean, Book> items);
void loadMoreSearchBook(List<Book> items);

@ -7,17 +7,17 @@ import java.util.concurrent.ConcurrentHashMap;
* @author fengyue
* @date 2020/5/19 7:36
*/
public class ConcurrentMultiValueMap<K, V> implements MultiValueSetMap<K, V> {
public class ConMVMap<K, V> implements MultiValueSetMap<K, V> {
protected Map<K, LinkedHashSet<V>> mSource = new ConcurrentHashMap<>();
public ConcurrentMultiValueMap() {
public ConMVMap() {
}
@Override
public void add(K key, V value) {
if (key != null) {
if (value == null) return;
// 如果有这个Key就继续添加Value,没有就创建一个List并添加Value
if (!mSource.containsKey(key))
mSource.put(key, new LinkedHashSet<V>(2));

@ -210,7 +210,7 @@ public class BookDetailedActivity extends BaseActivity {
binding.ic.bookDetailRvCatalog.setLayoutManager(new LinearLayoutManager(this));
binding.ic.bookDetailRvCatalog.setAdapter(mCatalogAdapter);
if (!thirdSource) initChapters(false);
if (!thirdSource || isCollected) initChapters(false);
mCatalogAdapter.setOnItemClickListener((view, pos) -> {
mBook.setHisttoryChapterNum(mChapters.size() - pos - 1);
@ -399,11 +399,12 @@ public class BookDetailedActivity extends BaseActivity {
mBook.setImgUrl("");
}
initTagList();
binding.ic.bookDetailTvDesc.setText("");
if (StringHelper.isEmpty(mBook.getDesc()))
binding.ic.bookDetailTvDesc.setText("");
BookSource source = BookSourceManager.getBookSourceByStr(mBook.getSource());
binding.ih.bookDetailSource.setText(String.format("书源:%s", source.getSourceName()));
ReadCrawler rc = ReadCrawlerUtil.getReadCrawler(source);
if ((rc instanceof BookInfoCrawler && StringHelper.isEmpty(mBook.getImgUrl())) || thirdSource) {
if ((rc instanceof BookInfoCrawler && StringHelper.isEmpty(mBook.getImgUrl())) || (thirdSource && !isCollected)) {
binding.pbLoading.setVisibility(View.VISIBLE);
BookInfoCrawler bic = (BookInfoCrawler) rc;
CommonApi.getBookInfo(mBook, bic).compose(RxUtils::toSimpleSingle).subscribe(new MyObserver<Book>() {
@ -420,6 +421,9 @@ public class BookDetailedActivity extends BaseActivity {
@Override
public void onError(Throwable e) {
ToastUtils.showError("书籍详情加载失败!");
if (thirdSource){
initChapters(false);
}
if (App.isDebug()) e.printStackTrace();
}
});

@ -48,7 +48,7 @@ import xyz.fycz.myreader.greendao.entity.SearchHistory;
import xyz.fycz.myreader.greendao.entity.rule.BookSource;
import xyz.fycz.myreader.greendao.service.SearchHistoryService;
import xyz.fycz.myreader.model.SearchEngine;
import xyz.fycz.myreader.model.mulvalmap.ConcurrentMultiValueMap;
import xyz.fycz.myreader.model.mulvalmap.ConMVMap;
import xyz.fycz.myreader.model.sourceAnalyzer.BookSourceManager;
import xyz.fycz.myreader.ui.adapter.SearchBookAdapter;
import xyz.fycz.myreader.ui.adapter.SearchHistoryAdapter;
@ -73,7 +73,7 @@ public class SearchBookActivity extends BaseActivity {
private SearchBookAdapter mSearchBookAdapter;
private String searchKey;//搜索关键字
private ArrayList<SearchBookBean> mBooksBean = new ArrayList<>();
private ConcurrentMultiValueMap<SearchBookBean, Book> mBooks = new ConcurrentMultiValueMap<>();
private ConMVMap<SearchBookBean, Book> mBooks = new ConMVMap<>();
private ArrayList<SearchHistory> mSearchHistories = new ArrayList<>();
private ArrayList<String> mSuggestions = new ArrayList<>();
@ -147,7 +147,7 @@ public class SearchBookActivity extends BaseActivity {
}
@Override
public void loadMoreSearchBook(ConcurrentMultiValueMap<SearchBookBean, Book> items) {
public void loadMoreSearchBook(ConMVMap<SearchBookBean, Book> items) {
mBooks.addAll(items);
mSearchBookAdapter.addAll(new ArrayList<>(items.keySet()), searchKey);
mHandler.sendMessage(mHandler.obtainMessage(2));
@ -543,6 +543,7 @@ public class SearchBookActivity extends BaseActivity {
mSearchBookAdapter.setOnItemClickListener((view, pos) -> {
SearchBookBean data = mSearchBookAdapter.getItem(pos);
ArrayList<Book> books = (ArrayList<Book>) mBooks.getValues(data);
if (books == null || books.size() == 0) return;
searchBookBean2Book(data, books.get(0));
Intent intent = new Intent(this, BookDetailedActivity.class);
intent.putExtra(APPCONST.SEARCH_BOOK_BEAN, books);

@ -10,7 +10,7 @@ import xyz.fycz.myreader.base.adapter.IViewHolder;
import xyz.fycz.myreader.entity.SearchBookBean;
import xyz.fycz.myreader.greendao.entity.Book;
import xyz.fycz.myreader.model.SearchEngine;
import xyz.fycz.myreader.model.mulvalmap.ConcurrentMultiValueMap;
import xyz.fycz.myreader.model.mulvalmap.ConMVMap;
import xyz.fycz.myreader.ui.adapter.holder.SearchBookHolder;
import xyz.fycz.myreader.util.utils.StringUtils;
@ -24,11 +24,11 @@ import java.util.List;
*/
public class SearchBookAdapter extends BaseListAdapter<SearchBookBean> {
private Activity activity;
private ConcurrentMultiValueMap<SearchBookBean, Book> mBooks;
private ConMVMap<SearchBookBean, Book> mBooks;
private SearchEngine searchEngine;
private String keyWord;
public SearchBookAdapter(Activity activity, ConcurrentMultiValueMap<SearchBookBean, Book> mBooks, SearchEngine searchEngine, String keyWord) {
public SearchBookAdapter(Activity activity, ConMVMap<SearchBookBean, Book> mBooks, SearchEngine searchEngine, String keyWord) {
this.activity = activity;
this.mBooks = mBooks;
this.searchEngine = searchEngine;
@ -37,7 +37,7 @@ public class SearchBookAdapter extends BaseListAdapter<SearchBookBean> {
@Override
protected IViewHolder<SearchBookBean> createViewHolder(int viewType) {
return new SearchBookHolder(activity, mBooks, searchEngine, keyWord);
return new SearchBookHolder(activity, mBooks, searchEngine, keyWord, this);
}
public void addAll(List<SearchBookBean> newDataS, String keyWord) {
@ -110,7 +110,6 @@ public class SearchBookAdapter extends BaseListAdapter<SearchBookBean> {
}
}
}
synchronized (this) {
App.runOnUiThread(() -> {
mList = copyDataS;

@ -17,9 +17,10 @@ import xyz.fycz.myreader.entity.SearchBookBean;
import xyz.fycz.myreader.greendao.entity.Book;
import xyz.fycz.myreader.greendao.entity.rule.BookSource;
import xyz.fycz.myreader.model.SearchEngine;
import xyz.fycz.myreader.model.mulvalmap.ConcurrentMultiValueMap;
import xyz.fycz.myreader.model.mulvalmap.ConMVMap;
import xyz.fycz.myreader.model.sourceAnalyzer.BookSourceManager;
import xyz.fycz.myreader.ui.adapter.BookTagAdapter;
import xyz.fycz.myreader.ui.adapter.SearchBookAdapter;
import xyz.fycz.myreader.util.StringHelper;
import xyz.fycz.myreader.util.utils.KeyWordUtils;
import xyz.fycz.myreader.util.utils.NetworkUtils;
@ -34,12 +35,12 @@ import xyz.fycz.myreader.widget.CoverImageView;
*/
public class SearchBookHolder extends ViewHolderImpl<SearchBookBean> {
private Activity activity;
private ConcurrentMultiValueMap<SearchBookBean, Book> mBooks;
private ConMVMap<SearchBookBean, Book> mBooks;
private SearchEngine searchEngine;
private String keyWord;
private List<String> tagList = new ArrayList<>();
public SearchBookHolder(Activity activity, ConcurrentMultiValueMap<SearchBookBean, Book> mBooks, SearchEngine searchEngine, String keyWord) {
public SearchBookHolder(Activity activity, ConMVMap<SearchBookBean, Book> mBooks, SearchEngine searchEngine, String keyWord, SearchBookAdapter adapter) {
this.activity = activity;
this.mBooks = mBooks;
this.searchEngine = searchEngine;
@ -76,6 +77,9 @@ public class SearchBookHolder extends ViewHolderImpl<SearchBookBean> {
@Override
public void onBind(SearchBookBean data, int pos) {
List<Book> aBooks = mBooks.getValues(data);
if (aBooks == null || aBooks.size() == 0){
return;
}
int bookCount = aBooks.size();
Book book = aBooks.get(0);
BookSource source = BookSourceManager.getBookSourceByStr(book.getSource());

@ -19,7 +19,7 @@ import xyz.fycz.myreader.databinding.DialogBookSourceBinding;
import xyz.fycz.myreader.entity.SearchBookBean;
import xyz.fycz.myreader.greendao.entity.Book;
import xyz.fycz.myreader.model.SearchEngine;
import xyz.fycz.myreader.model.mulvalmap.ConcurrentMultiValueMap;
import xyz.fycz.myreader.model.mulvalmap.ConMVMap;
import xyz.fycz.myreader.ui.adapter.SourceExchangeAdapter;
import xyz.fycz.myreader.webapi.crawler.ReadCrawlerUtil;
import xyz.fycz.myreader.widget.RefreshProgressBar;
@ -140,7 +140,7 @@ public class SourceExchangeDialog extends Dialog {
}
@Override
public void loadMoreSearchBook(ConcurrentMultiValueMap<SearchBookBean, Book> items) {
public void loadMoreSearchBook(ConMVMap<SearchBookBean, Book> items) {
}

@ -1,11 +1,8 @@
package xyz.fycz.myreader.webapi;
import android.text.TextUtils;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.List;
import java.util.Objects;
import java.util.regex.Matcher;
import io.reactivex.Observable;
@ -15,17 +12,15 @@ import io.reactivex.functions.Function;
import okhttp3.MediaType;
import okhttp3.RequestBody;
import xyz.fycz.myreader.entity.SearchBookBean;
import xyz.fycz.myreader.entity.StrResponse;
import xyz.fycz.myreader.greendao.entity.Book;
import xyz.fycz.myreader.greendao.entity.Chapter;
import xyz.fycz.myreader.greendao.entity.rule.BookSource;
import xyz.fycz.myreader.model.mulvalmap.ConMVMap;
import xyz.fycz.myreader.model.third.analyzeRule.AnalyzeUrl;
import xyz.fycz.myreader.model.mulvalmap.ConcurrentMultiValueMap;
import xyz.fycz.myreader.model.third.content.BookChapterList;
import xyz.fycz.myreader.model.third.content.BookContent;
import xyz.fycz.myreader.model.third.content.BookInfo;
import xyz.fycz.myreader.model.third.content.BookList;
import xyz.fycz.myreader.util.StringHelper;
import xyz.fycz.myreader.util.utils.NetworkUtils;
import xyz.fycz.myreader.util.utils.OkHttpUtils;
import xyz.fycz.myreader.webapi.crawler.base.BookInfoCrawler;
@ -141,7 +136,7 @@ public class CommonApi {
*
* @param key
*/
public static Observable<ConcurrentMultiValueMap<SearchBookBean, Book>> search(String key, final ReadCrawler rc) {
public static Observable<ConMVMap<SearchBookBean, Book>> search(String key, final ReadCrawler rc) {
if (rc instanceof ThirdCrawler) {
return searchByTC(key, (ThirdCrawler) rc);
}
@ -192,14 +187,14 @@ public class CommonApi {
* @param rc
* @return
*/
public static Observable<ConcurrentMultiValueMap<SearchBookBean, Book>> searchByTC(String key, final ThirdCrawler rc) {
public static Observable<ConMVMap<SearchBookBean, Book>> searchByTC(String key, final ThirdCrawler rc) {
try {
BookSource source = rc.getSource();
AnalyzeUrl analyzeUrl = new AnalyzeUrl(source.getSearchRule().getSearchUrl(),
key, 1, null, source.getSourceUrl());
BookList bookList = new BookList(source.getSourceUrl(), source.getSourceName(), source, false);
return OkHttpUtils.getStrResponse(analyzeUrl).flatMap(bookList::analyzeSearchBook)
.flatMap((Function<List<Book>, ObservableSource<ConcurrentMultiValueMap<SearchBookBean, Book>>>) books -> Observable.create((ObservableOnSubscribe<ConcurrentMultiValueMap<SearchBookBean, Book>>) emitter -> {
.flatMap((Function<List<Book>, ObservableSource<ConMVMap<SearchBookBean, Book>>>) books -> Observable.create((ObservableOnSubscribe<ConMVMap<SearchBookBean, Book>>) emitter -> {
emitter.onNext(rc.getBooks(books));
emitter.onComplete();
}));

@ -4,10 +4,9 @@ import java.util.ArrayList;
import java.util.Map;
import xyz.fycz.myreader.entity.SearchBookBean;
import xyz.fycz.myreader.entity.StrResponse;
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.model.mulvalmap.ConMVMap;
/**
* 因新版书源使用StrResponse为了兼容旧版本书源全部继承自此类
@ -21,7 +20,7 @@ public abstract class BaseReadCrawler implements ReadCrawler {
}
@Override
public ConcurrentMultiValueMap<SearchBookBean, Book> getBooksFromSearchHtml(String html) {
public ConMVMap<SearchBookBean, Book> getBooksFromSearchHtml(String html) {
return null;
}

@ -19,7 +19,7 @@ import xyz.fycz.myreader.greendao.entity.rule.BookSource;
import xyz.fycz.myreader.greendao.entity.rule.InfoRule;
import xyz.fycz.myreader.greendao.entity.rule.SearchRule;
import xyz.fycz.myreader.greendao.entity.rule.TocRule;
import xyz.fycz.myreader.model.mulvalmap.ConcurrentMultiValueMap;
import xyz.fycz.myreader.model.mulvalmap.ConMVMap;
import xyz.fycz.myreader.model.sourceAnalyzer.BaseAnalyzer;
import xyz.fycz.myreader.model.sourceAnalyzer.MatcherAnalyzer;
import xyz.fycz.myreader.util.StringHelper;
@ -82,7 +82,7 @@ public abstract class BaseSourceCrawler extends BaseReadCrawler implements BookI
* @param searchRule
* @param books
*/
protected void getBooksNoList(Object obj, SearchRule searchRule, ConcurrentMultiValueMap<SearchBookBean, Book> books) {
protected void getBooksNoList(Object obj, SearchRule searchRule, ConMVMap<SearchBookBean, Book> books) {
List<String> names = analyzer.getStringList(searchRule.getName(), obj);
//未搜索到书籍,按详情页处理
if (names.size() == 0) {
@ -133,7 +133,7 @@ public abstract class BaseSourceCrawler extends BaseReadCrawler implements BookI
* @param searchRule
* @param books
*/
protected void getBooks(Object obj, SearchRule searchRule, ConcurrentMultiValueMap<SearchBookBean, Book> books) {
protected void getBooks(Object obj, SearchRule searchRule, ConMVMap<SearchBookBean, Book> books) {
List bookList = getList(searchRule.getList(), obj);
if (bookList.size() == 0) {
Book book = new Book();

@ -6,8 +6,7 @@ import java.util.Map;
import xyz.fycz.myreader.entity.SearchBookBean;
import xyz.fycz.myreader.greendao.entity.Book;
import xyz.fycz.myreader.greendao.entity.Chapter;
import xyz.fycz.myreader.greendao.entity.rule.BookSource;
import xyz.fycz.myreader.model.mulvalmap.ConcurrentMultiValueMap;
import xyz.fycz.myreader.model.mulvalmap.ConMVMap;
/**
* @author fengyue
@ -46,7 +45,7 @@ public class BaseSourceCrawlerNoInfo extends BaseReadCrawler {
}
@Override
public ConcurrentMultiValueMap<SearchBookBean, Book> getBooksFromSearchHtml(String html) {
public ConMVMap<SearchBookBean, Book> getBooksFromSearchHtml(String html) {
return crawler.getBooksFromSearchHtml(html);
}

@ -1,10 +1,9 @@
package xyz.fycz.myreader.webapi.crawler.base;
import xyz.fycz.myreader.entity.SearchBookBean;
import xyz.fycz.myreader.entity.StrResponse;
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.model.mulvalmap.ConMVMap;
import java.util.ArrayList;
import java.util.Map;
@ -21,7 +20,7 @@ public interface ReadCrawler {
String getNameSpace(); // 书源主页地址
Boolean isPost(); // 是否以post请求搜索
Map<String, String> getHeaders();// 自定义请求头,可添加cookie等
ConcurrentMultiValueMap<SearchBookBean, Book> getBooksFromSearchHtml(String html); // 搜索书籍规则
ConMVMap<SearchBookBean, Book> getBooksFromSearchHtml(String html); // 搜索书籍规则
ArrayList<Chapter> getChaptersFromHtml(String html); // 获取书籍章节列表规则
String getContentFormHtml(String html); // 获取书籍内容规则
}

@ -1,7 +1,5 @@
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;
@ -11,15 +9,10 @@ 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 {

@ -1,7 +1,5 @@
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;
@ -11,14 +9,10 @@ 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 {

@ -1,7 +1,5 @@
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;
@ -10,14 +8,10 @@ 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{

@ -11,7 +11,7 @@ import xyz.fycz.myreader.entity.SearchBookBean;
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.model.mulvalmap.ConMVMap;
import xyz.fycz.myreader.webapi.crawler.base.BaseReadCrawler;
import xyz.fycz.myreader.webapi.crawler.base.BookInfoCrawler;
@ -102,8 +102,8 @@ public class Ben100ReadCrawler extends BaseReadCrawler implements BookInfoCrawle
* @param html
* @return
*/
public ConcurrentMultiValueMap<SearchBookBean, Book> getBooksFromSearchHtml(String html) {
ConcurrentMultiValueMap<SearchBookBean, Book> books = new ConcurrentMultiValueMap<>();
public ConMVMap<SearchBookBean, Book> getBooksFromSearchHtml(String html) {
ConMVMap<SearchBookBean, Book> books = new ConMVMap<>();
Document doc = Jsoup.parse(html);
// try {
Elements divs = doc.getElementsByClass("recommand");

@ -13,7 +13,7 @@ import xyz.fycz.myreader.entity.SearchBookBean;
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.model.mulvalmap.ConMVMap;
import xyz.fycz.myreader.webapi.crawler.base.BaseReadCrawler;
@ -98,8 +98,8 @@ public class BiJianReadCrawler extends BaseReadCrawler {
* <a class="view" href="http://www.bjcan.com/book/74544.html" target="_blank">小说详情</a>
* </li>
*/
public ConcurrentMultiValueMap<SearchBookBean, Book> getBooksFromSearchHtml(String html) {
ConcurrentMultiValueMap<SearchBookBean, Book> books = new ConcurrentMultiValueMap<>();
public ConMVMap<SearchBookBean, Book> getBooksFromSearchHtml(String html) {
ConMVMap<SearchBookBean, Book> books = new ConMVMap<>();
Document doc = Jsoup.parse(html);
Elements divs = doc.getElementsByClass("book-list");
Element div = divs.get(0);

@ -11,7 +11,7 @@ import xyz.fycz.myreader.entity.SearchBookBean;
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.model.mulvalmap.ConMVMap;
import xyz.fycz.myreader.util.StringHelper;
import xyz.fycz.myreader.webapi.crawler.base.BaseReadCrawler;
import xyz.fycz.myreader.webapi.crawler.base.BookInfoCrawler;
@ -108,8 +108,8 @@ public class BiQuGe44ReadCrawler extends BaseReadCrawler implements BookInfoCraw
* @param html
* @return
*/
public ConcurrentMultiValueMap<SearchBookBean, Book> getBooksFromSearchHtml(String html) {
ConcurrentMultiValueMap<SearchBookBean, Book> books = new ConcurrentMultiValueMap<>();
public ConMVMap<SearchBookBean, Book> getBooksFromSearchHtml(String html) {
ConMVMap<SearchBookBean, Book> books = new ConMVMap<>();
Document doc = Jsoup.parse(html);
Elements divs = doc.getElementsByTag("table");
Element div = divs.get(0);

@ -10,7 +10,7 @@ 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.model.mulvalmap.ConMVMap;
import xyz.fycz.myreader.util.StringHelper;
import xyz.fycz.myreader.webapi.crawler.base.BaseReadCrawler;
import xyz.fycz.myreader.webapi.crawler.base.BookInfoCrawler;
@ -160,8 +160,8 @@ public class BiQuGeReadCrawler extends BaseReadCrawler implements BookInfoCrawle
* @param html
* @return
*/
public ConcurrentMultiValueMap<SearchBookBean, Book> getBooksFromSearchHtml(String html) {
final ConcurrentMultiValueMap<SearchBookBean, Book> books = new ConcurrentMultiValueMap<>();
public ConMVMap<SearchBookBean, Book> getBooksFromSearchHtml(String html) {
final ConMVMap<SearchBookBean, Book> books = new ConMVMap<>();
Document doc = Jsoup.parse(html);
String urlType = doc.select("meta[property=og:type]").attr("content");
if ("novel".equals(urlType)) {

@ -11,7 +11,7 @@ import xyz.fycz.myreader.entity.SearchBookBean;
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.model.mulvalmap.ConMVMap;
import xyz.fycz.myreader.webapi.crawler.base.BaseReadCrawler;
import java.util.ArrayList;
@ -101,8 +101,8 @@ public class CansShu99ReadCrawler extends BaseReadCrawler {
* @param html
* @return
*/
public ConcurrentMultiValueMap<SearchBookBean, Book> getBooksFromSearchHtml(String html) {
ConcurrentMultiValueMap<SearchBookBean, Book> books = new ConcurrentMultiValueMap<>();
public ConMVMap<SearchBookBean, Book> getBooksFromSearchHtml(String html) {
ConMVMap<SearchBookBean, Book> books = new ConMVMap<>();
Document doc = Jsoup.parse(html);
// try {
Elements divs = doc.getElementsByClass("list_box");

@ -12,7 +12,7 @@ import xyz.fycz.myreader.entity.SearchBookBean;
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.model.mulvalmap.ConMVMap;
import xyz.fycz.myreader.webapi.crawler.base.BaseReadCrawler;
import java.util.ArrayList;
@ -103,8 +103,8 @@ public class ChaoXingReadCrawler extends BaseReadCrawler {
* @param json
* @return
*/
public ConcurrentMultiValueMap<SearchBookBean, Book> getBooksFromSearchHtml(String json) {
ConcurrentMultiValueMap<SearchBookBean, Book> books = new ConcurrentMultiValueMap<>();
public ConMVMap<SearchBookBean, Book> getBooksFromSearchHtml(String json) {
ConMVMap<SearchBookBean, Book> books = new ConMVMap<>();
try {
JSONArray booksArray = new JSONArray(json);
for (int i = 0; i < booksArray.length(); i++) {

@ -14,7 +14,7 @@ import xyz.fycz.myreader.entity.SearchBookBean;
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.model.mulvalmap.ConMVMap;
import xyz.fycz.myreader.webapi.crawler.base.BaseReadCrawler;
@Deprecated
@ -126,8 +126,8 @@ public class ChuanQiReadCrawler extends BaseReadCrawler {
</div>
</li>
*/
public ConcurrentMultiValueMap<SearchBookBean, Book> getBooksFromSearchHtml(String html) {
ConcurrentMultiValueMap<SearchBookBean, Book> books = new ConcurrentMultiValueMap<>();
public ConMVMap<SearchBookBean, Book> getBooksFromSearchHtml(String html) {
ConMVMap<SearchBookBean, Book> books = new ConMVMap<>();
Document doc = Jsoup.parse(html);
// try {
String urlType = doc.select("meta[property=og:type]").attr("content");

@ -13,7 +13,7 @@ import xyz.fycz.myreader.entity.SearchBookBean;
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.model.mulvalmap.ConMVMap;
import xyz.fycz.myreader.webapi.crawler.base.BaseReadCrawler;
@ -95,8 +95,8 @@ public class DSTQReadCrawler extends BaseReadCrawler {
* @param html
* @return
*/
public ConcurrentMultiValueMap<SearchBookBean, Book> getBooksFromSearchHtml(String html) {
ConcurrentMultiValueMap<SearchBookBean, Book> books = new ConcurrentMultiValueMap<>();
public ConMVMap<SearchBookBean, Book> getBooksFromSearchHtml(String html) {
ConMVMap<SearchBookBean, Book> books = new ConMVMap<>();
Document doc = Jsoup.parse(html);
try {
Element div = doc.getElementsByClass("library").first();

@ -12,7 +12,7 @@ import xyz.fycz.myreader.entity.SearchBookBean;
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.model.mulvalmap.ConMVMap;
import xyz.fycz.myreader.webapi.crawler.base.BaseReadCrawler;
import xyz.fycz.myreader.webapi.crawler.base.BookInfoCrawler;
@ -102,8 +102,8 @@ public class Du1DuReadCrawler extends BaseReadCrawler implements BookInfoCrawler
* @param html
* @return
*/
public ConcurrentMultiValueMap<SearchBookBean, Book> getBooksFromSearchHtml(String html) {
ConcurrentMultiValueMap<SearchBookBean, Book> books = new ConcurrentMultiValueMap<>();
public ConMVMap<SearchBookBean, Book> getBooksFromSearchHtml(String html) {
ConMVMap<SearchBookBean, Book> books = new ConMVMap<>();
Document doc = Jsoup.parse(html);
Elements divs = doc.getElementsByClass("panel-body");
Element div = divs.get(0);

@ -13,7 +13,7 @@ import xyz.fycz.myreader.entity.SearchBookBean;
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.model.mulvalmap.ConMVMap;
import xyz.fycz.myreader.util.StringHelper;
import xyz.fycz.myreader.webapi.crawler.base.BaseReadCrawler;
import xyz.fycz.myreader.webapi.crawler.base.BookInfoCrawler;
@ -110,8 +110,8 @@ public class EWenXueReadCrawler extends BaseReadCrawler implements BookInfoCrawl
* <div class="col-xs-2"><span class="time">2019-07-05 16:03</span></div>
* </li>
*/
public ConcurrentMultiValueMap<SearchBookBean, Book> getBooksFromSearchHtml(String html) {
ConcurrentMultiValueMap<SearchBookBean, Book> books = new ConcurrentMultiValueMap<>();
public ConMVMap<SearchBookBean, Book> getBooksFromSearchHtml(String html) {
ConMVMap<SearchBookBean, Book> books = new ConMVMap<>();
Document doc = Jsoup.parse(html);
Elements elements = doc.getElementsByClass("clearfix");
for (int i = 1; i < elements.size(); i++) {

@ -11,7 +11,7 @@ import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;
import xyz.fycz.myreader.model.mulvalmap.ConcurrentMultiValueMap;
import xyz.fycz.myreader.model.mulvalmap.ConMVMap;
import xyz.fycz.myreader.webapi.crawler.base.BaseReadCrawler;
import java.util.ArrayList;
@ -98,8 +98,8 @@ public class FYReadCrawler extends BaseReadCrawler {
* @param html
* @return
*/
public ConcurrentMultiValueMap<SearchBookBean, Book> getBooksFromSearchHtml(String html) {
ConcurrentMultiValueMap<SearchBookBean, Book> books = new ConcurrentMultiValueMap<>();
public ConMVMap<SearchBookBean, Book> getBooksFromSearchHtml(String html) {
ConMVMap<SearchBookBean, Book> books = new ConMVMap<>();
Document doc = Jsoup.parse(html);
Elements nodes = doc.getElementsByClass("secd-rank-list");
for (Element div : nodes) {

@ -14,7 +14,7 @@ import xyz.fycz.myreader.entity.SearchBookBean;
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.model.mulvalmap.ConMVMap;
import xyz.fycz.myreader.webapi.crawler.base.BaseReadCrawler;
@ -123,8 +123,8 @@ public class HongChenReadCrawler extends BaseReadCrawler {
</dl>
*/
@Deprecated
public ConcurrentMultiValueMap<SearchBookBean, Book> getBooksFromSearchHtml(String html) {
ConcurrentMultiValueMap<SearchBookBean, Book> books = new ConcurrentMultiValueMap<>();
public ConMVMap<SearchBookBean, Book> getBooksFromSearchHtml(String html) {
ConMVMap<SearchBookBean, Book> books = new ConMVMap<>();
Document doc = Jsoup.parse(html);
// try {
Element div = doc.getElementsByClass("s-b-list").first();

@ -11,7 +11,7 @@ import xyz.fycz.myreader.entity.SearchBookBean;
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.model.mulvalmap.ConMVMap;
import xyz.fycz.myreader.webapi.crawler.base.BaseReadCrawler;
import java.util.ArrayList;
@ -95,8 +95,8 @@ public class JiuTaoReadCrawler extends BaseReadCrawler {
* @param html
* @return
*/
public ConcurrentMultiValueMap<SearchBookBean, Book> getBooksFromSearchHtml(String html) {
ConcurrentMultiValueMap<SearchBookBean, Book> books = new ConcurrentMultiValueMap<>();
public ConMVMap<SearchBookBean, Book> getBooksFromSearchHtml(String html) {
ConMVMap<SearchBookBean, Book> books = new ConMVMap<>();
Document doc = Jsoup.parse(html);
// try {
Element div = doc.getElementsByClass("library").first();

@ -14,7 +14,7 @@ import xyz.fycz.myreader.entity.SearchBookBean;
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.model.mulvalmap.ConMVMap;
import xyz.fycz.myreader.webapi.crawler.base.BaseReadCrawler;
@Deprecated
@ -129,8 +129,8 @@ public class LaoYaoReadCrawler extends BaseReadCrawler {
</div>
</li>
*/
public ConcurrentMultiValueMap<SearchBookBean, Book> getBooksFromSearchHtml(String html) {
ConcurrentMultiValueMap<SearchBookBean, Book> books = new ConcurrentMultiValueMap<>();
public ConMVMap<SearchBookBean, Book> getBooksFromSearchHtml(String html) {
ConMVMap<SearchBookBean, Book> books = new ConMVMap<>();
Document doc = Jsoup.parse(html);
// try {
String urlType = doc.select("meta[property=og:type]").attr("content");

@ -15,7 +15,7 @@ import java.util.ArrayList;
import xyz.fycz.myreader.entity.SearchBookBean;
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.model.mulvalmap.ConMVMap;
import xyz.fycz.myreader.webapi.crawler.base.BaseReadCrawler;
/**
@ -70,8 +70,8 @@ public class LiuLangCatReadCrawler extends BaseReadCrawler {
</div></li>
* */
/*@Override
public ConcurrentMultiValueMap<SearchBookBean, Book> getBooksFromSearchHtml(String html) {
ConcurrentMultiValueMap<SearchBookBean, Book> books = new ConcurrentMultiValueMap<>();
public ConMVMap<SearchBookBean, Book> getBooksFromSearchHtml(String html) {
ConMVMap<SearchBookBean, Book> books = new ConMVMap<>();
Document doc = Jsoup.parse(html);
Element div = doc.getElementById("booklist");
Elements lis = div.getElementsByTag("li");
@ -103,8 +103,8 @@ public class LiuLangCatReadCrawler extends BaseReadCrawler {
* */
@Override
public ConcurrentMultiValueMap<SearchBookBean, Book> getBooksFromSearchHtml(String json) {
ConcurrentMultiValueMap<SearchBookBean, Book> books = new ConcurrentMultiValueMap<>();
public ConMVMap<SearchBookBean, Book> getBooksFromSearchHtml(String json) {
ConMVMap<SearchBookBean, Book> books = new ConMVMap<>();
try {
JSONArray array = new JSONArray(json);
for (int i = 0; i < array.length(); i++) {

@ -13,7 +13,7 @@ import xyz.fycz.myreader.entity.SearchBookBean;
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.model.mulvalmap.ConMVMap;
import xyz.fycz.myreader.util.StringHelper;
import xyz.fycz.myreader.webapi.crawler.base.BaseReadCrawler;
import xyz.fycz.myreader.webapi.crawler.base.BookInfoCrawler;
@ -111,8 +111,8 @@ public class LuoQiuReadCrawler extends BaseReadCrawler implements BookInfoCrawle
* <td class="even" align="center">连载</td>
* </tr>
*/
public ConcurrentMultiValueMap<SearchBookBean, Book> getBooksFromSearchHtml(String html) {
ConcurrentMultiValueMap<SearchBookBean, Book> books = new ConcurrentMultiValueMap<>();
public ConMVMap<SearchBookBean, Book> getBooksFromSearchHtml(String html) {
ConMVMap<SearchBookBean, Book> books = new ConMVMap<>();
Document doc = Jsoup.parse(html);
String urlType = doc.select("meta[property=og:type]").attr("content");
if ("novel".equals(urlType)) {

@ -11,7 +11,7 @@ import xyz.fycz.myreader.entity.SearchBookBean;
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.model.mulvalmap.ConMVMap;
import xyz.fycz.myreader.webapi.crawler.base.BaseReadCrawler;
import xyz.fycz.myreader.webapi.crawler.base.BookInfoCrawler;
@ -96,8 +96,8 @@ public class MiQuReadCrawler extends BaseReadCrawler implements BookInfoCrawler
* @param html
* @return
*/
public ConcurrentMultiValueMap<SearchBookBean, Book> getBooksFromSearchHtml(String html) {
ConcurrentMultiValueMap<SearchBookBean, Book> books = new ConcurrentMultiValueMap<>();
public ConMVMap<SearchBookBean, Book> getBooksFromSearchHtml(String html) {
ConMVMap<SearchBookBean, Book> books = new ConMVMap<>();
Document doc = Jsoup.parse(html);
Elements divs = doc.getElementsByClass("lastest");
Element div = divs.get(0);

@ -13,7 +13,7 @@ import xyz.fycz.myreader.entity.SearchBookBean;
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.model.mulvalmap.ConMVMap;
import xyz.fycz.myreader.webapi.crawler.base.BaseReadCrawler;
@ -95,8 +95,8 @@ public class MiaoBiReadCrawler extends BaseReadCrawler {
* @param html
* @return
*/
public ConcurrentMultiValueMap<SearchBookBean, Book> getBooksFromSearchHtml(String html) {
ConcurrentMultiValueMap<SearchBookBean, Book> books = new ConcurrentMultiValueMap<>();
public ConMVMap<SearchBookBean, Book> getBooksFromSearchHtml(String html) {
ConMVMap<SearchBookBean, Book> books = new ConMVMap<>();
Document doc = Jsoup.parse(html);
// try {
Element div = doc.getElementById("sitembox");

@ -13,7 +13,7 @@ import xyz.fycz.myreader.entity.SearchBookBean;
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.model.mulvalmap.ConMVMap;
import xyz.fycz.myreader.webapi.crawler.base.BaseReadCrawler;
import xyz.fycz.myreader.webapi.crawler.base.BookInfoCrawler;
@ -96,8 +96,8 @@ public class PiaoTianReadCrawler extends BaseReadCrawler implements BookInfoCraw
* @param html
* @return
*/
public ConcurrentMultiValueMap<SearchBookBean, Book> getBooksFromSearchHtml(String html) {
ConcurrentMultiValueMap<SearchBookBean, Book> books = new ConcurrentMultiValueMap<>();
public ConMVMap<SearchBookBean, Book> getBooksFromSearchHtml(String html) {
ConMVMap<SearchBookBean, Book> books = new ConMVMap<>();
Document doc = Jsoup.parse(html);
String urlType = doc.select("meta[property=og:type]").attr("content");
if ("novel".equals(urlType)) {

@ -10,7 +10,7 @@ import org.jsoup.select.Elements;
import xyz.fycz.myreader.entity.SearchBookBean;
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.model.mulvalmap.ConMVMap;
import xyz.fycz.myreader.util.StringHelper;
import xyz.fycz.myreader.webapi.crawler.base.BaseReadCrawler;
import xyz.fycz.myreader.webapi.crawler.base.BookInfoCrawler;
@ -108,8 +108,8 @@ public class PinShuReadCrawler extends BaseReadCrawler implements BookInfoCrawle
* @param html
* @return
*/
public ConcurrentMultiValueMap<SearchBookBean, Book> getBooksFromSearchHtml(String html) {
ConcurrentMultiValueMap<SearchBookBean, Book> books = new ConcurrentMultiValueMap<>();
public ConMVMap<SearchBookBean, Book> getBooksFromSearchHtml(String html) {
ConMVMap<SearchBookBean, Book> books = new ConMVMap<>();
Document doc = Jsoup.parse(html);
Element div = doc.getElementById("Content");
Elements elementsSelected = div.select("[id=CListTitle]");

@ -10,7 +10,7 @@ import org.jsoup.select.Elements;
import xyz.fycz.myreader.entity.SearchBookBean;
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.model.mulvalmap.ConMVMap;
import xyz.fycz.myreader.util.StringHelper;
import xyz.fycz.myreader.webapi.crawler.base.BaseReadCrawler;
import xyz.fycz.myreader.webapi.crawler.base.BookInfoCrawler;
@ -107,8 +107,8 @@ public class PinShuReadCrawler2 extends BaseReadCrawler implements BookInfoCrawl
* @param html
* @return
*/
public ConcurrentMultiValueMap<SearchBookBean, Book> getBooksFromSearchHtml(String html) {
ConcurrentMultiValueMap<SearchBookBean, Book> books = new ConcurrentMultiValueMap<>();
public ConMVMap<SearchBookBean, Book> getBooksFromSearchHtml(String html) {
ConMVMap<SearchBookBean, Book> books = new ConMVMap<>();
Document doc = Jsoup.parse(html);
Element div = doc.getElementsByClass("booklist").first();
Elements divs = div.getElementsByClass("clearfix");

@ -11,7 +11,7 @@ import xyz.fycz.myreader.entity.SearchBookBean;
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.model.mulvalmap.ConMVMap;
import xyz.fycz.myreader.webapi.crawler.base.BaseReadCrawler;
import xyz.fycz.myreader.webapi.crawler.base.BookInfoCrawler;
@ -90,8 +90,8 @@ public class QB5ReadCrawler extends BaseReadCrawler implements BookInfoCrawler {
* @param html
* @return
*/
public ConcurrentMultiValueMap<SearchBookBean, Book> getBooksFromSearchHtml(String html) {
final ConcurrentMultiValueMap<SearchBookBean, Book> books = new ConcurrentMultiValueMap<>();
public ConMVMap<SearchBookBean, Book> getBooksFromSearchHtml(String html) {
final ConMVMap<SearchBookBean, Book> books = new ConMVMap<>();
Document doc = Jsoup.parse(html);
String urlType = doc.select("meta[property=og:type]").attr("content");
if ("novel".equals(urlType)) {

@ -9,7 +9,7 @@ import org.jsoup.select.Elements;
import xyz.fycz.myreader.entity.SearchBookBean;
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.model.mulvalmap.ConMVMap;
import xyz.fycz.myreader.webapi.crawler.base.BaseReadCrawler;
import java.util.ArrayList;
@ -101,8 +101,8 @@ public class QiQiReadCrawler extends BaseReadCrawler {
* @param html
* @return
*/
public ConcurrentMultiValueMap<SearchBookBean, Book> getBooksFromSearchHtml(String html) {
ConcurrentMultiValueMap<SearchBookBean, Book> books = new ConcurrentMultiValueMap<>();
public ConMVMap<SearchBookBean, Book> getBooksFromSearchHtml(String html) {
ConMVMap<SearchBookBean, Book> books = new ConMVMap<>();
try {
Document doc = Jsoup.parse(html);
Elements divs = doc.getElementsByClass("result-list");

@ -13,7 +13,7 @@ import xyz.fycz.myreader.entity.SearchBookBean;
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.model.mulvalmap.ConMVMap;
import xyz.fycz.myreader.webapi.crawler.base.BaseReadCrawler;
@ -98,8 +98,8 @@ public class QianDianReadCrawler extends BaseReadCrawler {
* <a class="view" href="http://www.bjcan.com/book/74544.html" target="_blank">小说详情</a>
* </li>
*/
public ConcurrentMultiValueMap<SearchBookBean, Book> getBooksFromSearchHtml(String html) {
ConcurrentMultiValueMap<SearchBookBean, Book> books = new ConcurrentMultiValueMap<>();
public ConMVMap<SearchBookBean, Book> getBooksFromSearchHtml(String html) {
ConMVMap<SearchBookBean, Book> books = new ConMVMap<>();
Document doc = Jsoup.parse(html);
Element div = doc.getElementById("result-list");
Elements elementsByTag = div.getElementsByTag("li");

@ -10,7 +10,7 @@ import xyz.fycz.myreader.entity.SearchBookBean;
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.model.mulvalmap.ConMVMap;
import xyz.fycz.myreader.webapi.crawler.base.BaseReadCrawler;
import xyz.fycz.myreader.webapi.crawler.base.BookInfoCrawler;
@ -100,8 +100,8 @@ public class QuanNovelReadCrawler extends BaseReadCrawler implements BookInfoCra
* @param html
* @return
*/
public ConcurrentMultiValueMap<SearchBookBean, Book> getBooksFromSearchHtml(String html) {
ConcurrentMultiValueMap<SearchBookBean, Book> books = new ConcurrentMultiValueMap<>();
public ConMVMap<SearchBookBean, Book> getBooksFromSearchHtml(String html) {
ConMVMap<SearchBookBean, Book> books = new ConMVMap<>();
try {
Document doc = Jsoup.parse(html);
Elements divs = doc.getElementsByClass("main list");

@ -13,7 +13,7 @@ import java.util.Collections;
import xyz.fycz.myreader.entity.SearchBookBean;
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.model.mulvalmap.ConMVMap;
import xyz.fycz.myreader.webapi.crawler.base.BaseReadCrawler;
/**
@ -126,8 +126,8 @@ public class ReXueReadCrawler extends BaseReadCrawler {
</div>
</li>
*/
public ConcurrentMultiValueMap<SearchBookBean, Book> getBooksFromSearchHtml(String html) {
ConcurrentMultiValueMap<SearchBookBean, Book> books = new ConcurrentMultiValueMap<>();
public ConMVMap<SearchBookBean, Book> getBooksFromSearchHtml(String html) {
ConMVMap<SearchBookBean, Book> books = new ConMVMap<>();
Document doc = Jsoup.parse(html);
// try {
String urlType = doc.select("meta[property=og:type]").attr("content");

@ -14,7 +14,7 @@ import xyz.fycz.myreader.entity.SearchBookBean;
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.model.mulvalmap.ConMVMap;
import xyz.fycz.myreader.webapi.crawler.base.BaseReadCrawler;
@ -126,8 +126,8 @@ public class ShiGuangReadCrawler extends BaseReadCrawler {
</div>
</li>
*/
public ConcurrentMultiValueMap<SearchBookBean, Book> getBooksFromSearchHtml(String html) {
ConcurrentMultiValueMap<SearchBookBean, Book> books = new ConcurrentMultiValueMap<>();
public ConMVMap<SearchBookBean, Book> getBooksFromSearchHtml(String html) {
ConMVMap<SearchBookBean, Book> books = new ConMVMap<>();
Document doc = Jsoup.parse(html);
// try {
String urlType = doc.select("meta[property=og:type]").attr("content");

@ -16,7 +16,7 @@ import xyz.fycz.myreader.entity.SearchBookBean;
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.model.mulvalmap.ConMVMap;
import xyz.fycz.myreader.util.StringHelper;
import xyz.fycz.myreader.util.utils.OkHttpUtils;
import xyz.fycz.myreader.webapi.crawler.base.BaseReadCrawler;
@ -149,8 +149,8 @@ public class ShuHaiGeReadCrawler extends BaseReadCrawler implements BookInfoCraw
* <span class="s6">连载</span>
* </li>
*/
public ConcurrentMultiValueMap<SearchBookBean, Book> getBooksFromSearchHtml(String html) {
ConcurrentMultiValueMap<SearchBookBean, Book> books = new ConcurrentMultiValueMap<>();
public ConMVMap<SearchBookBean, Book> getBooksFromSearchHtml(String html) {
ConMVMap<SearchBookBean, Book> books = new ConMVMap<>();
Document doc = Jsoup.parse(html);
Element div = doc.getElementsByClass("novelslist2").first();
Elements elements = div.getElementsByTag("li");

@ -10,7 +10,7 @@ import xyz.fycz.myreader.entity.SearchBookBean;
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.model.mulvalmap.ConMVMap;
import xyz.fycz.myreader.webapi.crawler.base.BaseReadCrawler;
import xyz.fycz.myreader.webapi.crawler.base.BookInfoCrawler;
@ -112,8 +112,8 @@ public class SoNovelReadCrawler extends BaseReadCrawler implements BookInfoCrawl
* @param html
* @return
*/
public ConcurrentMultiValueMap<SearchBookBean, Book> getBooksFromSearchHtml(String html) {
ConcurrentMultiValueMap<SearchBookBean, Book> books = new ConcurrentMultiValueMap<>();
public ConMVMap<SearchBookBean, Book> getBooksFromSearchHtml(String html) {
ConMVMap<SearchBookBean, Book> books = new ConMVMap<>();
try {
Document doc = Jsoup.parse(html);
Elements divs = doc.getElementsByClass("novelslist2");

@ -11,7 +11,7 @@ import xyz.fycz.myreader.entity.SearchBookBean;
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.model.mulvalmap.ConMVMap;
import xyz.fycz.myreader.util.StringHelper;
import xyz.fycz.myreader.webapi.crawler.base.BaseReadCrawler;
@ -115,8 +115,8 @@ public class TianLaiReadCrawler extends BaseReadCrawler {
* @param html
* @return
*/
public ConcurrentMultiValueMap<SearchBookBean, Book> getBooksFromSearchHtml(String html) {
ConcurrentMultiValueMap<SearchBookBean, Book> books = new ConcurrentMultiValueMap<>();
public ConMVMap<SearchBookBean, Book> getBooksFromSearchHtml(String html) {
ConMVMap<SearchBookBean, Book> books = new ConMVMap<>();
Document doc = Jsoup.parse(html);
// Element node = doc.getElementById("results");
// for (Element div : node.children()) {

@ -13,7 +13,7 @@ import xyz.fycz.myreader.entity.SearchBookBean;
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.model.mulvalmap.ConMVMap;
import xyz.fycz.myreader.webapi.crawler.base.BaseReadCrawler;
@ -105,8 +105,8 @@ public class WoLongReadCrawler extends BaseReadCrawler {
* </ul>
* </div>
*/
public ConcurrentMultiValueMap<SearchBookBean, Book> getBooksFromSearchHtml(String html) {
ConcurrentMultiValueMap<SearchBookBean, Book> books = new ConcurrentMultiValueMap<>();
public ConMVMap<SearchBookBean, Book> getBooksFromSearchHtml(String html) {
ConMVMap<SearchBookBean, Book> books = new ConMVMap<>();
Document doc = Jsoup.parse(html);
Elements elementsByTag = doc.getElementsByClass("searchresult");
for (int i = 0; i < elementsByTag.size(); i++) {

@ -13,7 +13,7 @@ import xyz.fycz.myreader.entity.SearchBookBean;
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.model.mulvalmap.ConMVMap;
import xyz.fycz.myreader.webapi.crawler.base.BaseReadCrawler;
@ -115,8 +115,8 @@ public class XBiQuGeReadCrawler extends BaseReadCrawler {
* </div>
* </li>
*/
public ConcurrentMultiValueMap<SearchBookBean, Book> getBooksFromSearchHtml(String html) {
ConcurrentMultiValueMap<SearchBookBean, Book> books = new ConcurrentMultiValueMap<>();
public ConMVMap<SearchBookBean, Book> getBooksFromSearchHtml(String html) {
ConMVMap<SearchBookBean, Book> books = new ConMVMap<>();
Document doc = Jsoup.parse(html);
Elements divs = doc.getElementsByClass("rank_ullist");
Element div = divs.get(0);

@ -13,7 +13,7 @@ import xyz.fycz.myreader.entity.SearchBookBean;
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.model.mulvalmap.ConMVMap;
import xyz.fycz.myreader.webapi.crawler.base.BaseReadCrawler;
@ -96,8 +96,8 @@ public class XS7ReadCrawler extends BaseReadCrawler {
* @param html
* @return
*/
public ConcurrentMultiValueMap<SearchBookBean, Book> getBooksFromSearchHtml(String html) {
ConcurrentMultiValueMap<SearchBookBean, Book> books = new ConcurrentMultiValueMap<>();
public ConMVMap<SearchBookBean, Book> getBooksFromSearchHtml(String html) {
ConMVMap<SearchBookBean, Book> books = new ConMVMap<>();
Document doc = Jsoup.parse(html);
// try {
Element alist = doc.getElementById("alist");

@ -13,7 +13,7 @@ import xyz.fycz.myreader.entity.SearchBookBean;
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.model.mulvalmap.ConMVMap;
import xyz.fycz.myreader.util.StringHelper;
import xyz.fycz.myreader.webapi.crawler.base.BaseReadCrawler;
import xyz.fycz.myreader.webapi.crawler.base.BookInfoCrawler;
@ -111,8 +111,8 @@ public class XS7ReadCrawler2 extends BaseReadCrawler implements BookInfoCrawler
* <td class="even" align="center">连载</td>
* </tr>
*/
public ConcurrentMultiValueMap<SearchBookBean, Book> getBooksFromSearchHtml(String html) {
ConcurrentMultiValueMap<SearchBookBean, Book> books = new ConcurrentMultiValueMap<>();
public ConMVMap<SearchBookBean, Book> getBooksFromSearchHtml(String html) {
ConMVMap<SearchBookBean, Book> books = new ConMVMap<>();
Document doc = Jsoup.parse(html);
String urlType = doc.select("meta[property=og:type]").attr("content");
if ("novel".equals(urlType)) {

@ -14,7 +14,7 @@ import xyz.fycz.myreader.entity.SearchBookBean;
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.model.mulvalmap.ConMVMap;
import xyz.fycz.myreader.webapi.crawler.base.BaseReadCrawler;
@ -131,8 +131,8 @@ public class XiaGuReadCrawler extends BaseReadCrawler {
</li>
*/
@Deprecated
public ConcurrentMultiValueMap<SearchBookBean, Book> getBooksFromSearchHtml(String html) {
ConcurrentMultiValueMap<SearchBookBean, Book> books = new ConcurrentMultiValueMap<>();
public ConMVMap<SearchBookBean, Book> getBooksFromSearchHtml(String html) {
ConMVMap<SearchBookBean, Book> books = new ConMVMap<>();
Document doc = Jsoup.parse(html);
// try {
Element div = doc.getElementsByClass("subject-list").first();

@ -13,7 +13,7 @@ import xyz.fycz.myreader.entity.SearchBookBean;
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.model.mulvalmap.ConMVMap;
import xyz.fycz.myreader.webapi.crawler.base.BaseReadCrawler;
@ -123,8 +123,8 @@ public class XingXingReadCrawler extends BaseReadCrawler {
</li>
*/
@Deprecated
public ConcurrentMultiValueMap<SearchBookBean, Book> getBooksFromSearchHtml(String html) {
ConcurrentMultiValueMap<SearchBookBean, Book> books = new ConcurrentMultiValueMap<>();
public ConMVMap<SearchBookBean, Book> getBooksFromSearchHtml(String html) {
ConMVMap<SearchBookBean, Book> books = new ConMVMap<>();
Document doc = Jsoup.parse(html);
// try {
Element div = doc.getElementsByClass("leftBox").first();

@ -18,7 +18,7 @@ import xyz.fycz.myreader.entity.SearchBookBean;
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.model.mulvalmap.ConMVMap;
import xyz.fycz.myreader.util.utils.OkHttpUtils;
import xyz.fycz.myreader.util.utils.StringUtils;
import xyz.fycz.myreader.webapi.crawler.base.BaseReadCrawler;
@ -157,8 +157,8 @@ public class YanQingLouReadCrawler extends BaseReadCrawler {
* </div>
* </div>
*/
public ConcurrentMultiValueMap<SearchBookBean, Book> getBooksFromSearchHtml(String html) {
ConcurrentMultiValueMap<SearchBookBean, Book> books = new ConcurrentMultiValueMap<>();
public ConMVMap<SearchBookBean, Book> getBooksFromSearchHtml(String html) {
ConMVMap<SearchBookBean, Book> books = new ConMVMap<>();
Document doc = Jsoup.parse(html);
String bookName = doc.select("meta[property=og:novel:book_name]").attr("content");
if ("".equals(bookName)) {

@ -10,7 +10,7 @@ import xyz.fycz.myreader.entity.SearchBookBean;
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.model.mulvalmap.ConMVMap;
import xyz.fycz.myreader.webapi.crawler.base.BaseReadCrawler;
import xyz.fycz.myreader.webapi.crawler.base.BookInfoCrawler;
@ -104,8 +104,8 @@ public class YunZhongReadCrawler extends BaseReadCrawler implements BookInfoCraw
* @param html
* @return
*/
public ConcurrentMultiValueMap<SearchBookBean, Book> getBooksFromSearchHtml(String html) {
ConcurrentMultiValueMap<SearchBookBean, Book> books = new ConcurrentMultiValueMap<>();
public ConMVMap<SearchBookBean, Book> getBooksFromSearchHtml(String html) {
ConMVMap<SearchBookBean, Book> books = new ConMVMap<>();
// try {
Document doc = Jsoup.parse(html);
Elements divs = doc.getElementsByClass("ul_b_list");

@ -13,7 +13,7 @@ import xyz.fycz.myreader.entity.SearchBookBean;
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.model.mulvalmap.ConMVMap;
import xyz.fycz.myreader.util.StringHelper;
import xyz.fycz.myreader.webapi.crawler.base.BaseReadCrawler;
import xyz.fycz.myreader.webapi.crawler.base.BookInfoCrawler;
@ -101,8 +101,8 @@ public class ZW37ReadCrawler extends BaseReadCrawler implements BookInfoCrawler
* <td class="even" align="center">连载</td>
* </tr>
*/
public ConcurrentMultiValueMap<SearchBookBean, Book> getBooksFromSearchHtml(String html) {
final ConcurrentMultiValueMap<SearchBookBean, Book> books = new ConcurrentMultiValueMap<>();
public ConMVMap<SearchBookBean, Book> getBooksFromSearchHtml(String html) {
final ConMVMap<SearchBookBean, Book> books = new ConMVMap<>();
Document doc = Jsoup.parse(html);
String urlType = doc.select("meta[property=og:type]").attr("content");
if ("novel".equals(urlType)) {

@ -13,7 +13,7 @@ import xyz.fycz.myreader.entity.SearchBookBean;
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.model.mulvalmap.ConMVMap;
import xyz.fycz.myreader.webapi.crawler.base.BaseReadCrawler;
@ -101,8 +101,8 @@ public class ZaiShuYuanReadCrawler extends BaseReadCrawler {
* <dd class="book_other">最新章节<a href="/chapter/3/8855386">第一千五百五十一章 邪神陨落大结局</a> 更新时间<span>2020-2-26 13:26:49</span></dd>
* </dl>
*/
public ConcurrentMultiValueMap<SearchBookBean, Book> getBooksFromSearchHtml(String html) {
ConcurrentMultiValueMap<SearchBookBean, Book> books = new ConcurrentMultiValueMap<>();
public ConMVMap<SearchBookBean, Book> getBooksFromSearchHtml(String html) {
ConMVMap<SearchBookBean, Book> books = new ConMVMap<>();
Document doc = Jsoup.parse(html);
String urlType = doc.select("meta[property=og:type]").attr("content");
if ("novel".equals(urlType)) {

@ -11,7 +11,7 @@ import xyz.fycz.myreader.entity.SearchBookBean;
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.model.mulvalmap.ConMVMap;
import xyz.fycz.myreader.webapi.crawler.base.BaseReadCrawler;
import xyz.fycz.myreader.webapi.crawler.base.BookInfoCrawler;
@ -95,8 +95,8 @@ public class ZuoPinReadCrawler extends BaseReadCrawler implements BookInfoCrawle
* @param html
* @return
*/
public ConcurrentMultiValueMap<SearchBookBean, Book> getBooksFromSearchHtml(String html) {
ConcurrentMultiValueMap<SearchBookBean, Book> books = new ConcurrentMultiValueMap<>();
public ConMVMap<SearchBookBean, Book> getBooksFromSearchHtml(String html) {
ConMVMap<SearchBookBean, Book> books = new ConMVMap<>();
Document doc = Jsoup.parse(html);
Element div = doc.getElementById("J_TableContainer");
Elements elementsByClass = div.getElementsByClass("search-bookele");

@ -11,7 +11,7 @@ import xyz.fycz.myreader.greendao.entity.Book;
import xyz.fycz.myreader.greendao.entity.Chapter;
import xyz.fycz.myreader.greendao.entity.rule.BookSource;
import xyz.fycz.myreader.greendao.entity.rule.SearchRule;
import xyz.fycz.myreader.model.mulvalmap.ConcurrentMultiValueMap;
import xyz.fycz.myreader.model.mulvalmap.ConMVMap;
import xyz.fycz.myreader.model.sourceAnalyzer.JsonPathAnalyzer;
import xyz.fycz.myreader.util.StringHelper;
import xyz.fycz.myreader.webapi.crawler.base.BaseSourceCrawler;
@ -30,8 +30,8 @@ public class JsonPathCrawler extends BaseSourceCrawler {
}
@Override
public ConcurrentMultiValueMap<SearchBookBean, Book> getBooksFromSearchHtml(String json) {
ConcurrentMultiValueMap<SearchBookBean, Book> books = new ConcurrentMultiValueMap<>();
public ConMVMap<SearchBookBean, Book> getBooksFromSearchHtml(String json) {
ConMVMap<SearchBookBean, Book> books = new ConMVMap<>();
ReadContext rc = analyzer.getReadContext(json);
SearchRule searchRule = source.getSearchRule();
if (StringHelper.isEmpty(searchRule.getList())) {

@ -7,7 +7,7 @@ import xyz.fycz.myreader.entity.SearchBookBean;
import xyz.fycz.myreader.greendao.entity.Book;
import xyz.fycz.myreader.greendao.entity.Chapter;
import xyz.fycz.myreader.greendao.entity.rule.BookSource;
import xyz.fycz.myreader.model.mulvalmap.ConcurrentMultiValueMap;
import xyz.fycz.myreader.model.mulvalmap.ConMVMap;
import xyz.fycz.myreader.model.sourceAnalyzer.MatcherAnalyzer;
import xyz.fycz.myreader.util.StringHelper;
import xyz.fycz.myreader.util.utils.NetworkUtils;
@ -27,8 +27,8 @@ public class MatcherCrawler extends BaseSourceCrawler {
}
@Override
public ConcurrentMultiValueMap<SearchBookBean, Book> getBooksFromSearchHtml(String html) {
ConcurrentMultiValueMap<SearchBookBean, Book> books = new ConcurrentMultiValueMap<>();
public ConMVMap<SearchBookBean, Book> getBooksFromSearchHtml(String html) {
ConMVMap<SearchBookBean, Book> books = new ConMVMap<>();
String list = analyzer.getString(source.getSearchRule().getList(), html);
if (StringHelper.isEmpty(list)) list = html;
List<String> names = analyzer.getStringList(source.getSearchRule().getName(), list);

@ -6,7 +6,8 @@ import java.util.Map;
import xyz.fycz.myreader.entity.SearchBookBean;
import xyz.fycz.myreader.greendao.entity.Book;
import xyz.fycz.myreader.greendao.entity.rule.BookSource;
import xyz.fycz.myreader.model.mulvalmap.ConcurrentMultiValueMap;
import xyz.fycz.myreader.model.mulvalmap.ConMVMap;
import xyz.fycz.myreader.util.StringHelper;
import xyz.fycz.myreader.webapi.crawler.base.BaseReadCrawler;
import xyz.fycz.myreader.webapi.crawler.base.BookInfoCrawler;
@ -60,9 +61,10 @@ public class ThirdCrawler extends BaseReadCrawler implements BookInfoCrawler {
return null;
}
public ConcurrentMultiValueMap<SearchBookBean, Book> getBooks(List<Book> books) {
ConcurrentMultiValueMap<SearchBookBean, Book> newBooks = new ConcurrentMultiValueMap<>();
public ConMVMap<SearchBookBean, Book> getBooks(List<Book> books) {
ConMVMap<SearchBookBean, Book> newBooks = new ConMVMap<>();
for (Book book : books){
if (book == null || StringHelper.isEmpty(book.getName())) continue;
book.setSource(source.getSourceUrl());
SearchBookBean sbb = new SearchBookBean(book.getName(), book.getAuthor());
newBooks.add(sbb, book);

@ -10,7 +10,7 @@ import xyz.fycz.myreader.greendao.entity.Book;
import xyz.fycz.myreader.greendao.entity.Chapter;
import xyz.fycz.myreader.greendao.entity.rule.BookSource;
import xyz.fycz.myreader.greendao.entity.rule.SearchRule;
import xyz.fycz.myreader.model.mulvalmap.ConcurrentMultiValueMap;
import xyz.fycz.myreader.model.mulvalmap.ConMVMap;
import xyz.fycz.myreader.model.sourceAnalyzer.XpathAnalyzer;
import xyz.fycz.myreader.util.StringHelper;
import xyz.fycz.myreader.webapi.crawler.base.BaseSourceCrawler;
@ -28,8 +28,8 @@ public class XpathCrawler extends BaseSourceCrawler {
}
@Override
public ConcurrentMultiValueMap<SearchBookBean, Book> getBooksFromSearchHtml(String html) {
ConcurrentMultiValueMap<SearchBookBean, Book> books = new ConcurrentMultiValueMap<>();
public ConMVMap<SearchBookBean, Book> getBooksFromSearchHtml(String html) {
ConMVMap<SearchBookBean, Book> books = new ConMVMap<>();
JXDocument jxDoc = JXDocument.create(html);
SearchRule searchRule = source.getSearchRule();
if (StringHelper.isEmpty(searchRule.getList())) {

Loading…
Cancel
Save