mirror of
https://github.com/gedoor/legado.git
synced 2025-08-10 00:52:30 +00:00
修复在线tts朗读bug
This commit is contained in:
1537
app/schemas/io.legado.app.data.AppDatabase/43.json
Normal file
1537
app/schemas/io.legado.app.data.AppDatabase/43.json
Normal file
File diff suppressed because it is too large
Load Diff
@@ -155,16 +155,18 @@ object NetworkUtils {
|
||||
* http://www.biquge.com.cn => http://biquge.com.cn
|
||||
* http://www.content.example.com => http://example.com
|
||||
*/
|
||||
fun getSubDomain(url: String?): String {
|
||||
val baseUrl = getBaseUrl(url) ?: return ""
|
||||
val mURL = URL(baseUrl)
|
||||
val schema: String = mURL.protocol
|
||||
val host: String = mURL.host
|
||||
//判断是否为ip
|
||||
if (isIPAddress(host)) return baseUrl
|
||||
//PublicSuffixDatabase处理域名
|
||||
val domain = PublicSuffixDatabase.get().getEffectiveTldPlusOne(host)
|
||||
return if (domain == null) baseUrl else "${schema}://${domain}"
|
||||
fun getSubDomain(url: String): String {
|
||||
return kotlin.runCatching {
|
||||
val baseUrl = getBaseUrl(url) ?: return ""
|
||||
val mURL = URL(baseUrl)
|
||||
val schema: String = mURL.protocol
|
||||
val host: String = mURL.host
|
||||
//判断是否为ip
|
||||
if (isIPAddress(host)) return baseUrl
|
||||
//PublicSuffixDatabase处理域名
|
||||
val domain = PublicSuffixDatabase.get().getEffectiveTldPlusOne(host)
|
||||
if (domain == null) baseUrl else "${schema}://${domain}"
|
||||
}.getOrDefault(url)
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user