|
|
@ -12,6 +12,7 @@ import io.legado.app.exception.NoStackTraceException |
|
|
|
import io.legado.app.help.config.AppConfig |
|
|
|
import io.legado.app.help.config.AppConfig |
|
|
|
import io.legado.app.help.http.newCallResponseBody |
|
|
|
import io.legado.app.help.http.newCallResponseBody |
|
|
|
import io.legado.app.help.http.okHttpClient |
|
|
|
import io.legado.app.help.http.okHttpClient |
|
|
|
|
|
|
|
import io.legado.app.help.http.requestWithoutUA |
|
|
|
import io.legado.app.help.source.SourceHelp |
|
|
|
import io.legado.app.help.source.SourceHelp |
|
|
|
import io.legado.app.utils.* |
|
|
|
import io.legado.app.utils.* |
|
|
|
|
|
|
|
|
|
|
@ -121,6 +122,10 @@ class ImportRssSourceViewModel(app: Application) : BaseViewModel(app) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private suspend fun importSourceUrl(url: String) { |
|
|
|
private suspend fun importSourceUrl(url: String) { |
|
|
|
|
|
|
|
if (url.indexOf("#requestWithoutUA")>-1) { |
|
|
|
|
|
|
|
val res = requestWithoutUA(url).body() |
|
|
|
|
|
|
|
importSource(res) |
|
|
|
|
|
|
|
} else { |
|
|
|
okHttpClient.newCallResponseBody { |
|
|
|
okHttpClient.newCallResponseBody { |
|
|
|
url(url) |
|
|
|
url(url) |
|
|
|
}.byteStream().let { body -> |
|
|
|
}.byteStream().let { body -> |
|
|
@ -133,6 +138,7 @@ class ImportRssSourceViewModel(app: Application) : BaseViewModel(app) { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private fun comparisonSource() { |
|
|
|
private fun comparisonSource() { |
|
|
|
execute { |
|
|
|
execute { |
|
|
|