animeflv: add streamtape extractor (#185)
This commit is contained in:
committed by
GitHub
parent
ff1e3ddbd1
commit
fb7f3029e4
@ -5,7 +5,7 @@ ext {
|
|||||||
extName = 'AnimeFLV'
|
extName = 'AnimeFLV'
|
||||||
pkgNameSuffix = 'es.animeflv'
|
pkgNameSuffix = 'es.animeflv'
|
||||||
extClass = '.AnimeFlv'
|
extClass = '.AnimeFlv'
|
||||||
extVersionCode = 3
|
extVersionCode = 4
|
||||||
libVersion = '12'
|
libVersion = '12'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,6 +5,7 @@ import android.content.SharedPreferences
|
|||||||
import android.util.Log
|
import android.util.Log
|
||||||
import androidx.preference.ListPreference
|
import androidx.preference.ListPreference
|
||||||
import androidx.preference.PreferenceScreen
|
import androidx.preference.PreferenceScreen
|
||||||
|
import com.github.salomonbrys.kotson.get
|
||||||
import com.google.gson.JsonParser
|
import com.google.gson.JsonParser
|
||||||
import eu.kanade.tachiyomi.animesource.ConfigurableAnimeSource
|
import eu.kanade.tachiyomi.animesource.ConfigurableAnimeSource
|
||||||
import eu.kanade.tachiyomi.animesource.model.AnimeFilterList
|
import eu.kanade.tachiyomi.animesource.model.AnimeFilterList
|
||||||
@ -22,6 +23,7 @@ import org.jsoup.nodes.Element
|
|||||||
import uy.kohesive.injekt.Injekt
|
import uy.kohesive.injekt.Injekt
|
||||||
import uy.kohesive.injekt.api.get
|
import uy.kohesive.injekt.api.get
|
||||||
import java.lang.Exception
|
import java.lang.Exception
|
||||||
|
import java.net.URL
|
||||||
|
|
||||||
class AnimeFlv : ConfigurableAnimeSource, ParsedAnimeHttpSource() {
|
class AnimeFlv : ConfigurableAnimeSource, ParsedAnimeHttpSource() {
|
||||||
|
|
||||||
@ -100,6 +102,10 @@ class AnimeFlv : ConfigurableAnimeSource, ParsedAnimeHttpSource() {
|
|||||||
for (server in sub.asJsonArray) {
|
for (server in sub.asJsonArray) {
|
||||||
val url = server.asJsonObject.get("code").asString.replace("\\/", "/")
|
val url = server.asJsonObject.get("code").asString.replace("\\/", "/")
|
||||||
val quality = server.asJsonObject.get("title").asString
|
val quality = server.asJsonObject.get("title").asString
|
||||||
|
if (quality == "Stape") {
|
||||||
|
val videos = getStapeVideos(url)
|
||||||
|
videoList += videos
|
||||||
|
}
|
||||||
if (quality == "Okru") {
|
if (quality == "Okru") {
|
||||||
val videos = getOkruVideos(url)
|
val videos = getOkruVideos(url)
|
||||||
videoList += videos
|
videoList += videos
|
||||||
@ -117,6 +123,43 @@ class AnimeFlv : ConfigurableAnimeSource, ParsedAnimeHttpSource() {
|
|||||||
|
|
||||||
override fun videoFromElement(element: Element) = throw Exception("not used")
|
override fun videoFromElement(element: Element) = throw Exception("not used")
|
||||||
|
|
||||||
|
// this code is trash but work
|
||||||
|
private fun getStapeVideos(url: String): List<Video> {
|
||||||
|
val videoList = mutableListOf<Video>()
|
||||||
|
val url5 = url.replace("https://streamtape.com/e/", "")
|
||||||
|
val url6 = url5.replace("/", "")
|
||||||
|
val document = client.newCall(GET("https://api.streamtape.com/file/dlticket?file=$url6&login=ef23317a52e4442dbdd3&key=mydvdBk717tb08Y")).execute().asJsoup()
|
||||||
|
val test22 = document.body().text()
|
||||||
|
val test23 = JsonParser.parseString(test22).asJsonObject
|
||||||
|
val test24 = test23.get("result").get("ticket").toString().replace("\"", "")
|
||||||
|
val test80 = test24
|
||||||
|
val url80 = "https://api.streamtape.com/file/dl?file=$url6&ticket=$test24&captcha_response={captcha_response}".replace("={captcha_response}", "={captcha_response}")
|
||||||
|
Log.i("stapeee", url80)
|
||||||
|
val document2 = client.newCall(GET(url80)).execute().asJsoup()
|
||||||
|
//I don't know how to make it wait 5 seconds, but this worked for some reason
|
||||||
|
val jsjs = URL(url80).readText()
|
||||||
|
val jsjs1 = URL(url80).readText()
|
||||||
|
val jsjs2 = URL(url80).readText()
|
||||||
|
val jsjs3 = URL(url80).readText()
|
||||||
|
URL(url80).readText()
|
||||||
|
URL(url80).readText()
|
||||||
|
URL(url80).readText()
|
||||||
|
URL(url80).readText()
|
||||||
|
URL(url80).readText()
|
||||||
|
URL(url80).readText()
|
||||||
|
URL(url80).readText()
|
||||||
|
URL(url80).readText()
|
||||||
|
URL(url80).readText()
|
||||||
|
val jsjs4 = URL(url80).readText()
|
||||||
|
val test29 = document2.body().text()
|
||||||
|
Log.i("stapeee", jsjs4)
|
||||||
|
val test30 = JsonParser.parseString(jsjs4).asJsonObject
|
||||||
|
val test31 = test30.get("result").get("url").toString().replace("\"", "")
|
||||||
|
Log.i("stapeee", test31)
|
||||||
|
videoList.add(Video(test31, "Stape", test31, null))
|
||||||
|
return videoList
|
||||||
|
}
|
||||||
|
|
||||||
private fun getOkruVideos(url: String): List<Video> {
|
private fun getOkruVideos(url: String): List<Video> {
|
||||||
val document = client.newCall(GET(url)).execute().asJsoup()
|
val document = client.newCall(GET(url)).execute().asJsoup()
|
||||||
Log.i("bruuh", document.select("div[data-options]").attr("data-options"))
|
Log.i("bruuh", document.select("div[data-options]").attr("data-options"))
|
||||||
|
Reference in New Issue
Block a user