|
|
|
@ -177,9 +177,7 @@ object BookChapterList { |
|
|
|
|
val vipRule = analyzeRule.splitSourceRule(tocRule.isVip) |
|
|
|
|
val payRule = analyzeRule.splitSourceRule(tocRule.isPay) |
|
|
|
|
val upTimeRule = analyzeRule.splitSourceRule(tocRule.updateTime) |
|
|
|
|
var isVip: String? |
|
|
|
|
var isPay: String? |
|
|
|
|
for (item in elements) { |
|
|
|
|
elements.forEachIndexed { index, item -> |
|
|
|
|
scope.ensureActive() |
|
|
|
|
analyzeRule.setContent(item) |
|
|
|
|
val bookChapter = BookChapter(bookUrl = book.bookUrl, baseUrl = baseUrl) |
|
|
|
@ -187,13 +185,13 @@ object BookChapterList { |
|
|
|
|
bookChapter.title = analyzeRule.getString(nameRule) |
|
|
|
|
bookChapter.url = analyzeRule.getString(urlRule) |
|
|
|
|
bookChapter.tag = analyzeRule.getString(upTimeRule) |
|
|
|
|
isVip = analyzeRule.getString(vipRule) |
|
|
|
|
isPay = analyzeRule.getString(payRule) |
|
|
|
|
if (bookChapter.url.isEmpty()) { |
|
|
|
|
bookChapter.url = baseUrl |
|
|
|
|
Debug.log(bookSource.bookSourceUrl, "未获取到url,使用baseUrl替代") |
|
|
|
|
Debug.log(bookSource.bookSourceUrl, "目录${index}未获取到url,使用baseUrl替代") |
|
|
|
|
} |
|
|
|
|
if (bookChapter.title.isNotEmpty()) { |
|
|
|
|
val isVip = analyzeRule.getString(vipRule) |
|
|
|
|
val isPay = analyzeRule.getString(payRule) |
|
|
|
|
if (isVip.isNotEmpty() && !isVip.matches(falseRegex)) { |
|
|
|
|
bookChapter.isVip = true |
|
|
|
|
} |
|
|
|
|