asianload, dramacool: fix streamsb extractor (#314)
* Update build.gradle * try to fix sb extractor * asianLoad: try to fix sb extractor
This commit is contained in:
@ -5,7 +5,7 @@ ext {
|
||||
extName = 'AsianLoad'
|
||||
pkgNameSuffix = 'en.asianload'
|
||||
extClass = '.AsianLoad'
|
||||
extVersionCode = 3
|
||||
extVersionCode = 4
|
||||
libVersion = '12'
|
||||
}
|
||||
|
||||
|
@ -127,6 +127,9 @@ class AsianLoad : ConfigurableAnimeSource, ParsedAnimeHttpSource() {
|
||||
val callMaster = client.newCall(GET(master, nheaders)).execute().asJsoup()
|
||||
Log.i("testt", "$callMaster")*/
|
||||
val headers = headers.newBuilder()
|
||||
// .set("Referer", "https://sbplay2.com/")
|
||||
.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("watchsb", "streamsb")
|
||||
.build()
|
||||
val videos = StreamSBExtractor(client).videosFromUrl(url, headers)
|
||||
@ -255,8 +258,8 @@ class AsianLoad : ConfigurableAnimeSource, ParsedAnimeHttpSource() {
|
||||
val videoQualityPref = ListPreference(screen.context).apply {
|
||||
key = "preferred_quality"
|
||||
title = "Preferred quality"
|
||||
entries = arrayOf("1080p", "720p", "480p", "360p")
|
||||
entryValues = arrayOf("1080", "720", "480", "360")
|
||||
entries = arrayOf("1080p", "720p", "480p", "360p", "Doodstream", "StreamTape")
|
||||
entryValues = arrayOf("1080", "720", "480", "360", "Doodstream", "StreamTape")
|
||||
setDefaultValue("1080")
|
||||
summary = "%s"
|
||||
|
||||
|
@ -30,14 +30,18 @@ class StreamSBExtractor(private val client: OkHttpClient) {
|
||||
val bytes = id.toByteArray()
|
||||
val bytesToHex = bytesToHex(bytes)
|
||||
val master = "https://sbplay2.com/sourcesx38/7361696b6f757c7c${bytesToHex}7c7c7361696b6f757c7c73747265616d7362/7361696b6f757c7c363136653639366436343663363136653639366436343663376337633631366536393664363436633631366536393664363436633763376336313665363936643634366336313665363936643634366337633763373337343732363536313664373336327c7c7361696b6f757c7c73747265616d7362"
|
||||
val json = Json.decodeFromString<JsonObject>(Jsoup.connect(master).ignoreContentType(true).header("watchsb", "streamsb").execute().body())
|
||||
//"https://sbplay2.com/sourcesx38/4f395a53447166635a3836787c7c${bytesToHex}7c7c7965344f61436d467845586c7c7c73747265616d7362/6e56314c77564e6a6c6631737c7c333735383537363836633662373635323636376133343637376337633335346334343332353735343333366633343635346336383763376334313561373633343761346133303665363837363537353937633763373337343732363536313664373336327c7c395239444c3961626d634e6a7c7c73747265616d7362"
|
||||
val json = Json.decodeFromString<JsonObject>(
|
||||
Jsoup.connect(master).ignoreContentType(true).header("watchsb", "streamsb").header("accept-language", "en-US,en;q=0.5").header("Referer", url).header("User-Agent", "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:96.0) Gecko/20100101 Firefox/96.0")
|
||||
.execute().body()
|
||||
)
|
||||
val masterUrl = json["stream_data"]!!.jsonObject["file"].toString().trim('"')
|
||||
val masterPlaylist = client.newCall(GET(masterUrl)).execute().body!!.string()
|
||||
val masterPlaylist = client.newCall(GET(masterUrl, headers)).execute().body!!.string()
|
||||
val videoList = mutableListOf<Video>()
|
||||
masterPlaylist.substringAfter("#EXT-X-STREAM-INF:").split("#EXT-X-STREAM-INF:").forEach {
|
||||
val quality = "StreamSB:" + it.substringAfter("RESOLUTION=").substringAfter("x").substringBefore(",") + "p"
|
||||
val videoUrl = it.substringAfter("\n").substringBefore("\n")
|
||||
videoList.add(Video(videoUrl, quality, videoUrl, null))
|
||||
videoList.add(Video(videoUrl, quality, videoUrl, null, headers))
|
||||
}
|
||||
return videoList
|
||||
}
|
||||
|
@ -5,7 +5,7 @@ ext {
|
||||
extName = 'DramaCool'
|
||||
pkgNameSuffix = 'en.dramacool'
|
||||
extClass = '.DramaCool'
|
||||
extVersionCode = 3
|
||||
extVersionCode = 4
|
||||
libVersion = '12'
|
||||
}
|
||||
|
||||
|
@ -116,6 +116,9 @@ class DramaCool : ConfigurableAnimeSource, ParsedAnimeHttpSource() {
|
||||
val callMaster = client.newCall(GET(master, nheaders)).execute().asJsoup()
|
||||
Log.i("testt", "$callMaster")*/
|
||||
val headers = headers.newBuilder()
|
||||
// .set("Referer", "https://sbplay2.com/")
|
||||
.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("watchsb", "streamsb")
|
||||
.build()
|
||||
val videos = StreamSBExtractor(client).videosFromUrl(url, headers)
|
||||
@ -216,8 +219,8 @@ class DramaCool : ConfigurableAnimeSource, ParsedAnimeHttpSource() {
|
||||
val videoQualityPref = ListPreference(screen.context).apply {
|
||||
key = "preferred_quality"
|
||||
title = "Preferred quality"
|
||||
entries = arrayOf("1080p", "720p", "480p", "360p")
|
||||
entryValues = arrayOf("1080", "720", "480", "360")
|
||||
entries = arrayOf("1080p", "720p", "480p", "360p", "Doodstream", "StreamTape")
|
||||
entryValues = arrayOf("1080", "720", "480", "360", "Doodstream", "StreamTape")
|
||||
setDefaultValue("1080")
|
||||
summary = "%s"
|
||||
|
||||
|
@ -30,14 +30,18 @@ class StreamSBExtractor(private val client: OkHttpClient) {
|
||||
val bytes = id.toByteArray()
|
||||
val bytesToHex = bytesToHex(bytes)
|
||||
val master = "https://sbplay2.com/sourcesx38/7361696b6f757c7c${bytesToHex}7c7c7361696b6f757c7c73747265616d7362/7361696b6f757c7c363136653639366436343663363136653639366436343663376337633631366536393664363436633631366536393664363436633763376336313665363936643634366336313665363936643634366337633763373337343732363536313664373336327c7c7361696b6f757c7c73747265616d7362"
|
||||
val json = Json.decodeFromString<JsonObject>(Jsoup.connect(master).ignoreContentType(true).header("watchsb", "streamsb").execute().body())
|
||||
//"https://sbplay2.com/sourcesx38/4f395a53447166635a3836787c7c${bytesToHex}7c7c7965344f61436d467845586c7c7c73747265616d7362/6e56314c77564e6a6c6631737c7c333735383537363836633662373635323636376133343637376337633335346334343332353735343333366633343635346336383763376334313561373633343761346133303665363837363537353937633763373337343732363536313664373336327c7c395239444c3961626d634e6a7c7c73747265616d7362"
|
||||
val json = Json.decodeFromString<JsonObject>(
|
||||
Jsoup.connect(master).ignoreContentType(true).header("watchsb", "streamsb").header("accept-language", "en-US,en;q=0.5").header("Referer", url).header("User-Agent", "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:96.0) Gecko/20100101 Firefox/96.0")
|
||||
.execute().body()
|
||||
)
|
||||
val masterUrl = json["stream_data"]!!.jsonObject["file"].toString().trim('"')
|
||||
val masterPlaylist = client.newCall(GET(masterUrl)).execute().body!!.string()
|
||||
val masterPlaylist = client.newCall(GET(masterUrl, headers)).execute().body!!.string()
|
||||
val videoList = mutableListOf<Video>()
|
||||
masterPlaylist.substringAfter("#EXT-X-STREAM-INF:").split("#EXT-X-STREAM-INF:").forEach {
|
||||
val quality = "StreamSB:" + it.substringAfter("RESOLUTION=").substringAfter("x").substringBefore(",") + "p"
|
||||
val videoUrl = it.substringAfter("\n").substringBefore("\n")
|
||||
videoList.add(Video(videoUrl, quality, videoUrl, null))
|
||||
videoList.add(Video(videoUrl, quality, videoUrl, null, headers))
|
||||
}
|
||||
return videoList
|
||||
}
|
||||
|
Reference in New Issue
Block a user