Skip to content

Commit

Permalink
更新书源 url
Browse files Browse the repository at this point in the history
  • Loading branch information
pcdd committed Apr 12, 2024
1 parent 356049f commit 0ee90a6
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 12 deletions.
4 changes: 0 additions & 4 deletions src/main/java/com/pcdd/sonovel/parse/CatalogParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,4 @@ public List<Chapter> parse(String url, int start, int end) {
return catalog;
}

public static void main(String[] args) {
new CatalogParser(1).parse("https://www.xbiqugu.info/66/66747/", 1, 50);
}

}
2 changes: 1 addition & 1 deletion src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ version=@version@
# 书源 1
source_id=1
# 某书源 url
index_url=https://www.xbiqugu.info
index_url=http://www.xbiqugu.net
8 changes: 4 additions & 4 deletions src/main/resources/rule/rule1.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"id": "1",
"url": "https://www.xbiqugu.info",
"url": "http://www.xbiqugu.net",
"comment": "",
"book": {
"url": "https://www.xbiqugu.info/0/%s/",
"url": "http://www.xbiqugu.net/0/%s/",
"bookName": "//*[@id=\"info\"]/h1",
"author": "/html/head/meta[13]",
"description": "//*[@id=\"intro\"]/p[2]",
Expand All @@ -15,13 +15,13 @@
"catalog": "//*[@id=\"list\"]/dl/dd/a"
},
"chapter": {
"url": "https://www.xbiqugu.info/0/%s/%s.html",
"url": "http://www.xbiqugu.net/0/%s/%s.html",
"chapterNo": 0,
"title": "",
"content": "//*[@id=\"content\"]"
},
"search": {
"url": "https://www.xbiqugu.info/modules/article/waps.php",
"url": "http://www.xbiqugu.net/modules/article/waps.php",
"method": "post",
"param": {
"searchkey": ""
Expand Down
6 changes: 3 additions & 3 deletions src/test/java/com/pcdd/sonovel/CrawlTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class CrawlTest {
@DisplayName("解析搜索结果页")
@SneakyThrows
void test01() {
Connection connect = Jsoup.connect("https://www.xbiqugu.info/modules/article/waps.php");
Connection connect = Jsoup.connect("http://www.xbiqugu.net/modules/article/waps.php");
// 搜索结果页DOM
Document document = connect.data("searchkey", "斗罗大陆").post();
Elements elements = document.selectXpath("//*[@id=\"checkform\"]/table/tbody/tr");
Expand All @@ -49,7 +49,7 @@ void test01() {
@DisplayName("爬取章节并下载")
@SneakyThrows
void test02() {
Document document = Jsoup.parse(new URL("https://www.xbiqugu.info/116/116314/43917573.html"), 30_000);
Document document = Jsoup.parse(new URL("http://www.xbiqugu.net/116/116314/43917573.html"), 30_000);
String title = document.selectXpath("//*[@class='bookname']/h1").text();
System.out.println(title);
String content = document.getElementById("content").html();
Expand All @@ -64,7 +64,7 @@ void test02() {
}
}

// @Test
@Test
@DisplayName("目录排序")
void test03() {
File dir = FileUtil.file("D:\\Code\\IdeaProjects\\so-novel\\download\\斗罗大陆(唐家三少)");
Expand Down

0 comments on commit 0ee90a6

Please sign in to comment.