[PelisPLusHD] Fix StreamSB extractor, fix videourl extractor and add StreamTape ext… (#462)
* Fix StreamSB extractor, fix videourl extractor and add StreamTape extractor * Update build.gradle
This commit is contained in:
committed by
GitHub
parent
02a580610a
commit
f9267d4237
@ -5,7 +5,7 @@ ext {
|
|||||||
extName = 'Pelisplushd'
|
extName = 'Pelisplushd'
|
||||||
pkgNameSuffix = 'es.pelisplushd'
|
pkgNameSuffix = 'es.pelisplushd'
|
||||||
extClass = '.Pelisplushd'
|
extClass = '.Pelisplushd'
|
||||||
extVersionCode = 5
|
extVersionCode = 6
|
||||||
libVersion = '12'
|
libVersion = '12'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,6 +8,7 @@ import androidx.preference.PreferenceScreen
|
|||||||
import eu.kanade.tachiyomi.animeextension.es.pelisplushd.extractors.DoodExtractor
|
import eu.kanade.tachiyomi.animeextension.es.pelisplushd.extractors.DoodExtractor
|
||||||
import eu.kanade.tachiyomi.animeextension.es.pelisplushd.extractors.FembedExtractor
|
import eu.kanade.tachiyomi.animeextension.es.pelisplushd.extractors.FembedExtractor
|
||||||
import eu.kanade.tachiyomi.animeextension.es.pelisplushd.extractors.StreamSBExtractor
|
import eu.kanade.tachiyomi.animeextension.es.pelisplushd.extractors.StreamSBExtractor
|
||||||
|
import eu.kanade.tachiyomi.animeextension.es.pelisplushd.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.AnimeFilter
|
||||||
import eu.kanade.tachiyomi.animesource.model.AnimeFilterList
|
import eu.kanade.tachiyomi.animesource.model.AnimeFilterList
|
||||||
@ -20,7 +21,6 @@ import eu.kanade.tachiyomi.util.asJsoup
|
|||||||
import okhttp3.OkHttpClient
|
import okhttp3.OkHttpClient
|
||||||
import okhttp3.Request
|
import okhttp3.Request
|
||||||
import okhttp3.Response
|
import okhttp3.Response
|
||||||
import org.jsoup.Jsoup
|
|
||||||
import org.jsoup.nodes.Document
|
import org.jsoup.nodes.Document
|
||||||
import org.jsoup.nodes.Element
|
import org.jsoup.nodes.Element
|
||||||
import uy.kohesive.injekt.Injekt
|
import uy.kohesive.injekt.Injekt
|
||||||
@ -97,39 +97,50 @@ class Pelisplushd : ConfigurableAnimeSource, ParsedAnimeHttpSource() {
|
|||||||
document.select("ul.TbVideoNv li").forEach { it ->
|
document.select("ul.TbVideoNv li").forEach { it ->
|
||||||
val server = it.select("a").text()
|
val server = it.select("a").text()
|
||||||
val option = it.attr("data-id")
|
val option = it.attr("data-id")
|
||||||
document.select("script").forEach() { script ->
|
Log.i("bruh", "$option : $server")
|
||||||
if (script.data().contains("video[1] =")) {
|
document.select("div.page-container div#link_url span").forEach() { servers ->
|
||||||
|
|
||||||
if (server == "PlusTo") {
|
|
||||||
val iframeUrl = script.data().substringAfter("video[$option] = '").substringBefore("';")
|
|
||||||
val jsoup = Jsoup.connect(iframeUrl).get()
|
|
||||||
val url = jsoup.select("iframe").attr("src").replace("#caption=&poster=#", "")
|
|
||||||
Log.i("bruh", "$url")
|
|
||||||
|
|
||||||
|
if (servers.attr("lid") == option && server == "PlusTo") {
|
||||||
|
val url = servers.attr("url")
|
||||||
|
Log.i("bruh", "id:${servers.attr("lid")} server:$server Url: $url")
|
||||||
val videos = FembedExtractor().videosFromUrl(url)
|
val videos = FembedExtractor().videosFromUrl(url)
|
||||||
videoList.addAll(videos)
|
videoList.addAll(videos)
|
||||||
}
|
}
|
||||||
if (server == "DoodStream") {
|
//probably the conditions are redundant idk
|
||||||
val url = script.data().substringAfter("video[$option] = '").substringBefore("';")
|
if (servers.attr("lid") == option && server == "DoFast" || servers.attr("lid") == option && server == "DoodStream") {
|
||||||
|
val url = servers.attr("url").replace("doodstream.com", "dood.so")
|
||||||
|
Log.i("bruh", "id:${servers.attr("lid")} server:$server Url1: $url")
|
||||||
val video = try { DoodExtractor(client).videoFromUrl(url, "DoodStream") } catch (e: Exception) { null }
|
val video = try { DoodExtractor(client).videoFromUrl(url, "DoodStream") } catch (e: Exception) { null }
|
||||||
if (video != null) {
|
if (video != null) {
|
||||||
videoList.add(video)
|
videoList.add(video)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (server == "SBFast") {
|
if (servers.attr("lid") == option && server == "FastTape" || servers.attr("lid") == option && server == "StreamTape") {
|
||||||
val url = script.data().substringAfter("video[$option] = '").substringBefore("';")
|
val url = servers.attr("url")
|
||||||
|
Log.i("bruh", "id:${servers.attr("lid")} server:$server Url1: $url")
|
||||||
|
val video = StreamTapeExtractor(client).videoFromUrl(url, "StreamTape")
|
||||||
|
if (video != null) {
|
||||||
|
videoList.add(video)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (servers.attr("lid") == option && server == "SBFast" || servers.attr("lid") == option && server == "SBFas") {
|
||||||
|
val url = servers.attr("url")
|
||||||
|
Log.i("bruh", "id:${servers.attr("lid")} server:$server Url2: $url")
|
||||||
val headers = headers.newBuilder()
|
val headers = headers.newBuilder()
|
||||||
.set("Referer", url)
|
.set("Referer", url)
|
||||||
.set("User-Agent", "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:96.0) Gecko/20100101 Firefox/96.0")
|
.set("User-Agent", "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:96.0) Gecko/20100101 Firefox/96.0")
|
||||||
.set("Accept-Language", "en-US,en;q=0.5")
|
.set("Accept-Language", "en-US,en;q=0.5")
|
||||||
.set("watchsb", "streamsb")
|
.set("watchsb", "streamsb")
|
||||||
.build()
|
.build()
|
||||||
val video = StreamSBExtractor(client).videosFromUrl(url, headers)
|
val video = try { StreamSBExtractor(client).videosFromUrl(url, headers) } catch (e: Exception) { null }
|
||||||
|
if (video != null) {
|
||||||
videoList.addAll(video)
|
videoList.addAll(video)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return videoList
|
return videoList
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ class StreamSBExtractor(private val client: OkHttpClient) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun videosFromUrl(url: String, headers: Headers): List<Video> {
|
fun videosFromUrl(url: String, headers: Headers): List<Video> {
|
||||||
val id = url.substringAfter("embed-").substringBefore(".html")
|
val id = url.substringAfter("embed-").substringBefore(".html").substringAfter("/e/")
|
||||||
Log.i("id", id)
|
Log.i("id", id)
|
||||||
val bytes = id.toByteArray()
|
val bytes = id.toByteArray()
|
||||||
Log.i("bytes", "$bytes")
|
Log.i("bytes", "$bytes")
|
||||||
|
@ -0,0 +1,18 @@
|
|||||||
|
package eu.kanade.tachiyomi.animeextension.es.pelisplushd.extractors
|
||||||
|
|
||||||
|
import eu.kanade.tachiyomi.animesource.model.Video
|
||||||
|
import eu.kanade.tachiyomi.network.GET
|
||||||
|
import eu.kanade.tachiyomi.util.asJsoup
|
||||||
|
import okhttp3.OkHttpClient
|
||||||
|
|
||||||
|
class StreamTapeExtractor(private val client: OkHttpClient) {
|
||||||
|
fun videoFromUrl(url: String, quality: String): Video? {
|
||||||
|
val document = client.newCall(GET(url)).execute().asJsoup()
|
||||||
|
val script = document.select("script:containsData(document.getElementById('robotlink'))")
|
||||||
|
.firstOrNull()?.data()?.substringAfter("document.getElementById('robotlink').innerHTML = '")
|
||||||
|
?: return null
|
||||||
|
val videoUrl = "https:" + script.substringBefore("'") +
|
||||||
|
script.substringAfter("+ ('xcd").substringBefore("'")
|
||||||
|
return Video(url, quality, videoUrl, null)
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue
Block a user