AniWorld improvments & changes (#802)
* AniWorld improvments & changes * Update build.gradle
This commit is contained in:
@ -6,7 +6,7 @@ ext {
|
|||||||
extName = 'AniWorld'
|
extName = 'AniWorld'
|
||||||
pkgNameSuffix = 'de.aniworld'
|
pkgNameSuffix = 'de.aniworld'
|
||||||
extClass = '.AniWorld'
|
extClass = '.AniWorld'
|
||||||
extVersionCode = 4
|
extVersionCode = 5
|
||||||
libVersion = '13'
|
libVersion = '13'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -74,10 +74,6 @@ class AniWorld : ConfigurableAnimeSource, ParsedAnimeHttpSource() {
|
|||||||
override fun popularAnimeNextPageSelector(): String? = null
|
override fun popularAnimeNextPageSelector(): String? = null
|
||||||
|
|
||||||
override fun popularAnimeRequest(page: Int): Request {
|
override fun popularAnimeRequest(page: Int): Request {
|
||||||
val headers = Headers.Builder()
|
|
||||||
.add("Referer", baseUrl)
|
|
||||||
.add("Upgrade-Insecure-Requests", "1")
|
|
||||||
.build()
|
|
||||||
return GET("$baseUrl/beliebte-animes")
|
return GET("$baseUrl/beliebte-animes")
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -146,6 +142,9 @@ class AniWorld : ConfigurableAnimeSource, ParsedAnimeHttpSource() {
|
|||||||
val title = result["title"]!!.jsonPrimitive.content
|
val title = result["title"]!!.jsonPrimitive.content
|
||||||
val link = result["link"]!!.jsonPrimitive.content
|
val link = result["link"]!!.jsonPrimitive.content
|
||||||
anime.title = title.replace("<em>", "").replace("</em>", "")
|
anime.title = title.replace("<em>", "").replace("</em>", "")
|
||||||
|
val thumpage = client.newCall(GET("$baseUrl$link")).execute().asJsoup()
|
||||||
|
anime.thumbnail_url = baseUrl +
|
||||||
|
thumpage.selectFirst("div.seriesCoverBox img").attr("data-src")
|
||||||
anime.url = link
|
anime.url = link
|
||||||
return anime
|
return anime
|
||||||
}
|
}
|
||||||
@ -226,92 +225,35 @@ class AniWorld : ConfigurableAnimeSource, ParsedAnimeHttpSource() {
|
|||||||
|
|
||||||
override fun videoListParse(response: Response): List<Video> {
|
override fun videoListParse(response: Response): List<Video> {
|
||||||
val document = response.asJsoup()
|
val document = response.asJsoup()
|
||||||
val gerSubs = getRedirectLinks(document, AWConstants.KEY_GER_SUB)
|
val redirectlink = document.select("ul.row li")
|
||||||
val gerDubs = getRedirectLinks(document, AWConstants.KEY_GER_DUB)
|
|
||||||
val engSubs = getRedirectLinks(document, AWConstants.KEY_ENG_SUB)
|
|
||||||
val videoList = mutableListOf<Video>()
|
val videoList = mutableListOf<Video>()
|
||||||
val hosterSelection = preferences.getStringSet(AWConstants.HOSTER_SELECTION, null)
|
val hosterSelection = preferences.getStringSet(AWConstants.HOSTER_SELECTION, null)
|
||||||
val redirectInterceptor = client.newBuilder().addInterceptor(RedirectInterceptor()).build()
|
val redirectInterceptor = client.newBuilder().addInterceptor(RedirectInterceptor()).build()
|
||||||
gerSubs.forEach {
|
redirectlink.forEach {
|
||||||
|
val langkey = it.attr("data-lang-key")
|
||||||
|
val language = getlanguage(langkey)
|
||||||
val redirectgs = baseUrl + it.selectFirst("a.watchEpisode").attr("href")
|
val redirectgs = baseUrl + it.selectFirst("a.watchEpisode").attr("href")
|
||||||
val redirectsgs = redirectInterceptor.newCall(GET(redirectgs)).execute().request.url.toString()
|
val redirects = redirectInterceptor.newCall(GET(redirectgs)).execute().request.url.toString()
|
||||||
if (hosterSelection != null) {
|
if (hosterSelection != null) {
|
||||||
when {
|
when {
|
||||||
redirectsgs.contains("https://voe.sx") || redirectsgs.contains("https://launchreliantcleaverriver") && hosterSelection.contains(AWConstants.NAME_VOE) -> {
|
redirects.contains("https://voe.sx") || redirects.contains("https://launchreliantcleaverriver") ||
|
||||||
val quality = "Voe Deutscher Sub"
|
redirects.contains("https://fraudclatterflyingcar") && hosterSelection.contains(AWConstants.NAME_VOE) -> {
|
||||||
val video = VoeExtractor(client).videoFromUrl(redirectsgs, quality)
|
val quality = "Voe $language"
|
||||||
|
val video = VoeExtractor(client).videoFromUrl(redirects, quality)
|
||||||
if (video != null) {
|
if (video != null) {
|
||||||
videoList.add(video)
|
videoList.add(video)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
redirectsgs.contains("https://dood") && hosterSelection.contains(AWConstants.NAME_DOOD) -> {
|
redirects.contains("https://dood") && hosterSelection.contains(AWConstants.NAME_DOOD) -> {
|
||||||
val quality = "Doodstream Deutscher Sub"
|
val quality = "Doodstream $language"
|
||||||
val video = DoodExtractor(client).videoFromUrl(redirectsgs, quality)
|
val video = DoodExtractor(client).videoFromUrl(redirects, quality)
|
||||||
if (video != null) {
|
if (video != null) {
|
||||||
videoList.add(video)
|
videoList.add(video)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
redirectsgs.contains("https://streamtape") && hosterSelection.contains(AWConstants.NAME_STAPE) -> {
|
redirects.contains("https://streamtape") && hosterSelection.contains(AWConstants.NAME_STAPE) -> {
|
||||||
val quality = "Streamtape Deutscher Sub"
|
val quality = "Streamtape $language"
|
||||||
val video = StreamTapeExtractor(client).videoFromUrl(redirectsgs, quality)
|
val video = StreamTapeExtractor(client).videoFromUrl(redirects, quality)
|
||||||
if (video != null) {
|
|
||||||
videoList.add(video)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
gerDubs.forEach {
|
|
||||||
val redirectgd = baseUrl + it.selectFirst("a.watchEpisode").attr("href")
|
|
||||||
val redirectsgd = redirectInterceptor.newCall(GET(redirectgd)).execute().request.url.toString()
|
|
||||||
if (hosterSelection != null) {
|
|
||||||
when {
|
|
||||||
redirectsgd.contains("https://voe.sx") || redirectsgd.contains("https://launchreliantcleaverriver") && hosterSelection.contains(AWConstants.NAME_VOE) -> {
|
|
||||||
val quality = "Voe Deutscher Dub"
|
|
||||||
val video = VoeExtractor(client).videoFromUrl(redirectsgd, quality)
|
|
||||||
if (video != null) {
|
|
||||||
videoList.add(video)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
redirectsgd.contains("https://dood") && hosterSelection.contains(AWConstants.NAME_DOOD) -> {
|
|
||||||
val quality = "Doodstream Deutscher Dub"
|
|
||||||
val video = DoodExtractor(client).videoFromUrl(redirectsgd, quality)
|
|
||||||
if (video != null) {
|
|
||||||
videoList.add(video)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
redirectsgd.contains("https://streamtape") && hosterSelection.contains(AWConstants.NAME_STAPE) -> {
|
|
||||||
val quality = "Streamtape Deutscher Dub"
|
|
||||||
val video = StreamTapeExtractor(client).videoFromUrl(redirectsgd, quality)
|
|
||||||
if (video != null) {
|
|
||||||
videoList.add(video)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
engSubs.forEach {
|
|
||||||
val redirecten = baseUrl + it.selectFirst("a.watchEpisode").attr("href")
|
|
||||||
val redirectsen = redirectInterceptor.newCall(GET(redirecten)).execute().request.url.toString()
|
|
||||||
if (hosterSelection != null) {
|
|
||||||
when {
|
|
||||||
redirectsen.contains("https://voe.sx") || redirectsen.contains("https://launchreliantcleaverriver") && hosterSelection.contains(AWConstants.NAME_VOE) -> {
|
|
||||||
val quality = "Voe Englischer Sub"
|
|
||||||
val video = VoeExtractor(client).videoFromUrl(redirectsen, quality)
|
|
||||||
if (video != null) {
|
|
||||||
videoList.add(video)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
redirectsen.contains("https://dood") && hosterSelection.contains(AWConstants.NAME_DOOD) -> {
|
|
||||||
val quality = "Doodstream Englischer Sub"
|
|
||||||
val video = DoodExtractor(client).videoFromUrl(redirectsen, quality)
|
|
||||||
if (video != null) {
|
|
||||||
videoList.add(video)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
redirectsen.contains("https://streamtape") && hosterSelection.contains(AWConstants.NAME_STAPE) -> {
|
|
||||||
val quality = "Streamtape Englischer Sub"
|
|
||||||
val video = StreamTapeExtractor(client).videoFromUrl(redirectsen, quality)
|
|
||||||
if (video != null) {
|
if (video != null) {
|
||||||
videoList.add(video)
|
videoList.add(video)
|
||||||
}
|
}
|
||||||
@ -322,11 +264,21 @@ class AniWorld : ConfigurableAnimeSource, ParsedAnimeHttpSource() {
|
|||||||
return videoList
|
return videoList
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun getRedirectLinks(document: Document, key: Int): List<Element> {
|
private fun getlanguage(langkey: String): String? {
|
||||||
val hosterSelection = preferences.getStringSet(AWConstants.HOSTER_SELECTION, null)
|
when {
|
||||||
val selector = "li[class*=episodeLink][data-lang-key="
|
langkey.contains("${AWConstants.KEY_GER_SUB}") -> {
|
||||||
return document.select("$selector$key]")
|
return "Deutscher Sub"
|
||||||
.filter { hosterSelection?.contains(it.select("div > a > h4").text()) == true }
|
}
|
||||||
|
langkey.contains("${AWConstants.KEY_GER_DUB}") -> {
|
||||||
|
return "Deutscher Dub"
|
||||||
|
}
|
||||||
|
langkey.contains("${AWConstants.KEY_ENG_SUB}") -> {
|
||||||
|
return "Englischer Sub"
|
||||||
|
}
|
||||||
|
else -> {
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun videoFromElement(element: Element): Video = throw Exception("not Used")
|
override fun videoFromElement(element: Element): Video = throw Exception("not Used")
|
||||||
|
@ -63,14 +63,15 @@ class RedirectInterceptor : Interceptor {
|
|||||||
view: WebView,
|
view: WebView,
|
||||||
request: WebResourceRequest,
|
request: WebResourceRequest,
|
||||||
): WebResourceResponse? {
|
): WebResourceResponse? {
|
||||||
if (request.url.toString().contains("token") || request.url.toString().contains("dood") || request.url.toString().contains("streamtape") || request.url.toString().contains("voe")) {
|
if (request.url.toString().contains("token") || request.url.toString().contains("https://dood.") ||
|
||||||
|
request.url.toString().contains("https://streamtape") || request.url.toString().contains("https://voe")
|
||||||
|
) {
|
||||||
newRequest = GET(request.url.toString(), request.requestHeaders.toHeaders())
|
newRequest = GET(request.url.toString(), request.requestHeaders.toHeaders())
|
||||||
latch.countDown()
|
latch.countDown()
|
||||||
}
|
}
|
||||||
return super.shouldInterceptRequest(view, request)
|
return super.shouldInterceptRequest(view, request)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
webView?.loadUrl(origRequestUrl, headers)
|
webView?.loadUrl(origRequestUrl, headers)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user