AnimeFLV and AnimeID updated (#636)
This commit is contained in:
@ -5,7 +5,7 @@ ext {
|
|||||||
extName = 'AnimeFLV'
|
extName = 'AnimeFLV'
|
||||||
pkgNameSuffix = 'es.animeflv'
|
pkgNameSuffix = 'es.animeflv'
|
||||||
extClass = '.AnimeFlv'
|
extClass = '.AnimeFlv'
|
||||||
extVersionCode = 20
|
extVersionCode = 21
|
||||||
libVersion = '12'
|
libVersion = '12'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -10,6 +10,7 @@ import eu.kanade.tachiyomi.animeextension.es.animeflv.extractors.OkruExtractor
|
|||||||
import eu.kanade.tachiyomi.animeextension.es.animeflv.extractors.StreamSBExtractor
|
import eu.kanade.tachiyomi.animeextension.es.animeflv.extractors.StreamSBExtractor
|
||||||
import eu.kanade.tachiyomi.animeextension.es.animeflv.extractors.StreamTapeExtractor
|
import eu.kanade.tachiyomi.animeextension.es.animeflv.extractors.StreamTapeExtractor
|
||||||
import eu.kanade.tachiyomi.animesource.ConfigurableAnimeSource
|
import eu.kanade.tachiyomi.animesource.ConfigurableAnimeSource
|
||||||
|
import eu.kanade.tachiyomi.animesource.model.AnimeFilter
|
||||||
import eu.kanade.tachiyomi.animesource.model.AnimeFilterList
|
import eu.kanade.tachiyomi.animesource.model.AnimeFilterList
|
||||||
import eu.kanade.tachiyomi.animesource.model.SAnime
|
import eu.kanade.tachiyomi.animesource.model.SAnime
|
||||||
import eu.kanade.tachiyomi.animesource.model.SEpisode
|
import eu.kanade.tachiyomi.animesource.model.SEpisode
|
||||||
@ -48,7 +49,7 @@ class AnimeFlv : ConfigurableAnimeSource, ParsedAnimeHttpSource() {
|
|||||||
|
|
||||||
override fun popularAnimeSelector(): String = "div.Container ul.ListAnimes li article"
|
override fun popularAnimeSelector(): String = "div.Container ul.ListAnimes li article"
|
||||||
|
|
||||||
override fun popularAnimeRequest(page: Int): Request = GET("$baseUrl/browse?order=rating&page=$page")
|
override fun popularAnimeRequest(page: Int): Request = GET("$baseUrl/browse?order=5&page=$page")
|
||||||
|
|
||||||
override fun popularAnimeFromElement(element: Element): SAnime {
|
override fun popularAnimeFromElement(element: Element): SAnime {
|
||||||
val anime = SAnime.create()
|
val anime = SAnime.create()
|
||||||
@ -156,7 +157,73 @@ class AnimeFlv : ConfigurableAnimeSource, ParsedAnimeHttpSource() {
|
|||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun searchAnimeRequest(page: Int, query: String, filters: AnimeFilterList): Request = GET("$baseUrl/browse?q=$query&page=$page")
|
override fun searchAnimeRequest(page: Int, query: String, filters: AnimeFilterList): Request {
|
||||||
|
val filterList = if (filters.isEmpty()) getFilterList() else filters
|
||||||
|
val genreFilter = filterList.find { it is GenreFilter } as GenreFilter
|
||||||
|
|
||||||
|
return when {
|
||||||
|
query.isNotBlank() -> GET("$baseUrl/browse?q=$query&order=4&page=$page")
|
||||||
|
genreFilter.state != 0 -> GET("$baseUrl/browse?genres=${genreFilter.toUriPart()}&order=4&page=$page")
|
||||||
|
else -> GET("$baseUrl/browse?page=$page&order=4")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun getFilterList(): AnimeFilterList = AnimeFilterList(
|
||||||
|
AnimeFilter.Header("La busqueda por texto ignora el filtro"),
|
||||||
|
GenreFilter()
|
||||||
|
)
|
||||||
|
|
||||||
|
private class GenreFilter : UriPartFilter(
|
||||||
|
"Géneros",
|
||||||
|
arrayOf(
|
||||||
|
Pair("<Selecionar>", "all"),
|
||||||
|
Pair("Acción", "accion"),
|
||||||
|
Pair("Artes Marciales", "artes_marciales"),
|
||||||
|
Pair("Aventuras", "aventura"),
|
||||||
|
Pair("Carreras", "carreras"),
|
||||||
|
Pair("Ciencia Ficción", "ciencia_ficcion"),
|
||||||
|
Pair("Comedia", "comedia"),
|
||||||
|
Pair("Demencia", "demencia"),
|
||||||
|
Pair("Demonios", "demonios"),
|
||||||
|
Pair("Deportes", "deportes"),
|
||||||
|
Pair("Drama", "drama"),
|
||||||
|
Pair("Ecchi", "ecchi"),
|
||||||
|
Pair("Escolares", "escolares"),
|
||||||
|
Pair("Espacial", "espacial"),
|
||||||
|
Pair("Fantasía", "fantasia"),
|
||||||
|
Pair("Harem", "harem"),
|
||||||
|
Pair("Historico", "historico"),
|
||||||
|
Pair("Infantil", "infantil"),
|
||||||
|
Pair("Josei", "josei"),
|
||||||
|
Pair("Juegos", "juegos"),
|
||||||
|
Pair("Magia", "magia"),
|
||||||
|
Pair("Mecha", "mecha"),
|
||||||
|
Pair("Militar", "militar"),
|
||||||
|
Pair("Misterio", "misterio"),
|
||||||
|
Pair("Música", "musica"),
|
||||||
|
Pair("Parodia", "parodia"),
|
||||||
|
Pair("Policía", "policia"),
|
||||||
|
Pair("Psicológico", "psicologico"),
|
||||||
|
Pair("Recuentos de la vida", "recuentos_de_la_vida"),
|
||||||
|
Pair("Romance", "romance"),
|
||||||
|
Pair("Samurai", "samurai"),
|
||||||
|
Pair("Seinen", "seinen"),
|
||||||
|
Pair("Shoujo", "shoujo"),
|
||||||
|
Pair("Shounen", "shounen"),
|
||||||
|
Pair("Sobrenatural", "sobrenatural"),
|
||||||
|
Pair("Superpoderes", "superpoderes"),
|
||||||
|
Pair("Suspenso", "suspenso"),
|
||||||
|
Pair("Terror", "terror"),
|
||||||
|
Pair("Vampiros", "vampiros"),
|
||||||
|
Pair("Yaoi", "yaoi"),
|
||||||
|
Pair("Yuri", "yuri")
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
private open class UriPartFilter(displayName: String, val vals: Array<Pair<String, String>>) :
|
||||||
|
AnimeFilter.Select<String>(displayName, vals.map { it.first }.toTypedArray()) {
|
||||||
|
fun toUriPart() = vals[state].second
|
||||||
|
}
|
||||||
|
|
||||||
override fun searchAnimeFromElement(element: Element): SAnime {
|
override fun searchAnimeFromElement(element: Element): SAnime {
|
||||||
return popularAnimeFromElement(element)
|
return popularAnimeFromElement(element)
|
||||||
|
@ -5,7 +5,7 @@ ext {
|
|||||||
extName = 'AnimeID'
|
extName = 'AnimeID'
|
||||||
pkgNameSuffix = 'es.animeid'
|
pkgNameSuffix = 'es.animeid'
|
||||||
extClass = '.AnimeID'
|
extClass = '.AnimeID'
|
||||||
extVersionCode = 1
|
extVersionCode = 2
|
||||||
libVersion = '12'
|
libVersion = '12'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -31,6 +31,7 @@ import uy.kohesive.injekt.api.get
|
|||||||
import uy.kohesive.injekt.injectLazy
|
import uy.kohesive.injekt.injectLazy
|
||||||
import java.net.URI
|
import java.net.URI
|
||||||
import java.text.SimpleDateFormat
|
import java.text.SimpleDateFormat
|
||||||
|
import java.util.Date
|
||||||
|
|
||||||
class AnimeID : ConfigurableAnimeSource, ParsedAnimeHttpSource() {
|
class AnimeID : ConfigurableAnimeSource, ParsedAnimeHttpSource() {
|
||||||
|
|
||||||
@ -88,42 +89,39 @@ class AnimeID : ConfigurableAnimeSource, ParsedAnimeHttpSource() {
|
|||||||
|
|
||||||
var responseString = client.newCall(GET("https://www.animeid.tv/ajax/caps?id=$animeId&ord=DESC&pag=$nextPage", headers))
|
var responseString = client.newCall(GET("https://www.animeid.tv/ajax/caps?id=$animeId&ord=DESC&pag=$nextPage", headers))
|
||||||
.execute().asJsoup().body()!!.toString().substringAfter("<body>").substringBefore("</body>")
|
.execute().asJsoup().body()!!.toString().substringAfter("<body>").substringBefore("</body>")
|
||||||
Log.i("bruh", responseString)
|
|
||||||
val jObject = json.decodeFromString<JsonObject>(responseString)
|
val jObject = json.decodeFromString<JsonObject>(responseString)
|
||||||
var listCaps = jObject["list"]!!.jsonArray
|
var listCaps = jObject["list"]!!.jsonArray
|
||||||
Log.i("bruh list", jObject["list"]!!.toString())
|
|
||||||
listCaps!!.forEach { cap ->
|
listCaps!!.forEach { cap ->
|
||||||
var capParsed = cap.jsonObject
|
var capParsed = cap.jsonObject
|
||||||
Log.i("bruh ep", capParsed.toString())
|
|
||||||
val epNum = capParsed["numero"]!!.jsonPrimitive.content!!.toFloat()
|
val epNum = capParsed["numero"]!!.jsonPrimitive.content!!.toFloat()
|
||||||
val format = SimpleDateFormat("dd MMM yyyy")
|
|
||||||
val episode = SEpisode.create()
|
val episode = SEpisode.create()
|
||||||
|
var dateUpload = manualDateParse(capParsed["date"]!!.jsonPrimitive.content!!.toString())
|
||||||
episode.episode_number = epNum
|
episode.episode_number = epNum
|
||||||
episode.name = "Episodio $epNum"
|
episode.name = "Episodio $epNum"
|
||||||
episode.date_upload = format.parse(capParsed["date"]!!.jsonPrimitive.content!!.toString()).time
|
dateUpload!!.also { episode.date_upload = it }
|
||||||
episode.setUrlWithoutDomain(baseUrl + capParsed["href"]!!.jsonPrimitive.content!!.toString())
|
episode.setUrlWithoutDomain(baseUrl + capParsed["href"]!!.jsonPrimitive.content!!.toString())
|
||||||
capList.add(episode)
|
capList.add(episode)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (listCaps!!.any()) nextPage += 1 else nextPage = -1
|
if (listCaps!!.any()) nextPage += 1 else nextPage = -1
|
||||||
} while (nextPage != -1)
|
} while (nextPage != -1)
|
||||||
return capList
|
return capList
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun episodeFromElement(element: Element) = throw Exception("not used")
|
private fun manualDateParse(stringDate: String): Long? {
|
||||||
|
return try {
|
||||||
/*override fun episodeFromElement(element: Element): SEpisode {
|
val format = SimpleDateFormat("dd MMM yyyy")
|
||||||
val episode = SEpisode.create()
|
format.parse(stringDate!!.toString()).time
|
||||||
val epNum = getNumberFromEpsString(element.select("p").text())
|
} catch (e: Exception) {
|
||||||
episode.setUrlWithoutDomain(element.attr("href"))
|
var dateParsed = stringDate.split(" ")
|
||||||
episode.episode_number = when {
|
val arrMonths = arrayOf("Jun", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec")
|
||||||
(epNum.isNotEmpty()) -> epNum.toFloat()
|
val day = dateParsed[0]!!.trim().toInt()
|
||||||
else -> 1F
|
val month = arrMonths.indexOf(dateParsed[1].trim()) + 1
|
||||||
|
val year = dateParsed[2]!!.trim().toInt()
|
||||||
|
Date(year, month, day).time
|
||||||
}
|
}
|
||||||
episode.name = element.select("p").text()
|
}
|
||||||
|
|
||||||
return episode
|
override fun episodeFromElement(element: Element) = throw Exception("not used")
|
||||||
}*/
|
|
||||||
|
|
||||||
override fun videoListParse(response: Response): List<Video> {
|
override fun videoListParse(response: Response): List<Video> {
|
||||||
val document = response.asJsoup()
|
val document = response.asJsoup()
|
||||||
|
Reference in New Issue
Block a user