UHDMovies: fix selector & remove hardcoded url (#1230)
* UHDMovies: fix selector & remove hardcoded url * Bump version
This commit is contained in:
@ -6,7 +6,7 @@ ext {
|
|||||||
extName = 'UHD Movies (Experimental)'
|
extName = 'UHD Movies (Experimental)'
|
||||||
pkgNameSuffix = 'en.uhdmovies'
|
pkgNameSuffix = 'en.uhdmovies'
|
||||||
extClass = '.UHDMovies'
|
extClass = '.UHDMovies'
|
||||||
extVersionCode = 2
|
extVersionCode = 3
|
||||||
libVersion = '13'
|
libVersion = '13'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -110,7 +110,7 @@ class UHDMovies : ConfigurableAnimeSource, ParsedAnimeHttpSource() {
|
|||||||
val response = client.newCall(GET(baseUrl + anime.url)).execute()
|
val response = client.newCall(GET(baseUrl + anime.url)).execute()
|
||||||
val resp = response.asJsoup()
|
val resp = response.asJsoup()
|
||||||
val episodeList = mutableListOf<SEpisode>()
|
val episodeList = mutableListOf<SEpisode>()
|
||||||
val episodeElements = resp.select("p:has(a[href^=https://href.li])[style*=center]")
|
val episodeElements = resp.select("p:has(a[href*=?id])[style*=center]")
|
||||||
val qualityRegex = "[0-9]{3,4}p".toRegex(RegexOption.IGNORE_CASE)
|
val qualityRegex = "[0-9]{3,4}p".toRegex(RegexOption.IGNORE_CASE)
|
||||||
if (episodeElements.first().text().contains("Episode", true) ||
|
if (episodeElements.first().text().contains("Episode", true) ||
|
||||||
episodeElements.first().text().contains("Zip", true)
|
episodeElements.first().text().contains("Zip", true)
|
||||||
@ -142,7 +142,7 @@ class UHDMovies : ConfigurableAnimeSource, ParsedAnimeHttpSource() {
|
|||||||
val episode = linkElement.text().replace("Episode", "", true).trim()
|
val episode = linkElement.text().replace("Episode", "", true).trim()
|
||||||
Triple(
|
Triple(
|
||||||
season + "_$episode",
|
season + "_$episode",
|
||||||
linkElement.attr("href")!!.substringAfter("?id="),
|
linkElement.attr("href")!!,
|
||||||
quality
|
quality
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@ -174,7 +174,7 @@ class UHDMovies : ConfigurableAnimeSource, ParsedAnimeHttpSource() {
|
|||||||
.replace("Download", "", true).trim()
|
.replace("Download", "", true).trim()
|
||||||
|
|
||||||
row.select("a").map { linkElement ->
|
row.select("a").map { linkElement ->
|
||||||
Triple(linkElement.attr("href")!!.substringAfter("?id="), quality, collectionName)
|
Triple(linkElement.attr("href")!!, quality, collectionName)
|
||||||
}
|
}
|
||||||
}.flatten().groupBy { it.third }.map { group ->
|
}.flatten().groupBy { it.third }.map { group ->
|
||||||
collectionIdx++
|
collectionIdx++
|
||||||
@ -236,8 +236,8 @@ class UHDMovies : ConfigurableAnimeSource, ParsedAnimeHttpSource() {
|
|||||||
// ============================= Utilities ==============================
|
// ============================= Utilities ==============================
|
||||||
|
|
||||||
private fun extractVideo(epUrl: EpUrl): Pair<List<Video>, String> {
|
private fun extractVideo(epUrl: EpUrl): Pair<List<Video>, String> {
|
||||||
val postLink = "https://blog.officialboypalak.in/"
|
val postLink = epUrl.url.substringBefore("?id=")
|
||||||
val formData = FormBody.Builder().add("_wp_http", epUrl.url).build()
|
val formData = FormBody.Builder().add("_wp_http", epUrl.url.substringAfter("?id=")).build()
|
||||||
val response = client.newCall(POST(postLink, body = formData)).execute().asJsoup()
|
val response = client.newCall(POST(postLink, body = formData)).execute().asJsoup()
|
||||||
val link = response.selectFirst("form#landing").attr("action")
|
val link = response.selectFirst("form#landing").attr("action")
|
||||||
val wpHttp = response.selectFirst("input[name=_wp_http2]").attr("value")
|
val wpHttp = response.selectFirst("input[name=_wp_http2]").attr("value")
|
||||||
|
Reference in New Issue
Block a user