From 5e0c1e65d8eaee4840421826de995dc390c4fc91 Mon Sep 17 00:00:00 2001 From: Fan Yang Date: Thu, 10 Jan 2019 12:37:59 +0800 Subject: [PATCH] (*)support www.kanshula.com --- biquge.go | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/biquge.go b/biquge.go index d6ded7b..fa509c3 100644 --- a/biquge.go +++ b/biquge.go @@ -196,6 +196,31 @@ func init() { }, }) + registerNovelSiteHandler(&novelSiteHandler{ + Title: `看书啦`, + MatchPatterns: []string{`https://www\.kanshula\.com/book/[0-9a-zA-Z]+/`}, + Download: func(u string, gen ebook.IBook) { + tocPatterns := []tocPattern{ + { + host: "www.kanshula.com", + bookTitle: `

([^<]+)

$`, + bookTitlePos: 1, + item: `
\s*([^<]+)
$`, + articleURLPos: 1, + articleTitlePos: 3, + isAbsoluteURL: true, + }, + } + pageContentMarkers := []pageContentMarker{ + { + host: "www.kanshula.com", + start: []byte(`
`), + end: []byte(`
`), + }, + } + dl(u, gen, tocPatterns, pageContentMarkers) + }, + }) registerNovelSiteHandler(&novelSiteHandler{ Title: `少年文学网`, MatchPatterns: []string{`https://www\.snwx8\.com/book/[0-9]+/[0-9]+/`},