Shahid4u Fixed
This commit is contained in:
parent
194946d626
commit
006a4926dc
2 changed files with 6 additions and 3 deletions
|
@ -1,4 +1,4 @@
|
||||||
version = 1
|
version = 2
|
||||||
|
|
||||||
cloudstream {
|
cloudstream {
|
||||||
description = ""
|
description = ""
|
||||||
|
|
|
@ -15,6 +15,9 @@ class Shahid4u : MainAPI() {
|
||||||
override val supportedTypes =
|
override val supportedTypes =
|
||||||
setOf(TvType.TvSeries, TvType.Movie, TvType.Anime, TvType.AsianDrama)
|
setOf(TvType.TvSeries, TvType.Movie, TvType.Anime, TvType.AsianDrama)
|
||||||
|
|
||||||
|
private fun String.getDomainFromUrl(): String? {
|
||||||
|
return Regex("""^(?:https?:\/\/)?(?:[^@\n]+@)?(?:www\.)?([^:\/\n\?\=]+)""").find(this)?.groupValues?.firstOrNull()
|
||||||
|
}
|
||||||
private fun Element.toSearchResponse(): SearchResponse? {
|
private fun Element.toSearchResponse(): SearchResponse? {
|
||||||
val urlElement = select("a.fullClick")
|
val urlElement = select("a.fullClick")
|
||||||
val posterUrl =
|
val posterUrl =
|
||||||
|
@ -163,7 +166,7 @@ class Shahid4u : MainAPI() {
|
||||||
val id = it.attr("data-id")
|
val id = it.attr("data-id")
|
||||||
val i = it.attr("data-i")
|
val i = it.attr("data-i")
|
||||||
val sourceUrl = app.post(
|
val sourceUrl = app.post(
|
||||||
"https://shahed4u.mx/wp-content/themes/Shahid4u-WP_HOME/Ajaxat/Single/Server.php",
|
"${data.getDomainFromUrl()}/wp-content/themes/Shahid4u-WP_HOME/Ajaxat/Single/Server.php",
|
||||||
headers = mapOf("referer" to watchUrl, "x-requested-with" to "XMLHttpRequest"),
|
headers = mapOf("referer" to watchUrl, "x-requested-with" to "XMLHttpRequest"),
|
||||||
data = mapOf("id" to id, "i" to i)
|
data = mapOf("id" to id, "i" to i)
|
||||||
).document.select("iframe").attr("src")
|
).document.select("iframe").attr("src")
|
||||||
|
|
Loading…
Reference in a new issue