pull/48/head
kunfei 5 years ago
parent 07fe3e027c
commit cec4d81356
  1. 26
      app/src/main/java/io/legado/app/model/WebBook.kt

@ -38,12 +38,19 @@ class WebBook(val bookSource: BookSource) {
baseUrl = sourceUrl, baseUrl = sourceUrl,
headerMapF = bookSource.getHeaderMap() headerMapF = bookSource.getHeaderMap()
) )
val response = analyzeUrl.getResponseAwait() var baseUrl = analyzeUrl.ruleUrl
val body = if (analyzeUrl.useWebView) {
analyzeUrl.getResultByWebView(bookSource.bookSourceUrl)
} else {
val res = analyzeUrl.getResponseAwait()
baseUrl = NetworkUtils.getUrl(res)
res.body()
}
BookList.analyzeBookList( BookList.analyzeBookList(
response.body(), body,
bookSource, bookSource,
analyzeUrl, analyzeUrl,
NetworkUtils.getUrl(response), baseUrl,
true true
) )
} ?: arrayListOf() } ?: arrayListOf()
@ -66,12 +73,19 @@ class WebBook(val bookSource: BookSource) {
baseUrl = sourceUrl, baseUrl = sourceUrl,
headerMapF = bookSource.getHeaderMap() headerMapF = bookSource.getHeaderMap()
) )
val response = analyzeUrl.getResponseAwait() var baseUrl = analyzeUrl.ruleUrl
val body = if (analyzeUrl.useWebView) {
analyzeUrl.getResultByWebView(bookSource.bookSourceUrl)
} else {
val res = analyzeUrl.getResponseAwait()
baseUrl = NetworkUtils.getUrl(res)
res.body()
}
BookList.analyzeBookList( BookList.analyzeBookList(
response.body(), body,
bookSource, bookSource,
analyzeUrl, analyzeUrl,
NetworkUtils.getUrl(response), baseUrl,
false false
) )
} }

Loading…
Cancel
Save