Skip to content

Commit

Permalink
Merge pull request #85 from Dark25/Hikari-fix
Browse files Browse the repository at this point in the history
feat(src/all): Implement universal on Hikari
  • Loading branch information
Dark25 authored Sep 17, 2024
2 parents c3679be + dd5e72b commit 37c87ac
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ kotlin-json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", ver
coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "coroutines_version" }
coroutines-android = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-android", version.ref = "coroutines_version" }

injekt-core = { module = "com.github.inorichi.injekt:injekt-core", version = "65b0440" }
injekt-core = { module = "com.github.mihonapp:injekt", version = "91edab2317" }
rxjava = { module = "io.reactivex:rxjava", version = "1.3.8" }
jsoup = { module = "org.jsoup:jsoup", version = "1.18.1" }
okhttp = { module = "com.squareup.okhttp3:okhttp", version = "5.0.0-alpha.14" }
Expand Down
3 changes: 2 additions & 1 deletion src/all/hikari/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
ext {
extName = 'Hikari'
extClass = '.Hikari'
extVersionCode = 8
extVersionCode = 9
}

apply from: "$rootDir/common.gradle"

dependencies {
implementation(project(':lib:filemoon-extractor'))
implementation(project(':lib:vidhide-extractor'))
implementation(project(':lib:universal-extractor'))
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import eu.kanade.tachiyomi.animesource.model.SEpisode
import eu.kanade.tachiyomi.animesource.model.Video
import eu.kanade.tachiyomi.animesource.online.ParsedAnimeHttpSource
import eu.kanade.tachiyomi.lib.filemoonextractor.FilemoonExtractor
import eu.kanade.tachiyomi.lib.universalextractor.UniversalExtractor
import eu.kanade.tachiyomi.lib.vidhideextractor.VidHideExtractor
import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.util.parallelCatchingFlatMapBlocking
Expand Down Expand Up @@ -218,6 +219,7 @@ class Hikari : ParsedAnimeHttpSource(), ConfigurableAnimeSource {

private val filemoonExtractor by lazy { FilemoonExtractor(client) }
private val vidHideExtractor by lazy { VidHideExtractor(client, headers) }
private val universalExtractor by lazy { UniversalExtractor(client) }
private val embedRegex = Regex("""getEmbed\(\s*(\d+)\s*,\s*(\d+)\s*,\s*'(\d+)'""")

override fun videoListRequest(episode: SEpisode): Request {
Expand Down Expand Up @@ -336,10 +338,8 @@ class Hikari : ParsedAnimeHttpSource(), ConfigurableAnimeSource {

private fun getVideosFromEmbed(embedUrl: String, name: String): List<Video> = when {
name.contains("vidhide", true) -> vidHideExtractor.videosFromUrl(embedUrl, videoNameGen = { s -> "$name - $s" })
embedUrl.contains("filemoon", true) -> {
filemoonExtractor.videosFromUrl(embedUrl, prefix = "$name - ", headers = headers)
}
else -> emptyList()
embedUrl.contains("filemoon", true) -> filemoonExtractor.videosFromUrl(embedUrl, prefix = "$name - ", headers = headers)
else -> universalExtractor.videosFromUrl(embedUrl, headers, prefix = name)
}

override fun videoListSelector() = ".server-item:has(a[onclick~=getEmbed])"
Expand Down

0 comments on commit 37c87ac

Please sign in to comment.