Skip to content

Commit

Permalink
rename paramter
Browse files Browse the repository at this point in the history
  • Loading branch information
LuftVerbot committed Oct 14, 2023
1 parent 349ad9e commit 834f1fa
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class PlaylistUtils(private val client: OkHttpClient, private val headers: Heade
fun extractFromHls(
playlistUrl: String,
referer: String = "",
mB: Boolean = true,
baseOnOff: Boolean = true,
masterHeaders: Headers,
videoHeaders: Headers,
videoNameGen: (String) -> String = { quality -> quality },
Expand All @@ -40,7 +40,7 @@ class PlaylistUtils(private val client: OkHttpClient, private val headers: Heade
return extractFromHls(
playlistUrl,
referer,
mB,
baseOnOff,
{ _, _ -> masterHeaders },
{ _, _, _ -> videoHeaders },
videoNameGen,
Expand Down Expand Up @@ -73,7 +73,7 @@ class PlaylistUtils(private val client: OkHttpClient, private val headers: Heade
fun extractFromHls(
playlistUrl: String,
referer: String = "",
mB: Boolean = true,
baseOnOff: Boolean = true,
masterHeadersGen: (Headers, String) -> Headers = { baseHeaders, referer ->
generateMasterHeaders(baseHeaders, referer)
},
Expand All @@ -100,7 +100,7 @@ class PlaylistUtils(private val client: OkHttpClient, private val headers: Heade

val playlistHttpUrl = playlistUrl.toHttpUrl()

val masterBase = if(mB) {
val masterBase = if(baseOnOff) {
playlistHttpUrl.newBuilder().apply {
removePathSegment(playlistHttpUrl.pathSize - 1)
}.build().toString() + "/"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import eu.kanade.tachiyomi.util.asJsoup
import okhttp3.Headers
import okhttp3.OkHttpClient

class StreamWishExtractor(private val client: OkHttpClient, private val headers: Headers, private val mB: Boolean = true) {
class StreamWishExtractor(private val client: OkHttpClient, private val headers: Headers, private val baseOnOff: Boolean = true) {
private val playlistUtils by lazy { PlaylistUtils(client, headers) }

fun videosFromUrl(url: String, prefix: String) = videosFromUrl(url) { "$prefix - $it" }
Expand All @@ -31,6 +31,6 @@ class StreamWishExtractor(private val client: OkHttpClient, private val headers:
?.takeIf(String::isNotBlank)
?: return emptyList()

return playlistUtils.extractFromHls(masterUrl, url, videoNameGen = videoNameGen, mB = mB)
return playlistUtils.extractFromHls(masterUrl, url, videoNameGen = videoNameGen, baseOnOff = baseOnOff)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ class MoflixStream : ConfigurableAnimeSource, AnimeHttpSource() {
videoList.addAll(videos)
}
host.contains("Filelions") && hosterSelection?.contains("flions") == true -> {
val videos = StreamWishExtractor(client, headers, mB = false).videosFromUrl(eUrl, videoNameGen = { quality -> "FileLions - $quality" })
val videos = StreamWishExtractor(client, headers, baseOnOff = false).videosFromUrl(eUrl, videoNameGen = { quality -> "FileLions - $quality" })
videoList.addAll(videos)
}
host.contains("LuluStream") && hosterSelection?.contains("lstream") == true -> {
Expand Down Expand Up @@ -235,7 +235,7 @@ class MoflixStream : ConfigurableAnimeSource, AnimeHttpSource() {
videoList.addAll(videos)
}
host.contains("Filelions") && hosterSelection?.contains("flions") == true -> {
val videos = StreamWishExtractor(client, headers, mB = false).videosFromUrl(fUrl, videoNameGen = { quality -> "FileLions - $quality" })
val videos = StreamWishExtractor(client, headers, baseOnOff = false).videosFromUrl(fUrl, videoNameGen = { quality -> "FileLions - $quality" })
videoList.addAll(videos)
}
host.contains("VidGuard") && hosterSelection?.contains("vidg") == true -> {
Expand Down

0 comments on commit 834f1fa

Please sign in to comment.