akwam: fix videos url certificate issue (#220)
This commit is contained in:
@ -5,7 +5,7 @@ ext {
|
|||||||
extName = 'أكوام'
|
extName = 'أكوام'
|
||||||
pkgNameSuffix = 'ar.akwam'
|
pkgNameSuffix = 'ar.akwam'
|
||||||
extClass = '.Akwam'
|
extClass = '.Akwam'
|
||||||
extVersionCode = 1
|
extVersionCode = 2
|
||||||
libVersion = '12'
|
libVersion = '12'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,7 +2,6 @@ package eu.kanade.tachiyomi.animeextension.ar.akwam
|
|||||||
|
|
||||||
import android.app.Application
|
import android.app.Application
|
||||||
import android.content.SharedPreferences
|
import android.content.SharedPreferences
|
||||||
import android.util.Log
|
|
||||||
import androidx.preference.ListPreference
|
import androidx.preference.ListPreference
|
||||||
import androidx.preference.PreferenceScreen
|
import androidx.preference.PreferenceScreen
|
||||||
import eu.kanade.tachiyomi.animesource.ConfigurableAnimeSource
|
import eu.kanade.tachiyomi.animesource.ConfigurableAnimeSource
|
||||||
@ -59,13 +58,11 @@ class Akwam : ConfigurableAnimeSource, ParsedAnimeHttpSource() {
|
|||||||
|
|
||||||
// episodes
|
// episodes
|
||||||
|
|
||||||
override fun episodeListSelector() = "div.bg-primary2 div.quality:first-child a.link-show" // :contains(مشاهدة)"
|
override fun episodeListSelector() = "input#reportInputUrl"
|
||||||
|
|
||||||
override fun episodeFromElement(element: Element): SEpisode {
|
override fun episodeFromElement(element: Element): SEpisode {
|
||||||
val episode = SEpisode.create()
|
val episode = SEpisode.create()
|
||||||
episode.setUrlWithoutDomain(element.attr("href").replace("http://go.akwam.im", "https://akwam.rest") + "/" + element.ownerDocument().select("input#page_id").attr("value"))
|
episode.setUrlWithoutDomain(element.attr("value"))
|
||||||
Log.i("lol", element.attr("href"))
|
|
||||||
Log.i("loll", element.attr("href").replace("http://go.akwam.im", "https://akwam.rest") + "/" + element.ownerDocument().select("input#page_id").attr("value"))
|
|
||||||
episode.name = element.ownerDocument().select("picture > img.img-fluid").attr("alt")
|
episode.name = element.ownerDocument().select("picture > img.img-fluid").attr("alt")
|
||||||
episode.date_upload = System.currentTimeMillis()
|
episode.date_upload = System.currentTimeMillis()
|
||||||
return episode
|
return episode
|
||||||
@ -75,8 +72,7 @@ class Akwam : 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 iframe = document.select("input#reportInputUrl").attr("value")
|
val iframe = document.select("a.link-show").attr("href").replace("http://go.akwam.im", "https://akwam.rest") + "/" + document.ownerDocument().select("input#page_id").attr("value")
|
||||||
Log.i("lol", document.select("input#reportInputUrl").attr("value"))
|
|
||||||
val referer = response.request.url.toString()
|
val referer = response.request.url.toString()
|
||||||
val refererHeaders = Headers.headersOf("referer", referer)
|
val refererHeaders = Headers.headersOf("referer", referer)
|
||||||
val iframeResponse = client.newCall(GET(iframe, refererHeaders))
|
val iframeResponse = client.newCall(GET(iframe, refererHeaders))
|
||||||
@ -87,7 +83,7 @@ class Akwam : ConfigurableAnimeSource, ParsedAnimeHttpSource() {
|
|||||||
override fun videoListSelector() = "source"
|
override fun videoListSelector() = "source"
|
||||||
|
|
||||||
override fun videoFromElement(element: Element): Video {
|
override fun videoFromElement(element: Element): Video {
|
||||||
return Video(element.attr("src"), element.attr("size") + "p", element.attr("src"), null)
|
return Video(element.attr("src").replace("https", "http"), element.attr("size") + "p", element.attr("src").replace("https", "http"), null)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun List<Video>.sort(): List<Video> {
|
override fun List<Video>.sort(): List<Video> {
|
||||||
@ -125,16 +121,30 @@ class Akwam : ConfigurableAnimeSource, ParsedAnimeHttpSource() {
|
|||||||
override fun searchAnimeSelector(): String = "div.widget div.widget-body div.col-lg-auto div.entry-box div.entry-image a.box"
|
override fun searchAnimeSelector(): String = "div.widget div.widget-body div.col-lg-auto div.entry-box div.entry-image a.box"
|
||||||
|
|
||||||
override fun searchAnimeRequest(page: Int, query: String, filters: AnimeFilterList): Request {
|
override fun searchAnimeRequest(page: Int, query: String, filters: AnimeFilterList): Request {
|
||||||
val url = "$baseUrl/search?q=$query&page=$page".toHttpUrlOrNull()!!.newBuilder()
|
val url = if (query.isNotBlank()) {
|
||||||
filters.forEach { filter ->
|
val url = "$baseUrl/search?q=$query&page=$page".toHttpUrlOrNull()!!.newBuilder()
|
||||||
when (filter) {
|
filters.forEach { filter ->
|
||||||
is SectionFilter -> url.addQueryParameter("section", filter.toUriPart())
|
when (filter) {
|
||||||
is RatingFilter -> url.addQueryParameter("rating", filter.toUriPart())
|
is SectionFilter -> url.addQueryParameter("section", filter.toUriPart())
|
||||||
is FormatFilter -> url.addQueryParameter("formats", filter.toUriPart())
|
is RatingFilter -> url.addQueryParameter("rating", filter.toUriPart())
|
||||||
is QualityFilter -> url.addQueryParameter("quality", filter.toUriPart())
|
is FormatFilter -> url.addQueryParameter("formats", filter.toUriPart())
|
||||||
|
is QualityFilter -> url.addQueryParameter("quality", filter.toUriPart())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
url.toString()
|
||||||
|
} else {
|
||||||
|
val url = "$baseUrl/movies?page=$page".toHttpUrlOrNull()!!.newBuilder()
|
||||||
|
filters.forEach { filter ->
|
||||||
|
when (filter) {
|
||||||
|
is SectionSFilter -> url.addQueryParameter("section", filter.toUriPart())
|
||||||
|
is CategorySFilter -> url.addQueryParameter("category", filter.toUriPart())
|
||||||
|
is RatingSFilter -> url.addQueryParameter("rating", filter.toUriPart())
|
||||||
|
// is LanguageSFilter -> url.addQueryParameter("quality", filter.toUriPart())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
url.toString()
|
||||||
}
|
}
|
||||||
return GET(url.build().toString(), headers)
|
return GET(url, headers)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Anime Details
|
// Anime Details
|
||||||
@ -162,12 +172,17 @@ class Akwam : ConfigurableAnimeSource, ParsedAnimeHttpSource() {
|
|||||||
// Filters
|
// Filters
|
||||||
|
|
||||||
override fun getFilterList() = AnimeFilterList(
|
override fun getFilterList() = AnimeFilterList(
|
||||||
// Filter.Header("Type exclusion not available for this source"),
|
AnimeFilter.Header("this is search Filters"),
|
||||||
AnimeFilter.Separator(),
|
AnimeFilter.Separator(),
|
||||||
SectionFilter(getSectionFilter()),
|
SectionFilter(getSectionFilter()),
|
||||||
RatingFilter(getRatingFilter()),
|
RatingFilter(getRatingFilter()),
|
||||||
FormatFilter(getFormatFilter()),
|
FormatFilter(getFormatFilter()),
|
||||||
QualityFilter(getQualityFilter()),
|
QualityFilter(getQualityFilter()),
|
||||||
|
AnimeFilter.Header("this is Movies Filters"),
|
||||||
|
AnimeFilter.Separator(),
|
||||||
|
SectionSFilter(getSectionSFilter()),
|
||||||
|
CategorySFilter(getCategorySFilter()),
|
||||||
|
RatingSFilter(getRatingSFilter()),
|
||||||
)
|
)
|
||||||
|
|
||||||
private class SectionFilter(vals: Array<Pair<String?, String>>) : UriPartFilter("الأقسام", vals)
|
private class SectionFilter(vals: Array<Pair<String?, String>>) : UriPartFilter("الأقسام", vals)
|
||||||
@ -175,6 +190,10 @@ class Akwam : ConfigurableAnimeSource, ParsedAnimeHttpSource() {
|
|||||||
private class FormatFilter(vals: Array<Pair<String?, String>>) : UriPartFilter("الجودة", vals)
|
private class FormatFilter(vals: Array<Pair<String?, String>>) : UriPartFilter("الجودة", vals)
|
||||||
private class QualityFilter(vals: Array<Pair<String?, String>>) : UriPartFilter("الدقة", vals)
|
private class QualityFilter(vals: Array<Pair<String?, String>>) : UriPartFilter("الدقة", vals)
|
||||||
|
|
||||||
|
private class SectionSFilter(vals: Array<Pair<String?, String>>) : UriPartFilter("الأقسام", vals)
|
||||||
|
private class CategorySFilter(vals: Array<Pair<String?, String>>) : UriPartFilter("التصنيف", vals)
|
||||||
|
private class RatingSFilter(vals: Array<Pair<String?, String>>) : UriPartFilter("التقييم", vals)
|
||||||
|
|
||||||
private fun getSectionFilter(): Array<Pair<String?, String>> = arrayOf(
|
private fun getSectionFilter(): Array<Pair<String?, String>> = arrayOf(
|
||||||
Pair("0", "القسم"),
|
Pair("0", "القسم"),
|
||||||
Pair("movie", "افلام"),
|
Pair("movie", "افلام"),
|
||||||
@ -223,6 +242,57 @@ class Akwam : ConfigurableAnimeSource, ParsedAnimeHttpSource() {
|
|||||||
Pair("4K", "4K"),
|
Pair("4K", "4K"),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
private fun getSectionSFilter(): Array<Pair<String?, String>> = arrayOf(
|
||||||
|
Pair("0", "القسم"),
|
||||||
|
Pair("29", "عربي"),
|
||||||
|
Pair("30", "اجنبي"),
|
||||||
|
Pair("31", "هندي"),
|
||||||
|
Pair("32", "تركي"),
|
||||||
|
Pair("33", "اسيوي")
|
||||||
|
)
|
||||||
|
|
||||||
|
private fun getCategorySFilter(): Array<Pair<String?, String>> = arrayOf(
|
||||||
|
Pair("0", "التصنيف"),
|
||||||
|
Pair("87", "رمضان"),
|
||||||
|
Pair("30", "انمي"),
|
||||||
|
Pair("18", "اكشن"),
|
||||||
|
Pair("71", "مدبلج"),
|
||||||
|
Pair("72", "NETFLIX"),
|
||||||
|
Pair("20", "كوميدي"),
|
||||||
|
Pair("35", "اثارة"),
|
||||||
|
Pair("34", "غموض"),
|
||||||
|
Pair("33", "عائلي"),
|
||||||
|
Pair("88", "اطفال"),
|
||||||
|
Pair("25", "حربي"),
|
||||||
|
Pair("32", "رياضي"),
|
||||||
|
Pair("89", "قصير"),
|
||||||
|
Pair("43", "فانتازيا"),
|
||||||
|
Pair("24", "خيال علمي"),
|
||||||
|
Pair("31", "موسيقى"),
|
||||||
|
Pair("29", "سيرة ذاتية"),
|
||||||
|
Pair("28", "وثائقي"),
|
||||||
|
Pair("27", "رومانسي"),
|
||||||
|
Pair("26", "تاريخي"),
|
||||||
|
Pair("23", "دراما"),
|
||||||
|
Pair("22", "رعب"),
|
||||||
|
Pair("21", "جريمة"),
|
||||||
|
Pair("19", "مغامرة"),
|
||||||
|
Pair("91", "غربي")
|
||||||
|
)
|
||||||
|
|
||||||
|
private fun getRatingSFilter(): Array<Pair<String?, String>> = arrayOf(
|
||||||
|
Pair("0", "التقييم"),
|
||||||
|
Pair("1", "1+"),
|
||||||
|
Pair("2", "2+"),
|
||||||
|
Pair("3", "3+"),
|
||||||
|
Pair("4", "4+"),
|
||||||
|
Pair("5", "5+"),
|
||||||
|
Pair("6", "6+"),
|
||||||
|
Pair("7", "7+"),
|
||||||
|
Pair("8", "8+"),
|
||||||
|
Pair("9", "9+")
|
||||||
|
)
|
||||||
|
|
||||||
open class UriPartFilter(displayName: String, private val vals: Array<Pair<String?, String>>) :
|
open class UriPartFilter(displayName: String, private val vals: Array<Pair<String?, String>>) :
|
||||||
AnimeFilter.Select<String>(displayName, vals.map { it.second }.toTypedArray()) {
|
AnimeFilter.Select<String>(displayName, vals.map { it.second }.toTypedArray()) {
|
||||||
fun toUriPart() = vals[state].first
|
fun toUriPart() = vals[state].first
|
||||||
|
2
src/ar/akwams/AndroidManifest.xml
Normal file
2
src/ar/akwams/AndroidManifest.xml
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<manifest package="eu.kanade.tachiyomi.animeextension" />
|
12
src/ar/akwams/build.gradle
Normal file
12
src/ar/akwams/build.gradle
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
apply plugin: 'com.android.application'
|
||||||
|
apply plugin: 'kotlin-android'
|
||||||
|
|
||||||
|
ext {
|
||||||
|
extName = 'اكوام مسلسلات'
|
||||||
|
pkgNameSuffix = 'ar.akwams'
|
||||||
|
extClass = '.AkwamS'
|
||||||
|
extVersionCode = 1
|
||||||
|
libVersion = '12'
|
||||||
|
}
|
||||||
|
|
||||||
|
apply from: "$rootDir/common.gradle"
|
BIN
src/ar/akwams/res/mipmap-hdpi/ic_launcher.png
Normal file
BIN
src/ar/akwams/res/mipmap-hdpi/ic_launcher.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.4 KiB |
BIN
src/ar/akwams/res/mipmap-mdpi/ic_launcher.png
Normal file
BIN
src/ar/akwams/res/mipmap-mdpi/ic_launcher.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.6 KiB |
BIN
src/ar/akwams/res/mipmap-xhdpi/ic_launcher.png
Normal file
BIN
src/ar/akwams/res/mipmap-xhdpi/ic_launcher.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.2 KiB |
BIN
src/ar/akwams/res/mipmap-xxhdpi/ic_launcher.png
Normal file
BIN
src/ar/akwams/res/mipmap-xxhdpi/ic_launcher.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.2 KiB |
BIN
src/ar/akwams/res/mipmap-xxxhdpi/ic_launcher.png
Normal file
BIN
src/ar/akwams/res/mipmap-xxxhdpi/ic_launcher.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 7.2 KiB |
BIN
src/ar/akwams/res/play_store_512.png
Normal file
BIN
src/ar/akwams/res/play_store_512.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 19 KiB |
@ -0,0 +1,313 @@
|
|||||||
|
package eu.kanade.tachiyomi.animeextension.ar.akwams
|
||||||
|
|
||||||
|
import android.app.Application
|
||||||
|
import android.content.SharedPreferences
|
||||||
|
import androidx.preference.ListPreference
|
||||||
|
import androidx.preference.PreferenceScreen
|
||||||
|
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.SAnime
|
||||||
|
import eu.kanade.tachiyomi.animesource.model.SEpisode
|
||||||
|
import eu.kanade.tachiyomi.animesource.model.Video
|
||||||
|
import eu.kanade.tachiyomi.animesource.online.ParsedAnimeHttpSource
|
||||||
|
import eu.kanade.tachiyomi.network.GET
|
||||||
|
import eu.kanade.tachiyomi.util.asJsoup
|
||||||
|
import okhttp3.Headers
|
||||||
|
import okhttp3.HttpUrl.Companion.toHttpUrlOrNull
|
||||||
|
import okhttp3.OkHttpClient
|
||||||
|
import okhttp3.Request
|
||||||
|
import okhttp3.Response
|
||||||
|
import org.jsoup.nodes.Document
|
||||||
|
import org.jsoup.nodes.Element
|
||||||
|
import uy.kohesive.injekt.Injekt
|
||||||
|
import uy.kohesive.injekt.api.get
|
||||||
|
import java.lang.Exception
|
||||||
|
|
||||||
|
class AkwamS : ConfigurableAnimeSource, ParsedAnimeHttpSource() {
|
||||||
|
|
||||||
|
override val name = "أكوام مسلسلات"
|
||||||
|
|
||||||
|
override val baseUrl = "https://akwam.im"
|
||||||
|
|
||||||
|
override val lang = "ar"
|
||||||
|
|
||||||
|
override val supportsLatest = false
|
||||||
|
|
||||||
|
override val client: OkHttpClient = network.cloudflareClient
|
||||||
|
|
||||||
|
private val preferences: SharedPreferences by lazy {
|
||||||
|
Injekt.get<Application>().getSharedPreferences("source_$id", 0x0000)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Popular
|
||||||
|
|
||||||
|
override fun popularAnimeSelector(): String = "div.entry-box-1 div.entry-image a.box"
|
||||||
|
|
||||||
|
override fun popularAnimeRequest(page: Int): Request = GET("$baseUrl/series?page=$page")
|
||||||
|
|
||||||
|
override fun popularAnimeFromElement(element: Element): SAnime {
|
||||||
|
val anime = SAnime.create()
|
||||||
|
anime.thumbnail_url = element.select("picture img").attr("data-src")
|
||||||
|
anime.setUrlWithoutDomain(element.attr("href"))
|
||||||
|
anime.title = element.select("picture img").attr("alt")
|
||||||
|
return anime
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun popularAnimeNextPageSelector(): String = "ul.pagination li.page-item a[rel=next]"
|
||||||
|
|
||||||
|
// episodes
|
||||||
|
|
||||||
|
override fun episodeListSelector() = "div.bg-primary2 h2 a"
|
||||||
|
|
||||||
|
override fun episodeFromElement(element: Element): SEpisode {
|
||||||
|
val episode = SEpisode.create()
|
||||||
|
episode.setUrlWithoutDomain(element.attr("href"))
|
||||||
|
episode.name = element.text()
|
||||||
|
episode.date_upload = System.currentTimeMillis()
|
||||||
|
return episode
|
||||||
|
}
|
||||||
|
|
||||||
|
// Video links
|
||||||
|
|
||||||
|
override fun videoListParse(response: Response): List<Video> {
|
||||||
|
val document = response.asJsoup()
|
||||||
|
val iframe = document.select("a.link-show").attr("href").replace("http://go.akwam.im", "https://akwam.rest") + "/" + document.ownerDocument().select("input#page_id").attr("value")
|
||||||
|
val referer = response.request.url.toString()
|
||||||
|
val refererHeaders = Headers.headersOf("referer", referer)
|
||||||
|
val iframeResponse = client.newCall(GET(iframe, refererHeaders))
|
||||||
|
.execute().asJsoup()
|
||||||
|
return iframeResponse.select(videoListSelector()).map { videoFromElement(it) }
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun videoListSelector() = "source"
|
||||||
|
|
||||||
|
override fun videoFromElement(element: Element): Video {
|
||||||
|
return Video(element.attr("src").replace("https", "http"), element.attr("size") + "p", element.attr("src").replace("https", "http"), null)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun List<Video>.sort(): List<Video> {
|
||||||
|
val quality = preferences.getString("preferred_quality", null)
|
||||||
|
if (quality != null) {
|
||||||
|
val newList = mutableListOf<Video>()
|
||||||
|
var preferred = 0
|
||||||
|
for (video in this) {
|
||||||
|
if (video.quality.contains(quality)) {
|
||||||
|
newList.add(preferred, video)
|
||||||
|
preferred++
|
||||||
|
} else {
|
||||||
|
newList.add(video)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return newList
|
||||||
|
}
|
||||||
|
return this
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun videoUrlParse(document: Document) = throw Exception("not used")
|
||||||
|
|
||||||
|
// Search
|
||||||
|
|
||||||
|
override fun searchAnimeFromElement(element: Element): SAnime {
|
||||||
|
val anime = SAnime.create()
|
||||||
|
anime.thumbnail_url = element.select("picture img").attr("data-src")
|
||||||
|
anime.setUrlWithoutDomain(element.attr("href"))
|
||||||
|
anime.title = element.select("picture img").attr("alt")
|
||||||
|
return anime
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun searchAnimeNextPageSelector(): String = "ul.pagination li.page-item a[rel=next]"
|
||||||
|
|
||||||
|
override fun searchAnimeSelector(): String = "div.widget div.widget-body div.col-lg-auto div.entry-box div.entry-image a.box"
|
||||||
|
|
||||||
|
override fun searchAnimeRequest(page: Int, query: String, filters: AnimeFilterList): Request {
|
||||||
|
val url = if (query.isNotBlank()) {
|
||||||
|
val url = "$baseUrl/search?q=$query&page=$page§ion=series".toHttpUrlOrNull()!!.newBuilder()
|
||||||
|
filters.forEach { filter ->
|
||||||
|
when (filter) {
|
||||||
|
is RatingFilter -> url.addQueryParameter("rating", filter.toUriPart())
|
||||||
|
is FormatFilter -> url.addQueryParameter("formats", filter.toUriPart())
|
||||||
|
is QualityFilter -> url.addQueryParameter("quality", filter.toUriPart())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
url.toString()
|
||||||
|
} else {
|
||||||
|
val url = "$baseUrl/series?&page=$page".toHttpUrlOrNull()!!.newBuilder()
|
||||||
|
filters.forEach { filter ->
|
||||||
|
when (filter) {
|
||||||
|
is SectionSFilter -> url.addQueryParameter("section", filter.toUriPart())
|
||||||
|
is CategorySFilter -> url.addQueryParameter("category", filter.toUriPart())
|
||||||
|
is RatingSFilter -> url.addQueryParameter("rating", filter.toUriPart())
|
||||||
|
// is LanguageSFilter -> url.addQueryParameter("quality", filter.toUriPart())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
url.toString()
|
||||||
|
}
|
||||||
|
return GET(url, headers)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Anime Details
|
||||||
|
|
||||||
|
override fun animeDetailsParse(document: Document): SAnime {
|
||||||
|
val anime = SAnime.create()
|
||||||
|
// anime.thumbnail_url = document.select("div.container div div a picture > img.img-fluid").attr("data-src")
|
||||||
|
anime.title = document.select("picture > img.img-fluid").attr("alt")
|
||||||
|
anime.genre = document.select("div.font-size-16.d-flex.align-items-center.mt-3 a.badge").joinToString(", ") { it.text() }
|
||||||
|
anime.description = document.select("div.widget:contains(قصة )").text()
|
||||||
|
anime.status = SAnime.COMPLETED
|
||||||
|
return anime
|
||||||
|
}
|
||||||
|
|
||||||
|
// Latest
|
||||||
|
|
||||||
|
override fun latestUpdatesNextPageSelector(): String? = throw Exception("Not used")
|
||||||
|
|
||||||
|
override fun latestUpdatesFromElement(element: Element): SAnime = throw Exception("Not used")
|
||||||
|
|
||||||
|
override fun latestUpdatesRequest(page: Int): Request = throw Exception("Not used")
|
||||||
|
|
||||||
|
override fun latestUpdatesSelector(): String = throw Exception("Not used")
|
||||||
|
|
||||||
|
// Filters
|
||||||
|
|
||||||
|
override fun getFilterList() = AnimeFilterList(
|
||||||
|
AnimeFilter.Header("this is search Filters"),
|
||||||
|
AnimeFilter.Separator(),
|
||||||
|
RatingFilter(getRatingFilter()),
|
||||||
|
FormatFilter(getFormatFilter()),
|
||||||
|
QualityFilter(getQualityFilter()),
|
||||||
|
AnimeFilter.Separator(),
|
||||||
|
AnimeFilter.Header("this is Series Filters"),
|
||||||
|
AnimeFilter.Separator(),
|
||||||
|
SectionSFilter(getSectionSFilter()),
|
||||||
|
CategorySFilter(getCategorySFilter()),
|
||||||
|
RatingSFilter(getRatingSFilter()),
|
||||||
|
)
|
||||||
|
|
||||||
|
private class RatingFilter(vals: Array<Pair<String?, String>>) : UriPartFilter("التقييم", vals)
|
||||||
|
private class FormatFilter(vals: Array<Pair<String?, String>>) : UriPartFilter("الجودة", vals)
|
||||||
|
private class QualityFilter(vals: Array<Pair<String?, String>>) : UriPartFilter("الدقة", vals)
|
||||||
|
|
||||||
|
private class SectionSFilter(vals: Array<Pair<String?, String>>) : UriPartFilter("الأقسام", vals)
|
||||||
|
private class CategorySFilter(vals: Array<Pair<String?, String>>) : UriPartFilter("التصنيف", vals)
|
||||||
|
private class RatingSFilter(vals: Array<Pair<String?, String>>) : UriPartFilter("التقييم", vals)
|
||||||
|
|
||||||
|
private fun getRatingFilter(): Array<Pair<String?, String>> = arrayOf(
|
||||||
|
Pair("0", "التقييم"),
|
||||||
|
Pair("1", "1+"),
|
||||||
|
Pair("2", "2+"),
|
||||||
|
Pair("3", "3+"),
|
||||||
|
Pair("4", "4+"),
|
||||||
|
Pair("5", "5+"),
|
||||||
|
Pair("6", "6+"),
|
||||||
|
Pair("7", "7+"),
|
||||||
|
Pair("8", "8+"),
|
||||||
|
Pair("9", "9+")
|
||||||
|
)
|
||||||
|
|
||||||
|
private fun getFormatFilter(): Array<Pair<String?, String>> = arrayOf(
|
||||||
|
Pair("0", "الكل"),
|
||||||
|
Pair("BluRay", "BluRay"),
|
||||||
|
Pair("WebRip", "WebRip"),
|
||||||
|
Pair("BRRIP", "BRRIP"),
|
||||||
|
Pair("DVDrip", "DVDrip"),
|
||||||
|
Pair("DVDSCR", "DVDSCR"),
|
||||||
|
Pair("HD", "HD"),
|
||||||
|
Pair("HDTS", "HDTS"),
|
||||||
|
Pair("HDTV", "HDTV"),
|
||||||
|
Pair("CAM", "CAM"),
|
||||||
|
Pair("WEB-DL", "WEB-DL"),
|
||||||
|
Pair("HDTC", "HDTC"),
|
||||||
|
Pair("BDRIP", "BDRIP"),
|
||||||
|
Pair("HDRIP", "HDRIP"),
|
||||||
|
Pair("HC+HDRIP", "HC HDRIP")
|
||||||
|
)
|
||||||
|
|
||||||
|
private fun getQualityFilter(): Array<Pair<String?, String>> = arrayOf(
|
||||||
|
Pair("0", "الدقة"),
|
||||||
|
Pair("240p", "240p"),
|
||||||
|
Pair("360p", "360p"),
|
||||||
|
Pair("480p", "480p"),
|
||||||
|
Pair("720p", "720p"),
|
||||||
|
Pair("1080p", "1080p"),
|
||||||
|
Pair("3D", "3D"),
|
||||||
|
Pair("4K", "4K"),
|
||||||
|
)
|
||||||
|
|
||||||
|
private fun getSectionSFilter(): Array<Pair<String?, String>> = arrayOf(
|
||||||
|
Pair("0", "القسم"),
|
||||||
|
Pair("29", "عربي"),
|
||||||
|
Pair("30", "اجنبي"),
|
||||||
|
Pair("31", "هندي"),
|
||||||
|
Pair("32", "تركي"),
|
||||||
|
Pair("33", "اسيوي")
|
||||||
|
)
|
||||||
|
|
||||||
|
private fun getCategorySFilter(): Array<Pair<String?, String>> = arrayOf(
|
||||||
|
Pair("0", "التصنيف"),
|
||||||
|
Pair("87", "رمضان"),
|
||||||
|
Pair("30", "انمي"),
|
||||||
|
Pair("18", "اكشن"),
|
||||||
|
Pair("71", "مدبلج"),
|
||||||
|
Pair("72", "NETFLIX"),
|
||||||
|
Pair("20", "كوميدي"),
|
||||||
|
Pair("35", "اثارة"),
|
||||||
|
Pair("34", "غموض"),
|
||||||
|
Pair("33", "عائلي"),
|
||||||
|
Pair("88", "اطفال"),
|
||||||
|
Pair("25", "حربي"),
|
||||||
|
Pair("32", "رياضي"),
|
||||||
|
Pair("89", "قصير"),
|
||||||
|
Pair("43", "فانتازيا"),
|
||||||
|
Pair("24", "خيال علمي"),
|
||||||
|
Pair("31", "موسيقى"),
|
||||||
|
Pair("29", "سيرة ذاتية"),
|
||||||
|
Pair("28", "وثائقي"),
|
||||||
|
Pair("27", "رومانسي"),
|
||||||
|
Pair("26", "تاريخي"),
|
||||||
|
Pair("23", "دراما"),
|
||||||
|
Pair("22", "رعب"),
|
||||||
|
Pair("21", "جريمة"),
|
||||||
|
Pair("19", "مغامرة"),
|
||||||
|
Pair("91", "غربي")
|
||||||
|
)
|
||||||
|
|
||||||
|
private fun getRatingSFilter(): Array<Pair<String?, String>> = arrayOf(
|
||||||
|
Pair("0", "التقييم"),
|
||||||
|
Pair("1", "1+"),
|
||||||
|
Pair("2", "2+"),
|
||||||
|
Pair("3", "3+"),
|
||||||
|
Pair("4", "4+"),
|
||||||
|
Pair("5", "5+"),
|
||||||
|
Pair("6", "6+"),
|
||||||
|
Pair("7", "7+"),
|
||||||
|
Pair("8", "8+"),
|
||||||
|
Pair("9", "9+")
|
||||||
|
)
|
||||||
|
|
||||||
|
open class UriPartFilter(displayName: String, private val vals: Array<Pair<String?, String>>) :
|
||||||
|
AnimeFilter.Select<String>(displayName, vals.map { it.second }.toTypedArray()) {
|
||||||
|
fun toUriPart() = vals[state].first
|
||||||
|
}
|
||||||
|
|
||||||
|
// preferred quality settings
|
||||||
|
|
||||||
|
override fun setupPreferenceScreen(screen: PreferenceScreen) {
|
||||||
|
val videoQualityPref = ListPreference(screen.context).apply {
|
||||||
|
key = "preferred_quality"
|
||||||
|
title = "Preferred quality"
|
||||||
|
entries = arrayOf("1080p", "720p", "480p", "360p", "240p")
|
||||||
|
entryValues = arrayOf("1080", "720", "480", "360", "240")
|
||||||
|
setDefaultValue("1080")
|
||||||
|
summary = "%s"
|
||||||
|
|
||||||
|
setOnPreferenceChangeListener { _, newValue ->
|
||||||
|
val selected = newValue as String
|
||||||
|
val index = findIndexOfValue(selected)
|
||||||
|
val entry = entryValues[index] as String
|
||||||
|
preferences.edit().putString(key, entry).commit()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
screen.addPreference(videoQualityPref)
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue
Block a user