feat(src/fr): New source: HDS (#3081)
Co-authored-by: Secozzi <49240133+Secozzi@users.noreply.github.com>
This commit is contained in:
14
src/fr/hds/build.gradle
Normal file
14
src/fr/hds/build.gradle
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
ext {
|
||||||
|
extName = 'HDS'
|
||||||
|
extClass = '.Hds'
|
||||||
|
themePkg = 'dooplay'
|
||||||
|
baseUrl = 'https://www.hds.quest'
|
||||||
|
overrideVersionCode = 0
|
||||||
|
}
|
||||||
|
|
||||||
|
apply from: "$rootDir/common.gradle"
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
implementation(project(':lib:filemoon-extractor'))
|
||||||
|
implementation(project(':lib:streamhidevid-extractor'))
|
||||||
|
}
|
BIN
src/fr/hds/res/mipmap-hdpi/ic_launcher.png
Normal file
BIN
src/fr/hds/res/mipmap-hdpi/ic_launcher.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.2 KiB |
BIN
src/fr/hds/res/mipmap-mdpi/ic_launcher.png
Normal file
BIN
src/fr/hds/res/mipmap-mdpi/ic_launcher.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.8 KiB |
BIN
src/fr/hds/res/mipmap-xhdpi/ic_launcher.png
Normal file
BIN
src/fr/hds/res/mipmap-xhdpi/ic_launcher.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.0 KiB |
BIN
src/fr/hds/res/mipmap-xxhdpi/ic_launcher.png
Normal file
BIN
src/fr/hds/res/mipmap-xxhdpi/ic_launcher.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.2 KiB |
BIN
src/fr/hds/res/mipmap-xxxhdpi/ic_launcher.png
Normal file
BIN
src/fr/hds/res/mipmap-xxxhdpi/ic_launcher.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 9.0 KiB |
@ -0,0 +1,75 @@
|
|||||||
|
package eu.kanade.tachiyomi.animeextension.fr.hds
|
||||||
|
|
||||||
|
import eu.kanade.tachiyomi.animesource.model.SAnime
|
||||||
|
import eu.kanade.tachiyomi.animesource.model.Video
|
||||||
|
import eu.kanade.tachiyomi.lib.filemoonextractor.FilemoonExtractor
|
||||||
|
import eu.kanade.tachiyomi.lib.streamhidevidextractor.StreamHideVidExtractor
|
||||||
|
import eu.kanade.tachiyomi.multisrc.dooplay.DooPlay
|
||||||
|
import eu.kanade.tachiyomi.network.GET
|
||||||
|
import eu.kanade.tachiyomi.util.asJsoup
|
||||||
|
import eu.kanade.tachiyomi.util.parallelCatchingFlatMapBlocking
|
||||||
|
import kotlinx.serialization.SerialName
|
||||||
|
import kotlinx.serialization.Serializable
|
||||||
|
import kotlinx.serialization.json.Json
|
||||||
|
import okhttp3.Response
|
||||||
|
import org.jsoup.nodes.Document
|
||||||
|
import uy.kohesive.injekt.injectLazy
|
||||||
|
|
||||||
|
class Hds : DooPlay(
|
||||||
|
"fr",
|
||||||
|
"HDS",
|
||||||
|
"https://www.hds.quest",
|
||||||
|
) {
|
||||||
|
|
||||||
|
private val json: Json by injectLazy()
|
||||||
|
|
||||||
|
// ============================== Popular ===============================
|
||||||
|
override fun popularAnimeRequest(page: Int) = GET("$baseUrl/tendance/page/$page/", headers)
|
||||||
|
|
||||||
|
override fun popularAnimeSelector() = latestUpdatesSelector()
|
||||||
|
|
||||||
|
override fun popularAnimeNextPageSelector() = "#nextpagination"
|
||||||
|
|
||||||
|
// =============================== Latest ===============================
|
||||||
|
override val supportsLatest = false
|
||||||
|
|
||||||
|
// =============================== Search ===============================
|
||||||
|
override fun searchAnimeNextPageSelector() = popularAnimeNextPageSelector()
|
||||||
|
|
||||||
|
// ============================== Filters ===============================
|
||||||
|
override fun genresListSelector() = ".genres.scrolling li a"
|
||||||
|
|
||||||
|
// =========================== Anime Details ============================
|
||||||
|
override fun animeDetailsParse(document: Document) = super.animeDetailsParse(document).apply {
|
||||||
|
if (document.select(".dt-breadcrumb li:nth-child(2)").text() == "Films") {
|
||||||
|
status = SAnime.COMPLETED
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ============================ Video Links =============================
|
||||||
|
@Serializable
|
||||||
|
data class VideoLinkDTO(@SerialName("embed_url") val url: String)
|
||||||
|
|
||||||
|
private val fileMoonExtractor by lazy { FilemoonExtractor(client) }
|
||||||
|
private val streamHideVidExtractor by lazy { StreamHideVidExtractor(client) }
|
||||||
|
|
||||||
|
override fun videoListParse(response: Response): List<Video> {
|
||||||
|
val document = response.asJsoup()
|
||||||
|
val players = document.select("#playeroptions li:not(#player-option-trailer)")
|
||||||
|
return players.parallelCatchingFlatMapBlocking { it ->
|
||||||
|
val post = it.attr("data-post")
|
||||||
|
val nume = it.attr("data-nume")
|
||||||
|
val type = it.attr("data-type")
|
||||||
|
val raw = client.newCall(GET("$baseUrl/wp-json/dooplayer/v1/post/$post?type=$type&source=$nume", headers))
|
||||||
|
.execute()
|
||||||
|
.body.string()
|
||||||
|
val securedUrl = json.decodeFromString<VideoLinkDTO>(raw).url
|
||||||
|
val playerUrl = client.newCall(GET(securedUrl, headers)).execute().use { it.request.url.toString() }
|
||||||
|
when {
|
||||||
|
playerUrl.contains("sentinel") -> fileMoonExtractor.videosFromUrl(playerUrl)
|
||||||
|
playerUrl.contains("hdsplay.online") -> streamHideVidExtractor.videosFromUrl(playerUrl)
|
||||||
|
else -> emptyList()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue
Block a user