[skip ci]refactor(lib): General refactoration (#1579)

This commit is contained in:
Claudemirovsky
2023-05-06 09:50:45 -03:00
committed by GitHub
parent b1f87d246c
commit d07a8f28bf
16 changed files with 124 additions and 118 deletions

View File

@ -10,7 +10,7 @@ class StreamTapeExtractor(private val client: OkHttpClient) {
val baseUrl = "https://streamtape.com/e/"
val newUrl = if (!url.startsWith(baseUrl)) {
// ["https", "", "<domain>", "<???>", "<id>", ...]
val id = runCatching { url.split("/").get(4) }.getOrNull() ?: return null
val id = url.split("/").getOrNull(4) ?: return null
baseUrl + id
} else { url }
val document = client.newCall(GET(newUrl)).execute().asJsoup()