微侠网/ 网络工具 / 网络辅助 / 三木猿阅读(电脑小说漫画阅读器)
三木猿阅读(电脑小说漫画阅读器)
500KB
网络辅助
2020-09-10 15:48:43
点击下载
截图组
三木猿阅读(电脑小说漫画阅读器)在线介绍

微侠小编为各位小伙伴们带来了最新的三木猿阅读(电脑小说漫画阅读器),你可以使用这款软件在电脑上免费浏览全网小说资源,支持分类搜索,支持智能书签,支持离线下载。而且不需要注册成为会员,就可以在电脑上轻松体验阅读小说的乐趣!心动了就别错过咯,赶紧前来微侠网下载最新版体验吧。

三木猿阅读器功能

在线小说资源阅读

离线下载功能

搜索框

多数据源筛选

三木猿阅读器使用

解压后打开exe文件,到浏览器输入http://localhost/,即可开始阅读,数据源有两个biquge和biquge5200,页面借用了起点。

部分代码一览

package com.aaa.data;

import com.aaa.config.SSLHelper;

import com.aaa.dto.BookCatalogueDto;

import com.aaa.entity.BookCatalogue;

import org.jsoup.Jsoup;

import org.jsoup.nodes.Document;

import org.jsoup.nodes.Element;

import org.jsoup.nodes.Node;

import org.jsoup.select.Elements;

import java.io.IOException;

import java.util.ArrayList;

import java.util.HashMap;

import java.util.List;

import java.util.Map;

import java.util.concurrent.*;

import java.util.regex.Matcher;

import java.util.regex.Pattern;

import static com.aaa.util.DataProcessing.splitList;

/**

* [url=home.php?mod=space&uid=686208]@AuThor[/url] 杨森

* [url=home.php?mod=space&uid=1248337]@version[/url] 1.0

* @Title: BookCatalogue

* [url=home.php?mod=space&uid=686237]@date[/url] 2020/8/7 15:39

*/

public class BookCatalogueDB {

private static ExecutorService executorService;

public static ListsetDataSource(String dataSource, String bookCod,ExecutorService executorService) {

BookCatalogueDB.executorService =executorService;

SSLHelper.init();

if ("biquge5200".equals(dataSource)) {

return biquge5200(bookCod);

} else if ("biquge".equals(dataSource)) {

return biquge(bookCod);

}

return null;

}

private static Listbiquge5200(String bookCod) {

try {

Map<Integer,List> bookCatalogueDtoMaps = new HashMap<>(3);

Pattern pattern = Pattern.compile("]>([\s\S]*?)(?=)");

Document document = Jsoup.connect("https://www.biquge5200.com/" + bookCod + "/").get();

Elements dd = document.getElementsByTag("dd");

Map<Integer, List> integerListMap = splitList(dd, 3);

CountDownLatch latch=new CountDownLatch(3);

for (int i = 0; i < 3; i++) {

final int ins=i;

executorService.execute(() -> {

bookCatalogueDtoMaps.put(ins,get(integerListMap.get(ins), bookCod, document, pattern));

latch.countDown();

});

}

latch.await();

ListbookCatalogueDtos=new ArrayList<>(dd.size());

for (int i = 0; i < 3; i++) {

bookCatalogueDtos.addAll(bookCatalogueDtoMaps.get(i));

}

return bookCatalogueDtos;

} catch (IOException e) {

e.printStackTrace();

} catch (InterruptedException e) {

e.printStackTrace();

}finally {

executorService.shutdown();

}

return null;

}

public static Listget(Listdd, String bookCod, Document document, Pattern pattern) {

ListbookCatalogueDtos = new ArrayList<>(dd.size());

Element imgurl = document.getElementById("fmimg");

Element intro = document.getElementById("intro");

Element info = document.getElementById("info");

Element child = info.child(1);

String h1 = info.select("h1").text();

for (int i = 0; i < dd.size(); i++) {

Element element = dd.get(i);

BookCatalogueDto bookCatalogueDto = new BookCatalogueDto();

BookCatalogue bookCatalogue = new BookCatalogue();

Node node = element.childNode(0);

for (Node e : element.childNodes()) {

if (!"".equals(e.toString())) {

node = e;

}

}

bookCatalogueDto.setCatalogueName(node.childNode(0).toString());

String s1 = node.toString();

Matcher matcher = pattern.matcher(s1);

if (matcher.find()) {

String nameCodeUrl = matcher.group(1);

String insStr = nameCodeUrl.substring(nameCodeUrl.lastIndexOf("/") + 1, nameCodeUrl.lastIndexOf("."));

bookCatalogueDto.setCatalogueCod(Integer.parseInt(insStr));

}

bookCatalogueDto.setBookName(h1);

bookCatalogueDto.setBookIntro(intro.text());

for(Node n :imgurl.childNodes()){

if(n.toString().matches("(.*)img(.*)")){

bookCatalogueDto.setBookImage(imgurl.childNode(0).toString());

}

}

bookCatalogueDto.setBookCod(bookCod);

bookCatalogueDto.setBookAuthor(child.text().replace("作 者:",""));

bookCatalogueDtos.add(bookCatalogueDto);

if (i + 1 < dd.size()) {

Node node1 = dd.get(i + 1).childNode(0);

Matcher matcher1 = pattern.matcher(node1.toString());

if (matcher1.find()) {

String nameCodeUrl = matcher.group(1);

String insStr = nameCodeUrl.substring(nameCodeUrl.lastIndexOf("/") + 1, nameCodeUrl.lastIndexOf("."));

bookCatalogue.setNextCode(Integer.parseInt(insStr));

}

}

}

return bookCatalogueDtos;

}

private static Listbiquge(String bookCod) {

try {

Pattern pattern = Pattern.compile("]>([\s\S]*?)(?=)");

Document document = Jsoup.connect("https://www.biquge.com/" + bookCod + "/").get();

Map<Integer,List> bookCatalogueDtoMaps = new HashMap<>(3);

Elements dd = document.getElementsByTag("dd");

Map<Integer, List> integerListMap = splitList(dd, 3);

CountDownLatch latch=new CountDownLatch(3);

for (int i = 0; i<3; i++) {

final int ins=i;

executorService.execute(()->{

bookCatalogueDtoMaps.put(ins,get(integerListMap.get(ins), bookCod, document, pattern)) ;

latch.countDown();

});

}

latch.await();

ListbookCatalogueDtos=new ArrayList<>(dd.size());

for (int i = 0; i < 3; i++) {

bookCatalogueDtos.addAll(bookCatalogueDtoMaps.get(i));

}

return bookCatalogueDtos;

} catch (Exception e) {

e.printStackTrace();

}finally {

executorService.shutdown();

}

return null;

}

}

相关软件
猜你喜欢
最新资讯
热门下载