fix(all/hiraki): Partial fix for Hikari source #444
2 changed files with 12 additions and 7 deletions
|
@ -1,13 +1,14 @@
|
|||
ext {
|
||||
extName = 'Hikari'
|
||||
extClass = '.Hikari'
|
||||
extVersionCode = 11
|
||||
extVersionCode = 12
|
||||
}
|
||||
|
||||
apply from: "$rootDir/common.gradle"
|
||||
|
||||
dependencies {
|
||||
implementation(project(':lib:filemoon-extractor'))
|
||||
implementation(project(':lib:vidhide-extractor'))
|
||||
implementation(project(':lib:chillx-extractor'))
|
||||
implementation(project(':lib:filemoon-extractor'))
|
||||
implementation(project(':lib:streamwish-extractor'))
|
||||
implementation(project(':lib:vidhide-extractor'))
|
||||
}
|
|
@ -14,6 +14,7 @@ import eu.kanade.tachiyomi.animesource.model.Video
|
|||
import eu.kanade.tachiyomi.animesource.online.ParsedAnimeHttpSource
|
||||
import eu.kanade.tachiyomi.lib.chillxextractor.ChillxExtractor
|
||||
import eu.kanade.tachiyomi.lib.filemoonextractor.FilemoonExtractor
|
||||
import eu.kanade.tachiyomi.lib.streamwishextractor.StreamWishExtractor
|
||||
import eu.kanade.tachiyomi.lib.vidhideextractor.VidHideExtractor
|
||||
import eu.kanade.tachiyomi.network.GET
|
||||
import eu.kanade.tachiyomi.util.parallelCatchingFlatMapBlocking
|
||||
|
@ -220,6 +221,7 @@ class Hikari : ParsedAnimeHttpSource(), ConfigurableAnimeSource {
|
|||
private val filemoonExtractor by lazy { FilemoonExtractor(client) }
|
||||
private val vidHideExtractor by lazy { VidHideExtractor(client, headers) }
|
||||
private val chillxExtractor by lazy { ChillxExtractor(client, headers) }
|
||||
private val streamwishExtractor by lazy { StreamWishExtractor(client, headers) }
|
||||
private val embedRegex = Regex("""getEmbed\(\s*(\d+)\s*,\s*(\d+)\s*,\s*'(\d+)'""")
|
||||
|
||||
override fun videoListRequest(episode: SEpisode): Request {
|
||||
|
@ -328,17 +330,19 @@ class Hikari : ParsedAnimeHttpSource(), ConfigurableAnimeSource {
|
|||
}.filter { it.first.isNotEmpty() }
|
||||
}
|
||||
|
||||
val embedUrls = sdEmbedUrls.ifEmpty {
|
||||
subEmbedUrls + dubEmbedUrls
|
||||
}
|
||||
return embedUrls.parallelCatchingFlatMapBlocking {
|
||||
return sdEmbedUrls.parallelCatchingFlatMapBlocking {
|
||||
getVideosFromEmbed(it.first, it.second)
|
||||
}.ifEmpty {
|
||||
(subEmbedUrls + dubEmbedUrls).parallelCatchingFlatMapBlocking {
|
||||
getVideosFromEmbed(it.first, it.second)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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)
|
||||
name.contains("streamwish", true) -> streamwishExtractor.videosFromUrl(embedUrl, prefix = "$name - ")
|
||||
else -> chillxExtractor.videoFromUrl(embedUrl, referer = baseUrl, prefix = "$name - ")
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue