Skip to content

Commit

Permalink
fix(es/animeflv): Change server info (#2927)
Browse files Browse the repository at this point in the history
  • Loading branch information
ludg1e authored Feb 14, 2024
1 parent bb79f8b commit 5fc0ba8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import eu.kanade.tachiyomi.util.asJsoup
import okhttp3.OkHttpClient

class StreamTapeExtractor(private val client: OkHttpClient) {
fun videoFromUrl(url: String, quality: String = "StreamTape", subtitleList: List<Track> = emptyList()): Video? {
fun videoFromUrl(url: String, quality: String = "Streamtape", subtitleList: List<Track> = emptyList()): Video? {
val baseUrl = "https://streamtape.com/e/"
val newUrl = if (!url.startsWith(baseUrl)) {
// ["https", "", "<domain>", "<???>", "<id>", ...]
Expand All @@ -27,7 +27,7 @@ class StreamTapeExtractor(private val client: OkHttpClient) {
return Video(videoUrl, quality, videoUrl, subtitleTracks = subtitleList)
}

fun videosFromUrl(url: String, quality: String = "StreamTape", subtitleList: List<Track> = emptyList()): List<Video> {
fun videosFromUrl(url: String, quality: String = "Streamtape", subtitleList: List<Track> = emptyList()): List<Video> {
return videoFromUrl(url, quality, subtitleList)?.let(::listOf).orEmpty()
}
}
3 changes: 1 addition & 2 deletions src/es/animeflv/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ext {
extName = 'AnimeFLV'
extClass = '.AnimeFlv'
extVersionCode = 52
extVersionCode = 53
}

apply from: "$rootDir/common.gradle"
Expand All @@ -10,6 +10,5 @@ dependencies {
implementation(project(':lib:yourupload-extractor'))
implementation(project(':lib:streamtape-extractor'))
implementation(project(':lib:okru-extractor'))
implementation(project(':lib:dood-extractor'))
implementation(project(':lib:streamwish-extractor'))
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import eu.kanade.tachiyomi.animesource.model.SAnime
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.doodextractor.DoodExtractor
import eu.kanade.tachiyomi.lib.okruextractor.OkruExtractor
import eu.kanade.tachiyomi.lib.streamtapeextractor.StreamTapeExtractor
import eu.kanade.tachiyomi.lib.streamwishextractor.StreamWishExtractor
Expand Down Expand Up @@ -50,12 +49,12 @@ class AnimeFlv : ConfigurableAnimeSource, ParsedAnimeHttpSource() {

companion object {
private const val PREF_QUALITY_KEY = "preferred_quality"
private const val PREF_QUALITY_DEFAULT = "1080"
private const val PREF_QUALITY_DEFAULT = "480"
private val QUALITY_LIST = arrayOf("1080", "720", "480", "360")

private const val PREF_SERVER_KEY = "preferred_server"
private const val PREF_SERVER_DEFAULT = "YourUpload"
private val SERVER_LIST = arrayOf("MailRu", "Okru", "YourUpload", "DoodStream", "StreamTape")
private const val PREF_SERVER_DEFAULT = "StreamWish"
private val SERVER_LIST = arrayOf("StreamWish", "YourUpload", "Okru", "Streamtape")
}

override fun popularAnimeSelector(): String = "div.Container ul.ListAnimes li article"
Expand Down Expand Up @@ -123,14 +122,13 @@ class AnimeFlv : ConfigurableAnimeSource, ParsedAnimeHttpSource() {
val stapeUrl = json!!["url"]!!.jsonPrimitive!!.content
StreamTapeExtractor(client).videoFromUrl(stapeUrl)?.let(::listOf)
}
"Doodstream" -> DoodExtractor(client).videoFromUrl(url, "DoodStream", false)?.let(::listOf)
"Okru" -> OkruExtractor(client).videosFromUrl(url)
"YourUpload" -> YourUploadExtractor(client).videoFromUrl(url, headers = headers)
"SW" -> {
val docHeaders = headers.newBuilder()
.add("Referer", "$baseUrl/")
.build()
StreamWishExtractor(client, docHeaders).videosFromUrl(url, videoNameGen = { "StreamWish:$it" })
StreamWishExtractor(client, docHeaders).videosFromUrl(url, videoNameGen = { "StreamWish: $it" })
}
else -> null
}
Expand Down

0 comments on commit 5fc0ba8

Please sign in to comment.