vidembed: fix some errors
This commit is contained in:
@ -5,7 +5,7 @@ ext {
|
|||||||
extName = 'Vidembed'
|
extName = 'Vidembed'
|
||||||
pkgNameSuffix = 'en.vidembed'
|
pkgNameSuffix = 'en.vidembed'
|
||||||
extClass = '.Vidembed'
|
extClass = '.Vidembed'
|
||||||
extVersionCode = 1
|
extVersionCode = 2
|
||||||
libVersion = '12'
|
libVersion = '12'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,6 +3,7 @@ package eu.kanade.tachiyomi.animeextension.en.vidembed
|
|||||||
import android.app.Application
|
import android.app.Application
|
||||||
import android.content.SharedPreferences
|
import android.content.SharedPreferences
|
||||||
import android.net.Uri
|
import android.net.Uri
|
||||||
|
import android.util.Log
|
||||||
import androidx.preference.ListPreference
|
import androidx.preference.ListPreference
|
||||||
import androidx.preference.PreferenceScreen
|
import androidx.preference.PreferenceScreen
|
||||||
import eu.kanade.tachiyomi.animesource.ConfigurableAnimeSource
|
import eu.kanade.tachiyomi.animesource.ConfigurableAnimeSource
|
||||||
@ -96,8 +97,12 @@ class Vidembed : ConfigurableAnimeSource, ParsedAnimeHttpSource() {
|
|||||||
when {
|
when {
|
||||||
url.contains("https://dood") -> {
|
url.contains("https://dood") -> {
|
||||||
val newQuality = "Doodstream mirror"
|
val newQuality = "Doodstream mirror"
|
||||||
val video = Video(url, newQuality, doodUrlParse(url), null, videoHeaders)
|
val video = try {
|
||||||
videoList.add(video)
|
Video(url, newQuality, doodUrlParse(url), null, videoHeaders)
|
||||||
|
} catch (e: Exception) {
|
||||||
|
null
|
||||||
|
}
|
||||||
|
if (video != null) videoList.add(video)
|
||||||
}
|
}
|
||||||
url.contains("https://sbplay") -> {
|
url.contains("https://sbplay") -> {
|
||||||
val videos = sbplayUrlParse(url, location)
|
val videos = sbplayUrlParse(url, location)
|
||||||
@ -152,19 +157,24 @@ class Vidembed : ConfigurableAnimeSource, ParsedAnimeHttpSource() {
|
|||||||
"https://sbplay2.com/dl?op=download_orig&id=$id&mode=$mode&hash=$hash"
|
"https://sbplay2.com/dl?op=download_orig&id=$id&mode=$mode&hash=$hash"
|
||||||
respDownloadLinkSelector.close()
|
respDownloadLinkSelector.close()
|
||||||
val video = sbplayVideoParser(downloadLink, quality)
|
val video = sbplayVideoParser(downloadLink, quality)
|
||||||
videoList.add(video)
|
if (video != null) videoList.add(video)
|
||||||
}
|
}
|
||||||
return videoList
|
return videoList
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun sbplayVideoParser(url: String, quality: String): Video {
|
private fun sbplayVideoParser(url: String, quality: String): Video? {
|
||||||
val noRedirectClient = client.newBuilder().followRedirects(false).build()
|
try {
|
||||||
val refererHeader = Headers.headersOf("Referer", url)
|
val noRedirectClient = client.newBuilder().followRedirects(false).build()
|
||||||
val respDownloadLink = noRedirectClient.newCall(GET(url, refererHeader)).execute()
|
val refererHeader = Headers.headersOf("Referer", url)
|
||||||
val documentDownloadLink = respDownloadLink.asJsoup()
|
val respDownloadLink = noRedirectClient.newCall(GET(url, refererHeader)).execute()
|
||||||
val downloadLink = documentDownloadLink.selectFirst("div.contentbox span a").attr("href")
|
val documentDownloadLink = respDownloadLink.asJsoup()
|
||||||
respDownloadLink.close()
|
Log.i("bruh", url)
|
||||||
return Video(url, quality, downloadLink, null, refererHeader)
|
val downloadLink = documentDownloadLink.selectFirst("div.contentbox span a").attr("href")
|
||||||
|
respDownloadLink.close()
|
||||||
|
return Video(url, quality, downloadLink, null, refererHeader)
|
||||||
|
} catch (e: Exception) {
|
||||||
|
return null
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun doodUrlParse(url: String): String? {
|
private fun doodUrlParse(url: String): String? {
|
||||||
|
Reference in New Issue
Block a user