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