|
|
|
@ -7,7 +7,7 @@ import io.legado.app.data.entities.RssSource |
|
|
|
|
import io.legado.app.model.Debug |
|
|
|
|
import io.legado.app.model.NoStackTraceException |
|
|
|
|
import io.legado.app.model.analyzeRule.AnalyzeRule |
|
|
|
|
import io.legado.app.model.analyzeRule.RuleDataInterface |
|
|
|
|
import io.legado.app.model.analyzeRule.RuleData |
|
|
|
|
import io.legado.app.utils.NetworkUtils |
|
|
|
|
import splitties.init.appCtx |
|
|
|
|
import java.util.* |
|
|
|
@ -21,7 +21,7 @@ object RssParserByRule { |
|
|
|
|
sortUrl: String, |
|
|
|
|
body: String?, |
|
|
|
|
rssSource: RssSource, |
|
|
|
|
ruleData: RuleDataInterface |
|
|
|
|
ruleData: RuleData |
|
|
|
|
): Pair<MutableList<RssArticle>, String?> { |
|
|
|
|
val sourceUrl = rssSource.sourceUrl |
|
|
|
|
var nextUrl: String? = null |
|
|
|
@ -66,9 +66,10 @@ object RssParserByRule { |
|
|
|
|
val ruleDescription = analyzeRule.splitSourceRule(rssSource.ruleDescription) |
|
|
|
|
val ruleImage = analyzeRule.splitSourceRule(rssSource.ruleImage) |
|
|
|
|
val ruleLink = analyzeRule.splitSourceRule(rssSource.ruleLink) |
|
|
|
|
val variable = ruleData.getVariable() |
|
|
|
|
for ((index, item) in collections.withIndex()) { |
|
|
|
|
getItem( |
|
|
|
|
sourceUrl, item, analyzeRule, ruleData, index == 0, |
|
|
|
|
sourceUrl, item, analyzeRule, variable, index == 0, |
|
|
|
|
ruleTitle, rulePubDate, ruleDescription, ruleImage, ruleLink |
|
|
|
|
)?.let { |
|
|
|
|
it.sort = sortName |
|
|
|
@ -87,7 +88,7 @@ object RssParserByRule { |
|
|
|
|
sourceUrl: String, |
|
|
|
|
item: Any, |
|
|
|
|
analyzeRule: AnalyzeRule, |
|
|
|
|
ruleData: RuleDataInterface, |
|
|
|
|
variable: String?, |
|
|
|
|
log: Boolean, |
|
|
|
|
ruleTitle: List<AnalyzeRule.SourceRule>, |
|
|
|
|
rulePubDate: List<AnalyzeRule.SourceRule>, |
|
|
|
@ -95,7 +96,7 @@ object RssParserByRule { |
|
|
|
|
ruleImage: List<AnalyzeRule.SourceRule>, |
|
|
|
|
ruleLink: List<AnalyzeRule.SourceRule> |
|
|
|
|
): RssArticle? { |
|
|
|
|
val rssArticle = RssArticle(variable = ruleData.variable) |
|
|
|
|
val rssArticle = RssArticle(variable = variable) |
|
|
|
|
analyzeRule.ruleData = rssArticle |
|
|
|
|
analyzeRule.setContent(item) |
|
|
|
|
Debug.log(sourceUrl, "┌获取标题", log) |
|
|
|
|