Update Genoanime (#148)
@ -5,7 +5,7 @@ ext {
|
|||||||
extName = 'GenoAnime'
|
extName = 'GenoAnime'
|
||||||
pkgNameSuffix = 'en.genoanime'
|
pkgNameSuffix = 'en.genoanime'
|
||||||
extClass = '.GenoAnime'
|
extClass = '.GenoAnime'
|
||||||
extVersionCode = 1
|
extVersionCode = 2
|
||||||
libVersion = '12'
|
libVersion = '12'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Before Width: | Height: | Size: 4.9 KiB After Width: | Height: | Size: 36 KiB |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 22 KiB |
Before Width: | Height: | Size: 5.0 KiB After Width: | Height: | Size: 50 KiB |
Before Width: | Height: | Size: 5.3 KiB After Width: | Height: | Size: 96 KiB |
Before Width: | Height: | Size: 5.6 KiB After Width: | Height: | Size: 159 KiB |
Before Width: | Height: | Size: 9.5 KiB After Width: | Height: | Size: 161 KiB |
@ -14,7 +14,6 @@ import okhttp3.OkHttpClient
|
|||||||
import okhttp3.Request
|
import okhttp3.Request
|
||||||
import org.jsoup.nodes.Document
|
import org.jsoup.nodes.Document
|
||||||
import org.jsoup.nodes.Element
|
import org.jsoup.nodes.Element
|
||||||
import java.lang.Exception
|
|
||||||
|
|
||||||
class GenoAnime : ParsedAnimeHttpSource() {
|
class GenoAnime : ParsedAnimeHttpSource() {
|
||||||
|
|
||||||
@ -27,24 +26,33 @@ class GenoAnime : ParsedAnimeHttpSource() {
|
|||||||
private val weserv = "https://images.weserv.nl/?w=400&q=60&url="
|
private val weserv = "https://images.weserv.nl/?w=400&q=60&url="
|
||||||
|
|
||||||
// Popular Anime
|
// Popular Anime
|
||||||
override fun popularAnimeRequest(page: Int): Request = GET("$baseUrl/browse?sort=top_rated&page=$page")
|
override fun popularAnimeRequest(page: Int): Request =
|
||||||
override fun popularAnimeSelector(): String = "div.trending__product div.col-lg-10 div.row"
|
GET("$baseUrl/browse?sort=top_rated&page=$page")
|
||||||
override fun popularAnimeNextPageSelector(): String = "div.text-center a i.fa.fa-angle-double-right"
|
|
||||||
|
override fun popularAnimeSelector(): String = "div.trending__product div.col-lg-10 div.row div.col-lg-3.col-6"
|
||||||
|
override fun popularAnimeNextPageSelector(): String =
|
||||||
|
"div.text-center a i.fa.fa-angle-double-right"
|
||||||
|
|
||||||
override fun popularAnimeFromElement(element: Element): SAnime {
|
override fun popularAnimeFromElement(element: Element): SAnime {
|
||||||
val anime = SAnime.create()
|
val anime = SAnime.create()
|
||||||
val tempurl = "$baseUrl/" + element.select("div.product__item a").attr("href").removePrefix("./")
|
val tempurl =
|
||||||
|
"$baseUrl/" + element.select("div.product__item a").attr("href").removePrefix("./")
|
||||||
anime.setUrlWithoutDomain(tempurl)
|
anime.setUrlWithoutDomain(tempurl)
|
||||||
anime.title = element.select("div.product__item__text h5 a:nth-of-type(2)").first().text()
|
anime.title = element.select("div.product__item__text h5 a:nth-of-type(2)").first().text()
|
||||||
val thumburl = element.select("div.product__item__pic").attr("data-setbg").removePrefix("./")
|
val thumburl =
|
||||||
|
element.select("div.product__item__pic").attr("data-setbg").removePrefix("./")
|
||||||
anime.thumbnail_url = "$weserv$baseUrl/$thumburl"
|
anime.thumbnail_url = "$weserv$baseUrl/$thumburl"
|
||||||
return anime
|
return anime
|
||||||
}
|
}
|
||||||
|
|
||||||
// Latest Anime
|
// Latest Anime
|
||||||
override fun latestUpdatesRequest(page: Int): Request = GET("$baseUrl/browse?sort=latest&page=$page", headers)
|
override fun latestUpdatesRequest(page: Int): Request =
|
||||||
|
GET("$baseUrl/browse?sort=latest&page=$page", headers)
|
||||||
|
|
||||||
override fun latestUpdatesSelector(): String = popularAnimeSelector()
|
override fun latestUpdatesSelector(): String = popularAnimeSelector()
|
||||||
override fun latestUpdatesNextPageSelector(): String = popularAnimeNextPageSelector()
|
override fun latestUpdatesNextPageSelector(): String = popularAnimeNextPageSelector()
|
||||||
override fun latestUpdatesFromElement(element: Element): SAnime = popularAnimeFromElement(element)
|
override fun latestUpdatesFromElement(element: Element): SAnime =
|
||||||
|
popularAnimeFromElement(element)
|
||||||
|
|
||||||
// Search Anime
|
// Search Anime
|
||||||
override fun searchAnimeRequest(page: Int, query: String, filters: AnimeFilterList): Request {
|
override fun searchAnimeRequest(page: Int, query: String, filters: AnimeFilterList): Request {
|
||||||
@ -57,12 +65,17 @@ class GenoAnime : ParsedAnimeHttpSource() {
|
|||||||
.build()
|
.build()
|
||||||
return POST("$baseUrl/data/searchdata.php", newHeaders, formBody)
|
return POST("$baseUrl/data/searchdata.php", newHeaders, formBody)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun searchAnimeSelector(): String = "div.col-lg-3"
|
override fun searchAnimeSelector(): String = "div.col-lg-3"
|
||||||
override fun searchAnimeNextPageSelector(): String = "div.text-center.product__pagination a.search-page i.fa.fa-angle-double-right"
|
override fun searchAnimeNextPageSelector(): String =
|
||||||
|
"div.text-center.product__pagination a.search-page i.fa.fa-angle-double-left"
|
||||||
|
|
||||||
override fun searchAnimeFromElement(element: Element): SAnime {
|
override fun searchAnimeFromElement(element: Element): SAnime {
|
||||||
val anime = SAnime.create()
|
val anime = SAnime.create()
|
||||||
val tempurl = "$baseUrl/" + element.select("a").attr("href").removePrefix("./")
|
val tempurl = "$baseUrl/" + element.select("a").attr("href").removePrefix("./")
|
||||||
val thumburl = element.select("div.product__item div.product__item__pic.set-bg").attr("data-setbg").removePrefix("./")
|
val thumburl =
|
||||||
|
element.select("div.product__item div.product__item__pic.set-bg").attr("data-setbg")
|
||||||
|
.removePrefix("./")
|
||||||
anime.setUrlWithoutDomain(tempurl)
|
anime.setUrlWithoutDomain(tempurl)
|
||||||
anime.title = element.select("div.product__item__text h5 a:nth-of-type(2)").text()
|
anime.title = element.select("div.product__item__text h5 a:nth-of-type(2)").text()
|
||||||
anime.thumbnail_url = "$weserv$baseUrl/$thumburl"
|
anime.thumbnail_url = "$weserv$baseUrl/$thumburl"
|
||||||
@ -83,11 +96,14 @@ class GenoAnime : ParsedAnimeHttpSource() {
|
|||||||
|
|
||||||
// Video
|
// Video
|
||||||
override fun videoUrlParse(document: Document): String = throw Exception("Not used.")
|
override fun videoUrlParse(document: Document): String = throw Exception("Not used.")
|
||||||
override fun videoListSelector() = "section.details.spad div.container div.row:nth-of-type(1) div.col-lg-12:nth-of-type(1)"
|
override fun videoListSelector() =
|
||||||
|
"section.details.spad div.container div.row:nth-of-type(1) div.col-lg-12:nth-of-type(1)"
|
||||||
|
|
||||||
override fun videoFromElement(element: Element): Video {
|
override fun videoFromElement(element: Element): Video {
|
||||||
val baaseurl = element.select("iframe#iframeplayer").attr("src")
|
val baaseurl = element.select("div#video iframe#iframe-to-load").attr("src")
|
||||||
|
Log.d(name, "BaseUrl: $baaseurl")
|
||||||
if (baaseurl.contains("https://genoanime.com/doodplayer.php")) {
|
if (baaseurl.contains("https://genoanime.com/doodplayer.php")) {
|
||||||
val baseurl = videoidgrab(element.select("iframe#iframeplayer").attr("src"))
|
val baseurl = videoidgrab(element.select("div#video iframe#iframe-to-load").attr("src"))
|
||||||
Log.d(name, "Dood True: $baseurl")
|
Log.d(name, "Dood True: $baseurl")
|
||||||
val a = doodUrlParse(baseurl)
|
val a = doodUrlParse(baseurl)
|
||||||
Log.d(name, "Dood parsed: $a")
|
Log.d(name, "Dood parsed: $a")
|
||||||
@ -98,57 +114,74 @@ class GenoAnime : ParsedAnimeHttpSource() {
|
|||||||
null,
|
null,
|
||||||
Headers.headersOf("Referer", baseurl)
|
Headers.headersOf("Referer", baseurl)
|
||||||
)
|
)
|
||||||
} else return try {
|
} else {
|
||||||
Log.d(name, "Dood False: " + element.select("video source").attr("src"))
|
Log.d(name, "Dood False: " + element.select("video source").attr("src"))
|
||||||
Video(
|
return Video(
|
||||||
element.select("video source").attr("src"),
|
element.select("video source").attr("src"),
|
||||||
"Unknown quality",
|
"Unknown quality",
|
||||||
element.select("video source").attr("src"),
|
element.select("video source").attr("src"),
|
||||||
null,
|
null,
|
||||||
Headers.headersOf("Referer", baseUrl),
|
Headers.headersOf("Referer", baseUrl),
|
||||||
)
|
)
|
||||||
} catch (e: Exception) {
|
|
||||||
throw Exception("Doodstream mirror unavailable.")
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Anime window
|
// Anime window
|
||||||
override fun animeDetailsParse(document: Document): SAnime {
|
override fun animeDetailsParse(document: Document): SAnime {
|
||||||
val anime = SAnime.create()
|
val anime = SAnime.create()
|
||||||
val thumburl = document.select("div.anime__details__pic").attr("data-setbg").removePrefix("./")
|
val thumburl =
|
||||||
|
document.select("div.anime__details__pic").attr("data-setbg").removePrefix("./")
|
||||||
anime.thumbnail_url = "$baseUrl/$thumburl"
|
anime.thumbnail_url = "$baseUrl/$thumburl"
|
||||||
anime.title = document.select("div.anime__details__title h3").text()
|
anime.title = document.select("div.anime__details__title h3").text()
|
||||||
anime.genre = document.select("div.col-lg-6.col-md-6:nth-of-type(1) ul li:nth-of-type(3)").joinToString(", ") { it.text() }
|
anime.genre = document.select("div.col-lg-6.col-md-6:nth-of-type(1) ul li:nth-of-type(3)")
|
||||||
|
.joinToString(", ") { it.text() }.replace("Genre:", "")
|
||||||
anime.description = document.select("div.anime__details__title span").text()
|
anime.description = document.select("div.anime__details__title span").text()
|
||||||
document.select("div.col-lg-6.col-md-6:nth-of-type(2) ul li:nth-of-type(2)").text()?.also { statusText ->
|
document.select("div.col-lg-6.col-md-6:nth-of-type(2) ul li:nth-of-type(2)").text()
|
||||||
when {
|
?.also { statusText ->
|
||||||
statusText.contains("Ongoing", true) -> anime.status = SAnime.ONGOING
|
when {
|
||||||
statusText.contains("Completed", true) -> anime.status = SAnime.COMPLETED
|
statusText.contains("Ongoing", true) -> anime.status = SAnime.ONGOING
|
||||||
else -> anime.status = SAnime.UNKNOWN
|
statusText.contains("Completed", true) -> anime.status = SAnime.COMPLETED
|
||||||
|
else -> anime.status = SAnime.UNKNOWN
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
// if (anime.status == SAnime.ONGOING) {
|
||||||
|
// val(aiiringat, epiisode, animeid) = next_ep_ween(anime.title)
|
||||||
|
// Log.d("$name status.ONGOING", anime.title)
|
||||||
|
// Log.d("$name airingat", aiiringat.toString())
|
||||||
|
// anime.next_ep_wen = airingmsg(epiisode, aiiringat)
|
||||||
|
// }
|
||||||
return anime
|
return anime
|
||||||
}
|
}
|
||||||
|
|
||||||
// Custom Fun
|
// Custom Fun
|
||||||
private fun doodUrlParse(url: String): String? {
|
private fun doodUrlParse(url: String): String {
|
||||||
val response = client.newCall(GET(url.replace("/e/", "/d/"))).execute()
|
val response = client.newCall(GET(url.replace("/e/", "/d/"))).execute()
|
||||||
val content = response.body!!.string()
|
val content = response.body!!.string()
|
||||||
val md5 = content.substringAfter("/download/").substringBefore("\"")
|
val md5 = content.substringAfter("/download/").substringBefore("\"")
|
||||||
val tmpdl = "https://dood.ws/download/$md5"
|
var abc = doodreq(url, md5)
|
||||||
val token = client.newCall(
|
while (abc.contains("""<b class="err">Security error</b>""")) {
|
||||||
|
Log.d(name, "Dood bs. Trying again.")
|
||||||
|
abc = doodreq(url, md5)
|
||||||
|
}
|
||||||
|
return abc
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun doodreq(url: String, md5: String): String {
|
||||||
|
return client.newCall(
|
||||||
GET(
|
GET(
|
||||||
tmpdl,
|
"https://dood.ws/download/$md5",
|
||||||
Headers.headersOf("referer", url.replace("/e/", "/d/"))
|
Headers.headersOf("referer", url)
|
||||||
)
|
)
|
||||||
).execute().body!!.string().substringAfter("window.open('").substringBefore("\'")
|
).execute().body!!.string().substringAfter("window.open('").substringBefore("\'")
|
||||||
return token
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun videoidgrab(url: String): String {
|
private fun videoidgrab(url: String): String {
|
||||||
val uwrl = "https://goload.one/streaming.php?id=" + url.substringAfter("&vidid=")
|
Log.d(name, "given url: $url")
|
||||||
val response = client.newCall(GET(uwrl)).execute()
|
val uwrl = """https://goload.one/streaming.php?id=${url.substringAfter("&vidid=")}"""
|
||||||
val content = response.body!!.string()
|
Log.d(name, "golandUrl: $uwrl")
|
||||||
return "https://dood" + content.substringAfter("dood").substringBefore("\"")
|
val content = client.newCall(GET(uwrl)).execute().body!!.string().substringAfter("dood").substringBefore("\"")
|
||||||
|
Log.d(name, "doodUrl: https://dood$content")
|
||||||
|
return "https://dood$content"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|