fixes in [MonosChinos] , [AnimeOnlineNinja] and [LegionAnime] (#1228)
This commit is contained in:
committed by
GitHub
parent
c3645048c8
commit
0b574a910f
@ -5,7 +5,7 @@ ext {
|
||||
extName = 'AnimeonlineNinja'
|
||||
pkgNameSuffix = 'es.animeonlineninja'
|
||||
extClass = '.AnimeonlineNinja'
|
||||
extVersionCode = 16
|
||||
extVersionCode = 17
|
||||
libVersion = '13'
|
||||
}
|
||||
|
||||
|
@ -66,16 +66,18 @@ class AnimeonlineNinja : ConfigurableAnimeSource, ParsedAnimeHttpSource() {
|
||||
|
||||
if (url.contains("/pelicula/")) {
|
||||
document.select("ul#playeroptionsul li").forEach {
|
||||
val epNum = it.attr("data-nume").toFloat()
|
||||
val epName = it.select("span.title").text()
|
||||
if (it.attr("data-nume").toFloatOrNull() != null) {
|
||||
val epNum = it.attr("data-nume").toFloat()
|
||||
val epName = it.select("span.title").text()
|
||||
|
||||
val episode = SEpisode.create().apply {
|
||||
episode_number = epNum
|
||||
name = epName
|
||||
setUrlWithoutDomain("$url?$epNum")
|
||||
val episode = SEpisode.create().apply {
|
||||
episode_number = epNum
|
||||
name = epName
|
||||
setUrlWithoutDomain("$url?$epNum")
|
||||
}
|
||||
|
||||
episodes.add(episode)
|
||||
}
|
||||
|
||||
episodes.add(episode)
|
||||
}
|
||||
return episodes
|
||||
}
|
||||
|
@ -5,7 +5,7 @@ ext {
|
||||
extName = 'LegionAnime'
|
||||
pkgNameSuffix = 'es.legionanime'
|
||||
extClass = '.LegionAnime'
|
||||
extVersionCode = 8
|
||||
extVersionCode = 9
|
||||
libVersion = '13'
|
||||
}
|
||||
|
||||
|
@ -5,6 +5,7 @@ import android.content.SharedPreferences
|
||||
import androidx.preference.ListPreference
|
||||
import androidx.preference.PreferenceScreen
|
||||
import eu.kanade.tachiyomi.animeextension.es.legionanime.extractors.JkanimeExtractor
|
||||
import eu.kanade.tachiyomi.animeextension.es.legionanime.extractors.Mp4uploadExtractor
|
||||
import eu.kanade.tachiyomi.animeextension.es.legionanime.extractors.YourUploadExtractor
|
||||
import eu.kanade.tachiyomi.animeextension.es.legionanime.extractors.ZippyExtractor
|
||||
import eu.kanade.tachiyomi.animesource.ConfigurableAnimeSource
|
||||
@ -63,7 +64,7 @@ class LegionAnime : ConfigurableAnimeSource, ParsedAnimeHttpSource() {
|
||||
val jsonResponse = json.decodeFromString<JsonObject>(document.body().text())["response"]!!.jsonObject
|
||||
val anime = jsonResponse["anime"]!!.jsonObject
|
||||
val studioId = anime["studios"]!!.jsonPrimitive.content.split(",")
|
||||
val studio = studioId.map { id -> studiosMap.filter { it.value == id.toInt() }.keys.first() }
|
||||
val studio = try { studioId.map { id -> studiosMap.filter { it.value == id.toInt() }.keys.first() } } catch (e: Exception) { emptyList() }
|
||||
return SAnime.create().apply {
|
||||
title = anime["name"]!!.jsonPrimitive.content
|
||||
description = anime["synopsis"]!!.jsonPrimitive.content
|
||||
@ -239,6 +240,10 @@ class LegionAnime : ConfigurableAnimeSource, ParsedAnimeHttpSource() {
|
||||
val videoUrl = hostUrl + videoUrlD
|
||||
videoList.add(Video(videoUrl, server, videoUrl))
|
||||
}
|
||||
url.contains("mp4upload") -> {
|
||||
val videoHeaders = headersBuilder().add("Referer", "https://mp4upload.com/").build()
|
||||
videoList.add(Mp4uploadExtractor().getVideoFromUrl(url, videoHeaders))
|
||||
}
|
||||
}
|
||||
} catch (_: Exception) {
|
||||
// ignore
|
||||
|
@ -4,6 +4,14 @@ import eu.kanade.tachiyomi.animesource.model.Video
|
||||
import okhttp3.Headers
|
||||
import org.jsoup.Connection
|
||||
import org.jsoup.Jsoup
|
||||
import java.security.KeyManagementException
|
||||
import java.security.NoSuchAlgorithmException
|
||||
import java.security.SecureRandom
|
||||
import java.security.cert.X509Certificate
|
||||
import javax.net.ssl.SSLContext
|
||||
import javax.net.ssl.SSLSocketFactory
|
||||
import javax.net.ssl.TrustManager
|
||||
import javax.net.ssl.X509TrustManager
|
||||
|
||||
class Mp4uploadExtractor {
|
||||
fun getVideoFromUrl(url: String, headers: Headers): Video {
|
||||
@ -19,10 +27,30 @@ class Mp4uploadExtractor {
|
||||
"method_premiun" to "",
|
||||
)
|
||||
).method(Connection.Method.POST).ignoreContentType(true)
|
||||
.ignoreHttpErrors(true).execute().url().toString()
|
||||
.ignoreHttpErrors(true).sslSocketFactory(this.socketFactory()).execute().url().toString()
|
||||
Video(videoUrl, "Mp4Upload", videoUrl, headers)
|
||||
} catch (e: Exception) {
|
||||
Video("", "", "")
|
||||
}
|
||||
}
|
||||
|
||||
fun socketFactory(): SSLSocketFactory {
|
||||
val trustAllCerts = arrayOf<TrustManager>(
|
||||
object : X509TrustManager {
|
||||
override fun getAcceptedIssuers() = arrayOf<X509Certificate>()
|
||||
override fun checkClientTrusted(certs: Array<X509Certificate>, authType: String) {}
|
||||
override fun checkServerTrusted(certs: Array<X509Certificate>, authType: String) {}
|
||||
}
|
||||
)
|
||||
|
||||
return try {
|
||||
val sslContext: SSLContext = SSLContext.getInstance("SSL")
|
||||
sslContext.init(null, trustAllCerts, SecureRandom())
|
||||
sslContext.socketFactory
|
||||
} catch (e: NoSuchAlgorithmException) {
|
||||
throw RuntimeException("Failed to create a SSL socket factory", e)
|
||||
} catch (e: KeyManagementException) {
|
||||
throw RuntimeException("Failed to create a SSL socket factory", e)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -5,7 +5,7 @@ ext {
|
||||
extName = 'MonosChinos'
|
||||
pkgNameSuffix = 'es.monoschinos'
|
||||
extClass = '.MonosChinos'
|
||||
extVersionCode = 18
|
||||
extVersionCode = 19
|
||||
libVersion = '13'
|
||||
}
|
||||
|
||||
|
@ -3,6 +3,7 @@ package eu.kanade.tachiyomi.animeextension.es.monoschinos
|
||||
import android.app.Application
|
||||
import android.content.SharedPreferences
|
||||
import android.util.Base64
|
||||
import android.util.Log
|
||||
import androidx.preference.ListPreference
|
||||
import androidx.preference.PreferenceScreen
|
||||
import eu.kanade.tachiyomi.animeextension.es.monoschinos.extractors.Mp4uploadExtractor
|
||||
@ -87,21 +88,22 @@ class MonosChinos : ConfigurableAnimeSource, ParsedAnimeHttpSource() {
|
||||
// val server = it.select("a").text()
|
||||
val urlBase64 = it.select("a").attr("data-player")
|
||||
val url = Base64.decode(urlBase64, Base64.DEFAULT).toString(Charsets.UTF_8).substringAfter("=")
|
||||
when {
|
||||
url.contains("fembed") -> videoList.addAll(FembedExtractor(client).videosFromUrl(url))
|
||||
url.contains("ok") -> if (!url.contains("streamcherry")) videoList.addAll(OkruExtractor(client).videosFromUrl(url))
|
||||
url.contains("solidfiles") -> videoList.addAll(SolidFilesExtractor(client).videosFromUrl(url))
|
||||
url.contains("uqload") -> {
|
||||
val video = UploadExtractor(client).videoFromUrl(url, headers)
|
||||
if (video != null) videoList.add(video)
|
||||
when {
|
||||
url.contains("fembed") -> videoList.addAll(FembedExtractor(client).videosFromUrl(url))
|
||||
url.contains("ok") -> if (!url.contains("streamcherry")) videoList.addAll(OkruExtractor(client).videosFromUrl(url))
|
||||
url.contains("solidfiles") -> videoList.addAll(SolidFilesExtractor(client).videosFromUrl(url))
|
||||
url.contains("uqload") -> {
|
||||
val video = UploadExtractor(client).videoFromUrl(url, headers)
|
||||
if (video != null) videoList.add(video)
|
||||
}
|
||||
url.contains("mp4upload") -> {
|
||||
val videoHeaders = headersBuilder().add("Referer", "https://mp4upload.com/").build()
|
||||
videoList.add(Mp4uploadExtractor().getVideoFromUrl(url, videoHeaders))
|
||||
}
|
||||
}
|
||||
url.contains("mp4upload") -> {
|
||||
val videoHeaders = headersBuilder().add("Referer", "https://mp4upload.com/").build()
|
||||
videoList.add(Mp4uploadExtractor().getVideoFromUrl(url, videoHeaders))
|
||||
}
|
||||
}
|
||||
}
|
||||
return videoList
|
||||
|
||||
return videoList.filter { video -> video.url.contains("http") }
|
||||
}
|
||||
|
||||
override fun videoListSelector() = throw Exception("not used")
|
||||
@ -132,7 +134,7 @@ class MonosChinos : ConfigurableAnimeSource, ParsedAnimeHttpSource() {
|
||||
}
|
||||
|
||||
override fun searchAnimeRequest(page: Int, query: String, filters: AnimeFilterList): Request {
|
||||
val genreFilter = filters.find { it is GenreFilter } as GenreFilter
|
||||
val genreFilter = (filters.find { it is GenreFilter } as? GenreFilter?) ?: GenreFilter()
|
||||
val yearFilter = try {
|
||||
(filters.find { it is YearFilter } as YearFilter).state.toInt()
|
||||
} catch (e: Exception) {
|
||||
|
@ -4,6 +4,14 @@ import eu.kanade.tachiyomi.animesource.model.Video
|
||||
import okhttp3.Headers
|
||||
import org.jsoup.Connection
|
||||
import org.jsoup.Jsoup
|
||||
import java.security.KeyManagementException
|
||||
import java.security.NoSuchAlgorithmException
|
||||
import java.security.SecureRandom
|
||||
import java.security.cert.X509Certificate
|
||||
import javax.net.ssl.SSLContext
|
||||
import javax.net.ssl.SSLSocketFactory
|
||||
import javax.net.ssl.TrustManager
|
||||
import javax.net.ssl.X509TrustManager
|
||||
|
||||
class Mp4uploadExtractor {
|
||||
fun getVideoFromUrl(url: String, headers: Headers): Video {
|
||||
@ -19,10 +27,29 @@ class Mp4uploadExtractor {
|
||||
"method_premiun" to "",
|
||||
)
|
||||
).method(Connection.Method.POST).ignoreContentType(true)
|
||||
.ignoreHttpErrors(true).execute().url().toString()
|
||||
.ignoreHttpErrors(true).sslSocketFactory(this.socketFactory()).execute().url().toString()
|
||||
Video(videoUrl, "Mp4Upload", videoUrl, headers)
|
||||
} catch (e: Exception) {
|
||||
Video("", "", "")
|
||||
}
|
||||
}
|
||||
fun socketFactory(): SSLSocketFactory {
|
||||
val trustAllCerts = arrayOf<TrustManager>(
|
||||
object : X509TrustManager {
|
||||
override fun getAcceptedIssuers() = arrayOf<X509Certificate>()
|
||||
override fun checkClientTrusted(certs: Array<X509Certificate>, authType: String) {}
|
||||
override fun checkServerTrusted(certs: Array<X509Certificate>, authType: String) {}
|
||||
}
|
||||
)
|
||||
|
||||
return try {
|
||||
val sslContext: SSLContext = SSLContext.getInstance("SSL")
|
||||
sslContext.init(null, trustAllCerts, SecureRandom())
|
||||
sslContext.socketFactory
|
||||
} catch (e: NoSuchAlgorithmException) {
|
||||
throw RuntimeException("Failed to create a SSL socket factory", e)
|
||||
} catch (e: KeyManagementException) {
|
||||
throw RuntimeException("Failed to create a SSL socket factory", e)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -11,6 +11,10 @@ class UploadExtractor(private val client: OkHttpClient) {
|
||||
return try {
|
||||
val document = client.newCall(GET(url)).execute().asJsoup()
|
||||
val basicUrl = document.selectFirst("script:containsData(var player =)").data().substringAfter("sources: [\"").substringBefore("\"],")
|
||||
|
||||
if (!basicUrl.contains("http")) {
|
||||
return null
|
||||
}
|
||||
return Video(basicUrl, "Uqload", basicUrl, headers = headers)
|
||||
} catch (e: Exception) {
|
||||
null
|
||||
|
Reference in New Issue
Block a user