Skip to content

Commit

Permalink
fix(ar/animeblkom): Fix video extractor + add new domain (#2633)
Browse files Browse the repository at this point in the history
  • Loading branch information
Claudemirovsky authored Dec 11, 2023
1 parent a24cafd commit 3c08ce6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
3 changes: 1 addition & 2 deletions src/ar/animeblkom/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,13 @@ ext {
extName = 'أنمي بالكوم'
pkgNameSuffix = 'ar.animeblkom'
extClass = '.AnimeBlkom'
extVersionCode = 15
extVersionCode = 16
libVersion = '13'
}

dependencies {
implementation(project(':lib-mp4upload-extractor'))
implementation(project(":lib-okru-extractor"))
implementation("dev.datlag.jsunpacker:jsunpacker:1.0.1")
}

apply from: "$rootDir/common.gradle"
Original file line number Diff line number Diff line change
Expand Up @@ -146,16 +146,19 @@ class AnimeBlkom : ConfigurableAnimeSource, ParsedAnimeHttpSource() {
}
}

private val okruExtractor by lazy { OkruExtractor(client) }
private val mp4uploadExtractor by lazy { Mp4uploadExtractor(client) }

private fun extractVideos(element: Element): List<Video> {
val url = element.attr("data-src").replace("http://", "https://")
return when {
"new.vid4up" in url -> {
val urlResponse = client.newCall(GET(url, headers))
.execute().asJsoup()
urlResponse.select(videoListSelector()).map(::videoFromElement)
".vid4up" in url || "Blkom" in element.text() -> {
val videoDoc = client.newCall(GET(url, headers)).execute()
.use { it.asJsoup() }
videoDoc.select(videoListSelector()).map(::videoFromElement)
}
"ok.ru" in url -> OkruExtractor(client).videosFromUrl(url)
"mp4upload" in url -> Mp4uploadExtractor(client).videosFromUrl(url, headers)
"ok.ru" in url -> okruExtractor.videosFromUrl(url)
"mp4upload" in url -> mp4uploadExtractor.videosFromUrl(url, headers)
else -> emptyList()
}
}
Expand All @@ -164,7 +167,7 @@ class AnimeBlkom : ConfigurableAnimeSource, ParsedAnimeHttpSource() {

override fun videoFromElement(element: Element): Video {
val videoUrl = element.attr("src")
return Video(videoUrl, "Blkbom - " + element.attr("label"), videoUrl, headers = headers)
return Video(videoUrl, "Blkom - " + element.attr("label"), videoUrl, headers)
}

override fun videoUrlParse(document: Document) = throw Exception("not used")
Expand Down Expand Up @@ -243,7 +246,7 @@ class AnimeBlkom : ConfigurableAnimeSource, ParsedAnimeHttpSource() {
private const val PREF_DOMAIN_KEY = "pref_domain_key"
private const val PREF_DOMAIN_TITLE = "Preferred domain"
private const val PREF_DOMAIN_DEFAULT = "https://animeblkom.net"
private val PREF_DOMAIN_ENTRIES = arrayOf("animeblkom.net", "blkom.com")
private val PREF_DOMAIN_ENTRIES = arrayOf("animeblkom.net", "animeblkom.tv", "blkom.com")
private val PREF_DOMAIN_VALUES by lazy {
PREF_DOMAIN_ENTRIES.map { "https://$it" }.toTypedArray()
}
Expand Down

0 comments on commit 3c08ce6

Please sign in to comment.