Fembed extractor updated & LocoPelis updates (#1124)
- Functionality for the Fembed extractor to redirect to a mirror link and then extract the videos.
This commit is contained in:
@ -1,14 +1,20 @@
|
|||||||
package eu.kanade.tachiyomi.lib.fembedextractor
|
package eu.kanade.tachiyomi.lib.fembedextractor
|
||||||
|
|
||||||
import eu.kanade.tachiyomi.animesource.model.Video
|
import eu.kanade.tachiyomi.animesource.model.Video
|
||||||
|
import eu.kanade.tachiyomi.network.GET
|
||||||
import eu.kanade.tachiyomi.network.POST
|
import eu.kanade.tachiyomi.network.POST
|
||||||
import kotlinx.serialization.decodeFromString
|
import kotlinx.serialization.decodeFromString
|
||||||
import kotlinx.serialization.json.Json
|
import kotlinx.serialization.json.Json
|
||||||
import okhttp3.OkHttpClient
|
import okhttp3.OkHttpClient
|
||||||
|
|
||||||
class FembedExtractor(private val client: OkHttpClient) {
|
class FembedExtractor(private val client: OkHttpClient) {
|
||||||
fun videosFromUrl(url: String, prefix: String = ""): List<Video> {
|
fun videosFromUrl(url: String, prefix: String = "", redirect: Boolean = false): List<Video> {
|
||||||
val videoApi = url.replace("/v/", "/api/source/")
|
val videoApi = if (redirect) {
|
||||||
|
(runCatching { client.newCall(GET(url)).execute().request.url.toString()
|
||||||
|
.replace("/v/", "/api/source/") }.getOrNull() ?: return emptyList<Video>())
|
||||||
|
} else {
|
||||||
|
url.replace("/v/", "/api/source/")
|
||||||
|
}
|
||||||
val body = runCatching {
|
val body = runCatching {
|
||||||
client.newCall(POST(videoApi)).execute().body?.string().orEmpty()
|
client.newCall(POST(videoApi)).execute().body?.string().orEmpty()
|
||||||
}.getOrNull() ?: return emptyList<Video>()
|
}.getOrNull() ?: return emptyList<Video>()
|
||||||
|
@ -5,7 +5,7 @@ ext {
|
|||||||
extName = 'LocoPelis'
|
extName = 'LocoPelis'
|
||||||
pkgNameSuffix = 'es.locopelis'
|
pkgNameSuffix = 'es.locopelis'
|
||||||
extClass = '.LocoPelis'
|
extClass = '.LocoPelis'
|
||||||
extVersionCode = 1
|
extVersionCode = 2
|
||||||
libVersion = '13'
|
libVersion = '13'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -126,7 +126,7 @@ class LocoPelis : ConfigurableAnimeSource, ParsedAnimeHttpSource() {
|
|||||||
embedUrl.contains("diampokusy.com") || embedUrl.contains("i18n.pw") || embedUrl.contains("vanfem.com") ||
|
embedUrl.contains("diampokusy.com") || embedUrl.contains("i18n.pw") || embedUrl.contains("vanfem.com") ||
|
||||||
embedUrl.contains("fembed9hd.com") || embedUrl.contains("votrefilms.xyz") || embedUrl.contains("watchjavnow.xyz")
|
embedUrl.contains("fembed9hd.com") || embedUrl.contains("votrefilms.xyz") || embedUrl.contains("watchjavnow.xyz")
|
||||||
) {
|
) {
|
||||||
val videos = FembedExtractor(client).videosFromUrl(url)
|
val videos = FembedExtractor(client).videosFromUrl(url, redirect = true)
|
||||||
videoList.addAll(videos)
|
videoList.addAll(videos)
|
||||||
}
|
}
|
||||||
if (url.lowercase().contains("streamtape")) {
|
if (url.lowercase().contains("streamtape")) {
|
||||||
|
Reference in New Issue
Block a user