mirror of
https://github.com/recloudstream/cloudstream.git
synced 2024-08-15 01:53:11 +00:00
Merge branch 'recloudstream:master' into master
This commit is contained in:
commit
6a1033d7fb
12 changed files with 59 additions and 34 deletions
|
@ -5,6 +5,7 @@ import java.net.URL
|
|||
|
||||
plugins {
|
||||
id("com.android.application")
|
||||
id("com.google.devtools.ksp")
|
||||
id("kotlin-android")
|
||||
id("kotlin-kapt")
|
||||
id("org.jetbrains.dokka")
|
||||
|
@ -87,6 +88,11 @@ android {
|
|||
)
|
||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||
|
||||
ksp {
|
||||
arg("room.schemaLocation", "$projectDir/schemas")
|
||||
arg("exportSchema", "true")
|
||||
}
|
||||
|
||||
kapt {
|
||||
includeCompileClasspath = true
|
||||
}
|
||||
|
@ -181,9 +187,13 @@ dependencies {
|
|||
|
||||
implementation("androidx.preference:preference-ktx:1.2.1")
|
||||
|
||||
implementation("com.github.bumptech.glide:glide:4.13.1")
|
||||
kapt("com.github.bumptech.glide:compiler:4.13.1")
|
||||
implementation("com.github.bumptech.glide:okhttp3-integration:4.13.0")
|
||||
implementation("com.github.bumptech.glide:glide:4.15.1")
|
||||
ksp("com.github.bumptech.glide:ksp:4.15.1")
|
||||
implementation("com.github.bumptech.glide:okhttp3-integration:4.15.1")
|
||||
// for ksp
|
||||
ksp("dev.zacsweers.autoservice:auto-service-ksp:1.1.0")
|
||||
implementation("dev.zacsweers.autoservice:auto-service-ksp:1.1.0")
|
||||
implementation("com.google.guava:guava:32.1.2-android")
|
||||
|
||||
implementation("jp.wasabeef:glide-transformations:4.3.0")
|
||||
|
||||
|
@ -207,9 +217,6 @@ dependencies {
|
|||
implementation("ch.acra:acra-core:5.11.2")
|
||||
implementation("ch.acra:acra-toast:5.11.2")
|
||||
|
||||
compileOnly("com.google.auto.service:auto-service-annotations:1.1.1")
|
||||
//either for java sources:
|
||||
annotationProcessor("com.google.auto.service:auto-service:1.1.1")
|
||||
//or for kotlin sources (requires kapt gradle plugin):
|
||||
kapt("com.google.auto.service:auto-service:1.1.1")
|
||||
|
||||
|
|
|
@ -8,7 +8,6 @@ import android.content.Intent
|
|||
import android.widget.Toast
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.fragment.app.FragmentActivity
|
||||
import com.google.auto.service.AutoService
|
||||
import com.lagradost.cloudstream3.mvvm.normalSafeApiCall
|
||||
import com.lagradost.cloudstream3.mvvm.suspendSafeApiCall
|
||||
import com.lagradost.cloudstream3.plugins.PluginManager
|
||||
|
@ -37,7 +36,6 @@ import java.lang.ref.WeakReference
|
|||
import kotlin.concurrent.thread
|
||||
import kotlin.system.exitProcess
|
||||
|
||||
|
||||
class CustomReportSender : ReportSender {
|
||||
// Sends all your crashes to google forms
|
||||
override fun send(context: Context, errorContent: CrashReportData) {
|
||||
|
@ -65,7 +63,6 @@ class CustomReportSender : ReportSender {
|
|||
}
|
||||
}
|
||||
|
||||
@AutoService(ReportSenderFactory::class)
|
||||
class CustomSenderFactory : ReportSenderFactory {
|
||||
override fun create(context: Context, config: CoreConfiguration): ReportSender {
|
||||
return CustomReportSender()
|
||||
|
|
|
@ -16,13 +16,13 @@ import javax.crypto.Cipher
|
|||
import javax.crypto.spec.IvParameterSpec
|
||||
import javax.crypto.spec.SecretKeySpec
|
||||
|
||||
// No License found in https://github.com/enimax-anime/key
|
||||
// special credits to @enimax for providing key
|
||||
// Code found in https://github.com/theonlymo/keys
|
||||
// special credits to @theonlymo for providing key
|
||||
class Megacloud : Rabbitstream() {
|
||||
override val name = "Megacloud"
|
||||
override val mainUrl = "https://megacloud.tv"
|
||||
override val embed = "embed-2/ajax/e-1"
|
||||
override val key = "https://raw.githubusercontent.com/enimax-anime/key/e6/key.txt"
|
||||
override val key = "https://raw.githubusercontent.com/theonlymo/keys/e1/key"
|
||||
}
|
||||
|
||||
class Dokicloud : Rabbitstream() {
|
||||
|
@ -35,7 +35,7 @@ open class Rabbitstream : ExtractorApi() {
|
|||
override val mainUrl = "https://rabbitstream.net"
|
||||
override val requiresReferer = false
|
||||
open val embed = "ajax/embed-4"
|
||||
open val key = "https://raw.githubusercontent.com/enimax-anime/key/e4/key.txt"
|
||||
open val key = "https://raw.githubusercontent.com/theonlymo/keys/e4/key"
|
||||
|
||||
override suspend fun getUrl(
|
||||
url: String,
|
||||
|
@ -86,21 +86,23 @@ open class Rabbitstream : ExtractorApi() {
|
|||
|
||||
private suspend fun getRawKey(): String = app.get(key).text
|
||||
|
||||
private fun extractRealKey(originalString: String?, stops: String): Pair<String, String> {
|
||||
val table = parseJson<List<List<Int>>>(stops)
|
||||
val decryptedKey = StringBuilder()
|
||||
var offset = 0
|
||||
var encryptedString = originalString
|
||||
private fun extractRealKey(sources: String, stops: String): Pair<String, String> {
|
||||
val decryptKey = parseJson<List<List<Int>>>(stops)
|
||||
val sourcesArray = sources.toCharArray()
|
||||
|
||||
table.forEach { (start, end) ->
|
||||
decryptedKey.append(encryptedString?.substring(start - offset, end - offset))
|
||||
encryptedString = encryptedString?.substring(
|
||||
0,
|
||||
start - offset
|
||||
) + encryptedString?.substring(end - offset)
|
||||
offset += end - start
|
||||
var extractedKey = ""
|
||||
var currentIndex = 0
|
||||
for (index in decryptKey) {
|
||||
val start = index[0] + currentIndex
|
||||
val end = start + index[1]
|
||||
for (i in start until end) {
|
||||
extractedKey += sourcesArray[i].toString()
|
||||
sourcesArray[i] = ' '
|
||||
}
|
||||
currentIndex += index[1]
|
||||
}
|
||||
return decryptedKey.toString() to encryptedString.toString()
|
||||
|
||||
return extractedKey to sourcesArray.joinToString("")
|
||||
}
|
||||
|
||||
private inline fun <reified T> decryptMapped(input: String, key: String): T? {
|
||||
|
|
|
@ -65,6 +65,15 @@ class SettingsFragment : Fragment() {
|
|||
}
|
||||
}
|
||||
}
|
||||
fun Fragment?.setToolBarScrollFlags() {
|
||||
if (isTvSettings()) {
|
||||
val settingsAppbar = this?.view?.findViewById<MaterialToolbar>(R.id.settings_toolbar)
|
||||
|
||||
settingsAppbar?.updateLayoutParams<AppBarLayout.LayoutParams> {
|
||||
scrollFlags = AppBarLayout.LayoutParams.SCROLL_FLAG_NO_SCROLL
|
||||
}
|
||||
}
|
||||
}
|
||||
fun Fragment?.setUpToolbar(title: String) {
|
||||
if (this == null) return
|
||||
val settingsToolbar = view?.findViewById<MaterialToolbar>(R.id.settings_toolbar) ?: return
|
||||
|
|
|
@ -30,6 +30,7 @@ import com.lagradost.cloudstream3.ui.result.FOCUS_SELF
|
|||
import com.lagradost.cloudstream3.ui.result.setLinearListLayout
|
||||
import com.lagradost.cloudstream3.ui.result.setText
|
||||
import com.lagradost.cloudstream3.ui.settings.SettingsFragment.Companion.isTrueTvSettings
|
||||
import com.lagradost.cloudstream3.ui.settings.SettingsFragment.Companion.setToolBarScrollFlags
|
||||
import com.lagradost.cloudstream3.ui.settings.SettingsFragment.Companion.setUpToolbar
|
||||
import com.lagradost.cloudstream3.utils.AppUtils.downloadAllPluginsDialog
|
||||
import com.lagradost.cloudstream3.utils.AppUtils.setDefaultFocus
|
||||
|
@ -85,7 +86,7 @@ class ExtensionsFragment : Fragment() {
|
|||
//context?.fixPaddingStatusbar(extensions_root)
|
||||
|
||||
setUpToolbar(R.string.extensions)
|
||||
|
||||
setToolBarScrollFlags()
|
||||
|
||||
binding?.repoRecyclerView?.apply {
|
||||
setLinearListLayout(
|
||||
|
|
|
@ -21,7 +21,6 @@ import com.lagradost.cloudstream3.ui.settings.SettingsFragment.Companion.isTrueT
|
|||
import com.lagradost.cloudstream3.utils.AppUtils.html
|
||||
import com.lagradost.cloudstream3.utils.Coroutines.ioSafe
|
||||
import com.lagradost.cloudstream3.utils.Coroutines.main
|
||||
import com.lagradost.cloudstream3.utils.GlideApp
|
||||
import com.lagradost.cloudstream3.utils.SubtitleHelper.fromTwoLettersToLanguage
|
||||
import com.lagradost.cloudstream3.utils.SubtitleHelper.getFlagFromIso
|
||||
import com.lagradost.cloudstream3.utils.UIHelper.setImage
|
||||
|
@ -87,7 +86,7 @@ class PluginAdapter(
|
|||
override fun onViewRecycled(holder: RecyclerView.ViewHolder) {
|
||||
if (holder is PluginViewHolder) {
|
||||
holder.binding.entryIcon.let { pluginIcon ->
|
||||
GlideApp.with(pluginIcon).clear(pluginIcon)
|
||||
com.bumptech.glide.Glide.with(pluginIcon).clear(pluginIcon)
|
||||
}
|
||||
}
|
||||
super.onViewRecycled(holder)
|
||||
|
|
|
@ -18,6 +18,7 @@ import com.lagradost.cloudstream3.ui.home.HomeFragment.Companion.bindChips
|
|||
import com.lagradost.cloudstream3.ui.result.FOCUS_SELF
|
||||
import com.lagradost.cloudstream3.ui.result.setLinearListLayout
|
||||
import com.lagradost.cloudstream3.ui.settings.SettingsFragment.Companion.isTvSettings
|
||||
import com.lagradost.cloudstream3.ui.settings.SettingsFragment.Companion.setToolBarScrollFlags
|
||||
import com.lagradost.cloudstream3.ui.settings.SettingsFragment.Companion.setUpToolbar
|
||||
import com.lagradost.cloudstream3.ui.settings.appLanguages
|
||||
import com.lagradost.cloudstream3.utils.SingleSelectionHelper.showMultiDialog
|
||||
|
@ -73,6 +74,7 @@ class PluginsFragment : Fragment() {
|
|||
return
|
||||
}
|
||||
|
||||
setToolBarScrollFlags()
|
||||
setUpToolbar(name)
|
||||
binding?.settingsToolbar?.apply {
|
||||
setOnMenuItemClickListener { menuItem ->
|
||||
|
|
|
@ -12,6 +12,7 @@ import com.lagradost.cloudstream3.mvvm.normalSafeApiCall
|
|||
import com.lagradost.cloudstream3.mvvm.observe
|
||||
import com.lagradost.cloudstream3.mvvm.observeNullable
|
||||
import com.lagradost.cloudstream3.ui.settings.SettingsFragment.Companion.isTrueTvSettings
|
||||
import com.lagradost.cloudstream3.ui.settings.SettingsFragment.Companion.setToolBarScrollFlags
|
||||
import com.lagradost.cloudstream3.ui.settings.SettingsFragment.Companion.setUpToolbar
|
||||
|
||||
|
||||
|
@ -27,6 +28,7 @@ class TestFragment : Fragment() {
|
|||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
setUpToolbar(R.string.category_provider_test)
|
||||
setToolBarScrollFlags()
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
|
||||
binding?.apply {
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package com.lagradost.cloudstream3.utils
|
||||
|
||||
import android.net.Uri
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore
|
||||
import com.lagradost.cloudstream3.SubtitleFile
|
||||
import com.lagradost.cloudstream3.TvType
|
||||
import com.lagradost.cloudstream3.USER_AGENT
|
||||
|
@ -377,7 +378,8 @@ open class ExtractorLink constructor(
|
|||
) : VideoDownloadManager.IDownloadableMinimum {
|
||||
val isM3u8 : Boolean get() = type == ExtractorLinkType.M3U8
|
||||
val isDash : Boolean get() = type == ExtractorLinkType.DASH
|
||||
|
||||
|
||||
@JsonIgnore
|
||||
fun getAllHeaders() : Map<String, String> {
|
||||
if (referer.isBlank()) {
|
||||
return headers
|
||||
|
@ -920,4 +922,4 @@ abstract class ExtractorApi {
|
|||
open fun getExtractorUrl(id: String): String {
|
||||
return id
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -301,7 +301,7 @@ object UIHelper {
|
|||
} ?: return false
|
||||
|
||||
return try {
|
||||
var builder = GlideApp.with(this)
|
||||
var builder = com.bumptech.glide.Glide.with(this)
|
||||
.load(glideImage)
|
||||
.skipMemoryCache(true)
|
||||
.diskCacheStrategy(DiskCacheStrategy.ALL).let { req ->
|
||||
|
@ -368,7 +368,7 @@ object UIHelper {
|
|||
) {
|
||||
if (this == null || url.isNullOrBlank()) return
|
||||
try {
|
||||
val res = GlideApp.with(this)
|
||||
val res = com.bumptech.glide.Glide.with(this)
|
||||
.load(GlideUrl(url) { headers ?: emptyMap() })
|
||||
.apply(bitmapTransform(BlurTransformation(radius, sample)))
|
||||
.transition(
|
||||
|
|
|
@ -234,7 +234,7 @@ object VideoDownloadManager {
|
|||
return cachedBitmaps[url]
|
||||
}
|
||||
|
||||
val bitmap = GlideApp.with(this)
|
||||
val bitmap = com.bumptech.glide.Glide.with(this)
|
||||
.asBitmap()
|
||||
.load(GlideUrl(url) { headers ?: emptyMap() })
|
||||
.into(720, 720)
|
||||
|
|
|
@ -22,6 +22,10 @@ allprojects {
|
|||
}
|
||||
}
|
||||
|
||||
plugins {
|
||||
id("com.google.devtools.ksp") version "1.8.20-1.0.11" apply false
|
||||
}
|
||||
|
||||
tasks.register("clean", Delete::class) {
|
||||
delete(rootProject.buildDir)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue