ninegoal fix access denied urls (#55)

* ninegoal

* kekw logo

* Update build.gradle.kts

* kekw

* Update build.gradle.kts

Co-authored-by: Cloudburst <18114966+C10udburst@users.noreply.github.com>
This commit is contained in:
Zaw 2022-11-26 23:43:53 +03:00 committed by GitHub
parent b25de372c5
commit e9d0a83d80
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 6 deletions

View File

@ -1,4 +1,4 @@
version = 1
version = 2
cloudstream {
description = ""

View File

@ -68,10 +68,6 @@ class NineGoal : MainAPI() {
TvType.Live
)
private fun String.getDomainFromUrl(): String? {
return Regex("""^(?:https?:\/\/)?(?:[^@\n]+@)?(?:www\.)?([^:\/\n\?\=]+)""").find(this)?.groupValues?.firstOrNull()
}
override suspend fun getMainPage(page: Int, request : MainPageRequest): HomePageResponse {
val doc = app.get(mainUrl).document
val apiUrl = doc.select("head > script").first()?.html()?.substringAfter("window.api_base_url = \"")?.substringBefore("\";")
@ -124,7 +120,7 @@ class NineGoal : MainAPI() {
this.name,
"${this.name} ${it.name} - ${sourcesData.name}",
it.url.toString(),
fixUrl(it.url?.getDomainFromUrl().toString()),
"$mainUrl/",
Qualities.Unknown.value,
isM3u8 = true,
)