Anime24: fix (#1059)
This commit is contained in:
@ -6,7 +6,7 @@ ext {
|
|||||||
extName = 'Anime24'
|
extName = 'Anime24'
|
||||||
pkgNameSuffix = 'de.anime24'
|
pkgNameSuffix = 'de.anime24'
|
||||||
extClass = '.Anime24'
|
extClass = '.Anime24'
|
||||||
extVersionCode = 4
|
extVersionCode = 5
|
||||||
libVersion = '13'
|
libVersion = '13'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -20,7 +20,6 @@ import okhttp3.Request
|
|||||||
import okhttp3.Response
|
import okhttp3.Response
|
||||||
import org.jsoup.nodes.Document
|
import org.jsoup.nodes.Document
|
||||||
import org.jsoup.nodes.Element
|
import org.jsoup.nodes.Element
|
||||||
import org.jsoup.select.Elements
|
|
||||||
import uy.kohesive.injekt.Injekt
|
import uy.kohesive.injekt.Injekt
|
||||||
import uy.kohesive.injekt.api.get
|
import uy.kohesive.injekt.api.get
|
||||||
import kotlin.Exception
|
import kotlin.Exception
|
||||||
@ -33,7 +32,7 @@ class Anime24 : ConfigurableAnimeSource, ParsedAnimeHttpSource() {
|
|||||||
|
|
||||||
override val lang = "de"
|
override val lang = "de"
|
||||||
|
|
||||||
override val supportsLatest = true
|
override val supportsLatest = false
|
||||||
|
|
||||||
override val client: OkHttpClient = network.cloudflareClient
|
override val client: OkHttpClient = network.cloudflareClient
|
||||||
|
|
||||||
@ -41,19 +40,19 @@ class Anime24 : ConfigurableAnimeSource, ParsedAnimeHttpSource() {
|
|||||||
Injekt.get<Application>().getSharedPreferences("source_$id", 0x0000)
|
Injekt.get<Application>().getSharedPreferences("source_$id", 0x0000)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun popularAnimeSelector(): String = "article.bs"
|
override fun popularAnimeSelector(): String = "div#blog-entries article"
|
||||||
|
|
||||||
override fun popularAnimeRequest(page: Int): Request = GET("$baseUrl/anime/?page=$page&status=&type=&order=popular")
|
override fun popularAnimeRequest(page: Int): Request = GET(baseUrl)
|
||||||
|
|
||||||
override fun popularAnimeFromElement(element: Element): SAnime {
|
override fun popularAnimeFromElement(element: Element): SAnime {
|
||||||
val anime = SAnime.create()
|
val anime = SAnime.create()
|
||||||
anime.setUrlWithoutDomain(element.select("a.tip").attr("href"))
|
anime.setUrlWithoutDomain(element.select("div.post-thumbnail a").attr("href"))
|
||||||
anime.thumbnail_url = element.select("div.limit img").attr("src")
|
anime.thumbnail_url = element.select("div.post-thumbnail a img ").attr("data-lazy-src")
|
||||||
anime.title = element.select("div.limit img").attr("title")
|
anime.title = element.select("div.blog-entry-content h2.entry-title a").text()
|
||||||
return anime
|
return anime
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun popularAnimeNextPageSelector(): String = "a.r"
|
override fun popularAnimeNextPageSelector(): String = "div.nav-links a.next"
|
||||||
|
|
||||||
// episodes
|
// episodes
|
||||||
|
|
||||||
@ -62,73 +61,50 @@ class Anime24 : ConfigurableAnimeSource, ParsedAnimeHttpSource() {
|
|||||||
override fun episodeListParse(response: Response): List<SEpisode> {
|
override fun episodeListParse(response: Response): List<SEpisode> {
|
||||||
val document = response.asJsoup()
|
val document = response.asJsoup()
|
||||||
val episodeList = mutableListOf<SEpisode>()
|
val episodeList = mutableListOf<SEpisode>()
|
||||||
if (!document.select("div.eplister ul li a div.epl-num").text().contains("Movie")) {
|
val episodeElement = document.select("div.entry-content div.su-spoiler")
|
||||||
val episodeElement = document.select("div.eplister ul")
|
episodeElement.forEach {
|
||||||
val episode = parseEpisodesFromSeries(episodeElement)
|
val episode = episodeFromElement(it)
|
||||||
episodeList.addAll(episode)
|
|
||||||
} else {
|
|
||||||
val episode = SEpisode.create()
|
|
||||||
episode.name = document.select("div.infox h1").text()
|
|
||||||
episode.episode_number = 1F
|
|
||||||
episode.setUrlWithoutDomain(document.select("div.eplister ul li a").attr("href"))
|
|
||||||
episodeList.add(episode)
|
episodeList.add(episode)
|
||||||
}
|
}
|
||||||
return episodeList
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun parseEpisodesFromSeries(element: Elements): List<SEpisode> {
|
return episodeList
|
||||||
val episodeElements = element.select("li")
|
|
||||||
return episodeElements.map { episodeFromElement(it) }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun episodeFromElement(element: Element): SEpisode {
|
override fun episodeFromElement(element: Element): SEpisode {
|
||||||
val episode = SEpisode.create()
|
val episode = SEpisode.create()
|
||||||
episode.episode_number = element.select("a div.epl-num").text().toFloat()
|
episode.episode_number = element.select("div.su-spoiler-title").text()
|
||||||
val folge = element.select("a div.epl-num").text()
|
.substringAfter("Episode ").substringBefore(" ").toFloat()
|
||||||
episode.name = "Folge $folge : " + element.select("a div.epl-title").text()
|
episode.name = element.select("div.su-spoiler-title").text()
|
||||||
episode.setUrlWithoutDomain(element.select("a").attr("href"))
|
episode.url = (element.select("div.su-spoiler-content center iframe").attr("data-lazy-src"))
|
||||||
return episode
|
return episode
|
||||||
}
|
}
|
||||||
|
|
||||||
// Video Extractor
|
// Video Extractor
|
||||||
|
|
||||||
override fun videoListParse(response: Response): List<Video> {
|
override fun videoListRequest(episode: SEpisode): Request {
|
||||||
val document = response.asJsoup()
|
val url = episode.url.replace(baseUrl, "")
|
||||||
return videosFromElement(document)
|
return GET(url)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun videosFromElement(document: Document): List<Video> {
|
override fun videoListParse(response: Response): List<Video> {
|
||||||
|
val url = response.request.url.toString()
|
||||||
|
return videosFromElement(url)
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun videosFromElement(url: String): List<Video> {
|
||||||
val videoList = mutableListOf<Video>()
|
val videoList = mutableListOf<Video>()
|
||||||
val linklazy = document.select("#pembed iframe[data-lazy-src]").attr("data-lazy-src")
|
|
||||||
val hosterSelection = preferences.getStringSet("hoster_selection", setOf("stape", "voe"))
|
val hosterSelection = preferences.getStringSet("hoster_selection", setOf("stape", "voe"))
|
||||||
when {
|
when {
|
||||||
linklazy.contains("https://streamtape") || linklazy.contains("https://adblockeronstape") && hosterSelection?.contains("stape") == true -> {
|
url.contains("https://streamtape") || url.contains("https://adblockeronstape") && hosterSelection?.contains("stape") == true -> {
|
||||||
val quality = "Streamtape"
|
val quality = "Streamtape"
|
||||||
val video = StreamTapeExtractor(client).videoFromUrl(linklazy, quality)
|
val video = StreamTapeExtractor(client).videoFromUrl(url, quality)
|
||||||
if (video != null) {
|
if (video != null) {
|
||||||
videoList.add(video)
|
videoList.add(video)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
linklazy.contains("https://voe.sx") && hosterSelection?.contains("voe") == true -> {
|
url.contains("https://voe.sx") || url.contains("https://20demidistance9elongations.com") && hosterSelection?.contains("voe") == true -> {
|
||||||
val quality = "Voe"
|
val quality = "Voe"
|
||||||
val video = VoeExtractor(client).videoFromUrl(linklazy, quality)
|
val video = VoeExtractor(client).videoFromUrl(url, quality)
|
||||||
if (video != null) {
|
|
||||||
videoList.add(video)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
val linksrc = document.select("#pembed iframe").attr("src")
|
|
||||||
when {
|
|
||||||
linksrc.contains("https://streamtape") || linksrc.contains("https://adblockeronstape") && hosterSelection?.contains("stape") == true -> {
|
|
||||||
val quality = "Streamtape"
|
|
||||||
val video = StreamTapeExtractor(client).videoFromUrl(linksrc, quality)
|
|
||||||
if (video != null) {
|
|
||||||
videoList.add(video)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
linksrc.contains("https://voe.sx") && hosterSelection?.contains("voe") == true -> {
|
|
||||||
val quality = "Voe"
|
|
||||||
val video = VoeExtractor(client).videoFromUrl(linksrc, quality)
|
|
||||||
if (video != null) {
|
if (video != null) {
|
||||||
videoList.add(video)
|
videoList.add(video)
|
||||||
}
|
}
|
||||||
@ -165,15 +141,15 @@ class Anime24 : ConfigurableAnimeSource, ParsedAnimeHttpSource() {
|
|||||||
|
|
||||||
override fun searchAnimeFromElement(element: Element): SAnime {
|
override fun searchAnimeFromElement(element: Element): SAnime {
|
||||||
val anime = SAnime.create()
|
val anime = SAnime.create()
|
||||||
anime.setUrlWithoutDomain(element.select("a.tip").attr("href"))
|
anime.setUrlWithoutDomain(element.select("div.post-thumbnail a").attr("href"))
|
||||||
anime.thumbnail_url = element.select("div.limit img").attr("src")
|
anime.thumbnail_url = element.select("div.post-thumbnail a img ").attr("src")
|
||||||
anime.title = element.select("div.limit img").attr("title")
|
anime.title = element.select("div.blog-entry-content h2.entry-title a").text()
|
||||||
return anime
|
return anime
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun searchAnimeNextPageSelector(): String = "a.next"
|
override fun searchAnimeNextPageSelector(): String = "div.nav-links a.next"
|
||||||
|
|
||||||
override fun searchAnimeSelector(): String = "article.bs"
|
override fun searchAnimeSelector(): String = "div#blog-entries article"
|
||||||
|
|
||||||
override fun searchAnimeRequest(page: Int, query: String, filters: AnimeFilterList): Request = GET("$baseUrl/page/$page/?s=$query")
|
override fun searchAnimeRequest(page: Int, query: String, filters: AnimeFilterList): Request = GET("$baseUrl/page/$page/?s=$query")
|
||||||
|
|
||||||
@ -181,11 +157,10 @@ class Anime24 : ConfigurableAnimeSource, ParsedAnimeHttpSource() {
|
|||||||
|
|
||||||
override fun animeDetailsParse(document: Document): SAnime {
|
override fun animeDetailsParse(document: Document): SAnime {
|
||||||
val anime = SAnime.create()
|
val anime = SAnime.create()
|
||||||
anime.thumbnail_url = document.select("div.thumb img").attr("data-lazy-src")
|
anime.thumbnail_url = document.select("div.su-column-inner img").attr("data-lazy-src")
|
||||||
anime.title = document.select("div.infox h1").text()
|
anime.title = document.select("header.entry-header h1.entry-title").text()
|
||||||
anime.genre = document.select("div.genxed a").joinToString(", ") { it.text() }
|
anime.description = document.select("div.su-column-inner p").toString()
|
||||||
anime.description = document.select("div.entry-content p").text()
|
.substringAfter("<br>").substringBefore("</p>")
|
||||||
anime.author = document.select("span.split a").joinToString(", ") { it.text() }
|
|
||||||
anime.status = SAnime.COMPLETED
|
anime.status = SAnime.COMPLETED
|
||||||
return anime
|
return anime
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user