Merge branch 'recloudstream:master' into master
This commit is contained in:
commit
d8d6a3945f
|
@ -166,7 +166,8 @@ object CommonActivity {
|
||||||
"Light" -> R.style.LightMode
|
"Light" -> R.style.LightMode
|
||||||
"Amoled" -> R.style.AmoledMode
|
"Amoled" -> R.style.AmoledMode
|
||||||
"AmoledLight" -> R.style.AmoledModeLight
|
"AmoledLight" -> R.style.AmoledModeLight
|
||||||
"Monet" -> R.style.MonetMode
|
"Monet" -> if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S)
|
||||||
|
R.style.MonetMode else R.style.AppTheme
|
||||||
else -> R.style.AppTheme
|
else -> R.style.AppTheme
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -189,8 +190,10 @@ object CommonActivity {
|
||||||
"Banana" -> R.style.OverlayPrimaryColorBanana
|
"Banana" -> R.style.OverlayPrimaryColorBanana
|
||||||
"Party" -> R.style.OverlayPrimaryColorParty
|
"Party" -> R.style.OverlayPrimaryColorParty
|
||||||
"Pink" -> R.style.OverlayPrimaryColorPink
|
"Pink" -> R.style.OverlayPrimaryColorPink
|
||||||
"Monet" -> R.style.OverlayPrimaryColorMonet
|
"Monet" -> if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S)
|
||||||
"Monet2" -> R.style.OverlayPrimaryColorMonetTwo
|
R.style.OverlayPrimaryColorMonet else R.style.OverlayPrimaryColorNormal
|
||||||
|
"Monet2" -> if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S)
|
||||||
|
R.style.OverlayPrimaryColorMonetTwo else R.style.OverlayPrimaryColorNormal
|
||||||
else -> R.style.OverlayPrimaryColorNormal
|
else -> R.style.OverlayPrimaryColorNormal
|
||||||
}
|
}
|
||||||
act.theme.applyStyle(currentTheme, true)
|
act.theme.applyStyle(currentTheme, true)
|
||||||
|
|
|
@ -3,10 +3,9 @@ package com.lagradost.cloudstream3.extractors
|
||||||
import com.lagradost.cloudstream3.SubtitleFile
|
import com.lagradost.cloudstream3.SubtitleFile
|
||||||
import com.lagradost.cloudstream3.apmap
|
import com.lagradost.cloudstream3.apmap
|
||||||
import com.lagradost.cloudstream3.app
|
import com.lagradost.cloudstream3.app
|
||||||
import com.lagradost.cloudstream3.utils.ExtractorApi
|
import com.lagradost.cloudstream3.utils.*
|
||||||
import com.lagradost.cloudstream3.utils.ExtractorLink
|
import kotlinx.coroutines.delay
|
||||||
import com.lagradost.cloudstream3.utils.M3u8Helper
|
import java.net.URI
|
||||||
import com.lagradost.cloudstream3.utils.loadExtractor
|
|
||||||
|
|
||||||
class VidSrcExtractor2 : VidSrcExtractor() {
|
class VidSrcExtractor2 : VidSrcExtractor() {
|
||||||
override val mainUrl = "https://vidsrc.me/embed"
|
override val mainUrl = "https://vidsrc.me/embed"
|
||||||
|
@ -27,6 +26,25 @@ open class VidSrcExtractor : ExtractorApi() {
|
||||||
override val mainUrl = "$absoluteUrl/embed"
|
override val mainUrl = "$absoluteUrl/embed"
|
||||||
override val requiresReferer = false
|
override val requiresReferer = false
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
/** Infinite function to validate the vidSrc pass */
|
||||||
|
suspend fun validatePass(url: String) {
|
||||||
|
val uri = URI(url)
|
||||||
|
val host = uri.host
|
||||||
|
|
||||||
|
// Basically turn https://tm3p.vidsrc.stream/ -> https://vidsrc.stream/
|
||||||
|
val referer = host.split(".").let {
|
||||||
|
val size = it.size
|
||||||
|
"https://" + it.subList(maxOf(0, size - 2), size).joinToString(".") + "/"
|
||||||
|
}
|
||||||
|
|
||||||
|
while (true) {
|
||||||
|
app.get(url, referer = referer)
|
||||||
|
delay(60_000)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
override suspend fun getUrl(
|
override suspend fun getUrl(
|
||||||
url: String,
|
url: String,
|
||||||
referer: String?,
|
referer: String?,
|
||||||
|
@ -40,7 +58,10 @@ open class VidSrcExtractor : ExtractorApi() {
|
||||||
val datahash = it.attr("data-hash")
|
val datahash = it.attr("data-hash")
|
||||||
if (datahash.isNotBlank()) {
|
if (datahash.isNotBlank()) {
|
||||||
val links = try {
|
val links = try {
|
||||||
app.get("$absoluteUrl/src/$datahash", referer = "https://source.vidsrc.me/").url
|
app.get(
|
||||||
|
"$absoluteUrl/src/$datahash",
|
||||||
|
referer = "https://source.vidsrc.me/"
|
||||||
|
).url
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
""
|
""
|
||||||
}
|
}
|
||||||
|
@ -54,11 +75,28 @@ open class VidSrcExtractor : ExtractorApi() {
|
||||||
val srcresponse = app.get(server, referer = absoluteUrl).text
|
val srcresponse = app.get(server, referer = absoluteUrl).text
|
||||||
val m3u8Regex = Regex("((https:|http:)//.*\\.m3u8)")
|
val m3u8Regex = Regex("((https:|http:)//.*\\.m3u8)")
|
||||||
val srcm3u8 = m3u8Regex.find(srcresponse)?.value ?: return@apmap
|
val srcm3u8 = m3u8Regex.find(srcresponse)?.value ?: return@apmap
|
||||||
M3u8Helper.generateM3u8(
|
val passRegex = Regex("""['"](.*set_pass[^"']*)""")
|
||||||
name,
|
val pass = passRegex.find(srcresponse)?.groupValues?.get(1)?.replace(
|
||||||
srcm3u8,
|
Regex("""^//"""), "https://"
|
||||||
absoluteUrl
|
)
|
||||||
).forEach(callback)
|
|
||||||
|
callback.invoke(
|
||||||
|
ExtractorLink(
|
||||||
|
this.name,
|
||||||
|
this.name,
|
||||||
|
srcm3u8,
|
||||||
|
this.mainUrl,
|
||||||
|
Qualities.Unknown.value,
|
||||||
|
extractorData = pass,
|
||||||
|
isM3u8 = true
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
// M3u8Helper.generateM3u8(
|
||||||
|
// name,
|
||||||
|
// srcm3u8,
|
||||||
|
// absoluteUrl
|
||||||
|
// ).forEach(callback)
|
||||||
} else {
|
} else {
|
||||||
loadExtractor(linkfixed, url, subtitleCallback, callback)
|
loadExtractor(linkfixed, url, subtitleCallback, callback)
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package com.lagradost.cloudstream3.ui.settings
|
package com.lagradost.cloudstream3.ui.settings
|
||||||
|
|
||||||
|
import android.os.Build
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import androidx.preference.PreferenceFragmentCompat
|
import androidx.preference.PreferenceFragmentCompat
|
||||||
|
@ -83,8 +84,20 @@ class SettingsUI : PreferenceFragmentCompat() {
|
||||||
}
|
}
|
||||||
|
|
||||||
getPref(R.string.app_theme_key)?.setOnPreferenceClickListener {
|
getPref(R.string.app_theme_key)?.setOnPreferenceClickListener {
|
||||||
val prefNames = resources.getStringArray(R.array.themes_names)
|
val prefNames = resources.getStringArray(R.array.themes_names).toMutableList()
|
||||||
val prefValues = resources.getStringArray(R.array.themes_names_values)
|
val prefValues = resources.getStringArray(R.array.themes_names_values).toMutableList()
|
||||||
|
|
||||||
|
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.S) { // remove monet on android 11 and less
|
||||||
|
val toRemove = prefValues
|
||||||
|
.mapIndexed { idx, s -> if (s.startsWith("Monet")) idx else null }
|
||||||
|
.filterNotNull()
|
||||||
|
var offset = 0
|
||||||
|
toRemove.forEach { idx ->
|
||||||
|
prefNames.removeAt(idx - offset)
|
||||||
|
prefValues.removeAt(idx - offset)
|
||||||
|
offset += 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
val currentLayout =
|
val currentLayout =
|
||||||
settingsManager.getString(getString(R.string.app_theme_key), prefValues.first())
|
settingsManager.getString(getString(R.string.app_theme_key), prefValues.first())
|
||||||
|
@ -107,8 +120,20 @@ class SettingsUI : PreferenceFragmentCompat() {
|
||||||
return@setOnPreferenceClickListener true
|
return@setOnPreferenceClickListener true
|
||||||
}
|
}
|
||||||
getPref(R.string.primary_color_key)?.setOnPreferenceClickListener {
|
getPref(R.string.primary_color_key)?.setOnPreferenceClickListener {
|
||||||
val prefNames = resources.getStringArray(R.array.themes_overlay_names)
|
val prefNames = resources.getStringArray(R.array.themes_overlay_names).toMutableList()
|
||||||
val prefValues = resources.getStringArray(R.array.themes_overlay_names_values)
|
val prefValues = resources.getStringArray(R.array.themes_overlay_names_values).toMutableList()
|
||||||
|
|
||||||
|
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.S) { // remove monet on android 11 and less
|
||||||
|
val toRemove = prefValues
|
||||||
|
.mapIndexed { idx, s -> if (s.startsWith("Monet")) idx else null }
|
||||||
|
.filterNotNull()
|
||||||
|
var offset = 0
|
||||||
|
toRemove.forEach { idx ->
|
||||||
|
prefNames.removeAt(idx - offset)
|
||||||
|
prefValues.removeAt(idx - offset)
|
||||||
|
offset += 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
val currentLayout =
|
val currentLayout =
|
||||||
settingsManager.getString(getString(R.string.primary_color_key), prefValues.first())
|
settingsManager.getString(getString(R.string.primary_color_key), prefValues.first())
|
||||||
|
|
Loading…
Reference in New Issue