mirror of
https://github.com/201206030/novel.git
synced 2025-04-27 07:30:50 +00:00
v2.0.3发布
This commit is contained in:
parent
dc707a49ed
commit
cdf1d0c084
@ -161,15 +161,15 @@ novel-admin :平台后台管理系统源码(独立项目,按需安装)
|
|||||||
|
|
||||||
**演示地址2**
|
**演示地址2**
|
||||||
|
|
||||||
[点击前往](https://book.100boot.cn/)(前台,推荐)(未上线漫画专区功能)
|
[点击前往](https://book.100boot.cn/)(前台)
|
||||||
|
|
||||||
**演示地址3**
|
**演示地址3**
|
||||||
|
|
||||||
[点击前往](http://www.jsy66.vip/)(未上线漫画专区功能)
|
[点击前往](http://www.jsy66.vip/)(前台)
|
||||||
|
|
||||||
##### 演示地址4(备用)
|
##### 演示地址4(备用)
|
||||||
|
|
||||||
[点击前往](http://47.106.243.172:8888)(前台)(已上线漫画专区)
|
[点击前往](http://47.106.243.172:8888)(前台)
|
||||||
|
|
||||||
[点击前往 ](http://47.106.243.172:8888) (后台) (**后台爬虫程序运行会占用大量服务器资源,试用人数过多,服务器压力大,现暂停演示** )
|
[点击前往 ](http://47.106.243.172:8888) (后台) (**后台爬虫程序运行会占用大量服务器资源,试用人数过多,服务器压力大,现暂停演示** )
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
</parent>
|
</parent>
|
||||||
<groupId>xyz.zinglizingli</groupId>
|
<groupId>xyz.zinglizingli</groupId>
|
||||||
<artifactId>novel-front</artifactId>
|
<artifactId>novel-front</artifactId>
|
||||||
<version>2.0.2.beta</version>
|
<version>2.0.3.beta</version>
|
||||||
<name>novel-front</name>
|
<name>novel-front</name>
|
||||||
<description>小说精品楼-前台web网站</description>
|
<description>小说精品楼-前台web网站</description>
|
||||||
|
|
||||||
|
@ -102,8 +102,8 @@ public class SearchFilter implements Filter {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
OutputStream out = resp.getOutputStream();
|
|
||||||
if(requestURI.contains("/localPic/")){
|
if(requestURI.contains("/localPic/")){
|
||||||
|
OutputStream out = resp.getOutputStream();
|
||||||
InputStream input = new FileInputStream(new File(picSavePath+requestURI));
|
InputStream input = new FileInputStream(new File(picSavePath+requestURI));
|
||||||
byte[] b = new byte[4096];
|
byte[] b = new byte[4096];
|
||||||
for (int n; (n = input.read(b)) != -1;) {
|
for (int n; (n = input.read(b)) != -1;) {
|
||||||
@ -193,6 +193,7 @@ public class SearchFilter implements Filter {
|
|||||||
String realUrl = "https://images.dmzj.com/" + requestURI.substring(15);
|
String realUrl = "https://images.dmzj.com/" + requestURI.substring(15);
|
||||||
ResponseEntity<Resource> resEntity = restTemplate.exchange(realUrl, HttpMethod.GET, requestEntity, Resource.class);
|
ResponseEntity<Resource> resEntity = restTemplate.exchange(realUrl, HttpMethod.GET, requestEntity, Resource.class);
|
||||||
InputStream input = resEntity.getBody().getInputStream();
|
InputStream input = resEntity.getBody().getInputStream();
|
||||||
|
OutputStream out = resp.getOutputStream();
|
||||||
byte[] b = new byte[4096];
|
byte[] b = new byte[4096];
|
||||||
for (int n; (n = input.read(b)) != -1;) {
|
for (int n; (n = input.read(b)) != -1;) {
|
||||||
out.write(b, 0, n);
|
out.write(b, 0, n);
|
||||||
|
@ -38,7 +38,9 @@ public class CrawlBooksSchedule {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private BookService bookService;
|
private BookService bookService;
|
||||||
|
|
||||||
RestTemplate restTemplate = RestTemplateUtil.getInstance("utf-8");
|
RestTemplate utf8RestTemplate = RestTemplateUtil.getInstance("utf-8");
|
||||||
|
|
||||||
|
RestTemplate isoRestTemplate = RestTemplateUtil.getInstance("iso-8859-1");
|
||||||
|
|
||||||
@Value("${books.lowestScore}")
|
@Value("${books.lowestScore}")
|
||||||
private Float lowestScore;
|
private Float lowestScore;
|
||||||
@ -166,10 +168,9 @@ public class CrawlBooksSchedule {
|
|||||||
String picSrc = picMather.group(1);
|
String picSrc = picMather.group(1);
|
||||||
|
|
||||||
if(picSaveType == 2 && StringUtils.isNotBlank(picSrc)){
|
if(picSaveType == 2 && StringUtils.isNotBlank(picSrc)){
|
||||||
restTemplate = RestTemplateUtil.getInstance("iso-8859-1");
|
|
||||||
HttpHeaders headers = new HttpHeaders();
|
HttpHeaders headers = new HttpHeaders();
|
||||||
HttpEntity<String> requestEntity = new HttpEntity<>(null, headers);
|
HttpEntity<String> requestEntity = new HttpEntity<>(null, headers);
|
||||||
ResponseEntity<Resource> resEntity = restTemplate.exchange(picSrc, HttpMethod.GET, requestEntity, Resource.class);
|
ResponseEntity<Resource> resEntity = isoRestTemplate.exchange(picSrc, HttpMethod.GET, requestEntity, Resource.class);
|
||||||
InputStream input = resEntity.getBody().getInputStream();
|
InputStream input = resEntity.getBody().getInputStream();
|
||||||
picSrc = "/localPic/" + updateTimeStr.substring(0,4)+"/"+updateTimeStr.substring(5,7)+"/"+updateTimeStr.substring(8,10)
|
picSrc = "/localPic/" + updateTimeStr.substring(0,4)+"/"+updateTimeStr.substring(5,7)+"/"+updateTimeStr.substring(8,10)
|
||||||
+ UUIDUtils.getUUID32()
|
+ UUIDUtils.getUUID32()
|
||||||
@ -528,11 +529,10 @@ public class CrawlBooksSchedule {
|
|||||||
String picSrc = picMather.group(1);
|
String picSrc = picMather.group(1);
|
||||||
|
|
||||||
if(picSaveType == 2 && StringUtils.isNotBlank(picSrc)){
|
if(picSaveType == 2 && StringUtils.isNotBlank(picSrc)){
|
||||||
restTemplate = RestTemplateUtil.getInstance("iso-8859-1");
|
|
||||||
HttpHeaders headers = new HttpHeaders();
|
HttpHeaders headers = new HttpHeaders();
|
||||||
headers.add("Referer","https://www.biqudao.com");
|
headers.add("Referer","https://www.biqudao.com");
|
||||||
HttpEntity<String> requestEntity = new HttpEntity<>(null, headers);
|
HttpEntity<String> requestEntity = new HttpEntity<>(null, headers);
|
||||||
ResponseEntity<Resource> resEntity = restTemplate.exchange(picSrc, HttpMethod.GET, requestEntity, Resource.class);
|
ResponseEntity<Resource> resEntity = isoRestTemplate.exchange(picSrc, HttpMethod.GET, requestEntity, Resource.class);
|
||||||
InputStream input = resEntity.getBody().getInputStream();
|
InputStream input = resEntity.getBody().getInputStream();
|
||||||
picSrc = "/localPic/" + updateTimeStr.substring(0,2)+"/"+updateTimeStr.substring(3,5)+"/"+updateTimeStr.substring(6,8)
|
picSrc = "/localPic/" + updateTimeStr.substring(0,2)+"/"+updateTimeStr.substring(3,5)+"/"+updateTimeStr.substring(6,8)
|
||||||
+ UUIDUtils.getUUID32()
|
+ UUIDUtils.getUUID32()
|
||||||
@ -670,7 +670,7 @@ public class CrawlBooksSchedule {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private String getByHttpClient(String catBookListUrl) {
|
private String getByHttpClient(String url) {
|
||||||
try {
|
try {
|
||||||
/* HttpClient httpClient = new DefaultHttpClient();
|
/* HttpClient httpClient = new DefaultHttpClient();
|
||||||
HttpGet getReq = new HttpGet(catBookListUrl);
|
HttpGet getReq = new HttpGet(catBookListUrl);
|
||||||
@ -683,7 +683,7 @@ public class CrawlBooksSchedule {
|
|||||||
return null;
|
return null;
|
||||||
}*/
|
}*/
|
||||||
//经测试restTemplate比httpClient效率高出很多倍,所有选择restTemplate
|
//经测试restTemplate比httpClient效率高出很多倍,所有选择restTemplate
|
||||||
ResponseEntity<String> forEntity = restTemplate.getForEntity(catBookListUrl, String.class);
|
ResponseEntity<String> forEntity = utf8RestTemplate.getForEntity(url, String.class);
|
||||||
if (forEntity.getStatusCode() == HttpStatus.OK) {
|
if (forEntity.getStatusCode() == HttpStatus.OK) {
|
||||||
return forEntity.getBody();
|
return forEntity.getBody();
|
||||||
} else {
|
} else {
|
||||||
|
@ -4,8 +4,8 @@ server:
|
|||||||
spring:
|
spring:
|
||||||
datasource:
|
datasource:
|
||||||
url: jdbc:mysql://127.0.0.1:3306/books?useUnicode=true&characterEncoding=utf-8&useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
|
url: jdbc:mysql://127.0.0.1:3306/books?useUnicode=true&characterEncoding=utf-8&useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
|
||||||
username: root
|
username: books
|
||||||
password: test123456
|
password: books
|
||||||
# url: jdbc:mysql://127.0.0.1:3306/books?useUnicode=true&characterEncoding=utf8&useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
|
# url: jdbc:mysql://127.0.0.1:3306/books?useUnicode=true&characterEncoding=utf8&useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
|
||||||
# username: root
|
# username: root
|
||||||
# password: test123456
|
# password: test123456
|
||||||
@ -77,7 +77,7 @@ crawl:
|
|||||||
pic:
|
pic:
|
||||||
save:
|
save:
|
||||||
type: 1 #图片保存方式, 1不保存,使用网络图片 ,2本地保存
|
type: 1 #图片保存方式, 1不保存,使用网络图片 ,2本地保存
|
||||||
path: d:/pic #图片保存路径
|
path: /var/pic #图片保存路径
|
||||||
|
|
||||||
|
|
||||||
search:
|
search:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user