mirror of
https://github.com/recloudstream/cloudstream.git
synced 2024-08-15 01:53:11 +00:00
testing seq torrent
This commit is contained in:
parent
d394f0e1d0
commit
8105231a6b
5 changed files with 20 additions and 11 deletions
|
@ -260,6 +260,8 @@ dependencies {
|
|||
|
||||
// color palette for images -> colors
|
||||
implementation("androidx.palette:palette-ktx:1.0.0")
|
||||
|
||||
implementation("com.github.recloudstream:Aria2cStream:0.0.1")
|
||||
}
|
||||
|
||||
tasks.register("androidSourcesJar", Jar::class) {
|
||||
|
|
|
@ -5,6 +5,7 @@ import android.app.Application
|
|||
import android.content.Context
|
||||
import android.content.ContextWrapper
|
||||
import android.content.Intent
|
||||
import android.util.Log
|
||||
import android.widget.Toast
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.fragment.app.FragmentActivity
|
||||
|
@ -41,7 +42,7 @@ import kotlin.system.exitProcess
|
|||
class CustomReportSender : ReportSender {
|
||||
// Sends all your crashes to google forms
|
||||
override fun send(context: Context, errorContent: CrashReportData) {
|
||||
println("Sending report")
|
||||
Log.i("Acra", "Sending report: ${errorContent.toMap().map { "${it.key}:${it.value}" }.joinToString()}")
|
||||
val url =
|
||||
"https://docs.google.com/forms/d/e/1FAIpQLSfO4r353BJ79TTY_-t5KWSIJT2xfqcQWY81xjAA1-1N0U2eSg/formResponse"
|
||||
val data = mapOf(
|
||||
|
|
|
@ -1567,7 +1567,7 @@ class MainActivity : AppCompatActivity(), ColorPickerDialogListener {
|
|||
setKey(HAS_DONE_SETUP_KEY, true)
|
||||
}
|
||||
|
||||
/*val defaultDirectory = "${filesDir.path}/torrent_tmp"
|
||||
//val defaultDirectory = "${filesDir.path}/torrent_tmp"
|
||||
//File(defaultDirectory).deleteRecursively()
|
||||
navigate(
|
||||
R.id.global_to_navigation_player, GeneratorPlayer.newInstance(
|
||||
|
@ -1576,7 +1576,7 @@ class MainActivity : AppCompatActivity(), ColorPickerDialogListener {
|
|||
ExtractorLink(
|
||||
source = "",
|
||||
name = "hello world",
|
||||
url = "",
|
||||
url = "magnet:?xt=urn:btih:bbeb7617fb6240230b862edac6221f47d59e586b&dn=%5BOhys-Raws%5D%20Kamierabi%20-%2004%20%28CX%201280x720%20x264%20AAC%29.mp4&tr=http%3A%2F%2Fnyaa.tracker.wf%3A7777%2Fannounce&tr=udp%3A%2F%2Fopen.stealth.si%3A80%2Fannounce&tr=udp%3A%2F%2Ftracker.opentrackr.org%3A1337%2Fannounce&tr=udp%3A%2F%2Fexodus.desync.com%3A6969%2Fannounce&tr=udp%3A%2F%2Ftracker.torrent.eu.org%3A451%2Fannounce",
|
||||
"",
|
||||
Qualities.Unknown.value,
|
||||
type = INFER_TYPE
|
||||
|
@ -1585,7 +1585,7 @@ class MainActivity : AppCompatActivity(), ColorPickerDialogListener {
|
|||
emptyList()
|
||||
)
|
||||
)
|
||||
)*/
|
||||
)
|
||||
|
||||
// Used to check current focus for TV
|
||||
// main {
|
||||
|
|
|
@ -262,6 +262,7 @@ class CS3IPlayer : IPlayer {
|
|||
link: ExtractorLink,
|
||||
requestId: Long,
|
||||
) {
|
||||
val minimumBytes : Long = 30 shl 20
|
||||
var hasFileChecked = false
|
||||
while (true) {
|
||||
val gid = DownloadListener.sessionIdToGid[requestId]
|
||||
|
@ -294,15 +295,16 @@ class CS3IPlayer : IPlayer {
|
|||
}
|
||||
|
||||
DownloadStatusTell.Active -> {
|
||||
if (metadata.downloadedLength >= metadata.totalLength && getPlayableFile(
|
||||
//metadata.downloadedLength >= metadata.totalLength &&
|
||||
if (getPlayableFile(
|
||||
metadata,
|
||||
minimumBytes = 10 shl 20
|
||||
minimumBytes = minimumBytes
|
||||
) != null
|
||||
) break
|
||||
|
||||
// as we don't want to waste the users time with torrents that is useless
|
||||
// we do this to check that at a video file exists
|
||||
if (!hasFileChecked && metadata.totalLength > (10 shl 20)) {
|
||||
if (!hasFileChecked && metadata.totalLength > minimumBytes) {
|
||||
hasFileChecked = true
|
||||
if (getPlayableFile(
|
||||
metadata,
|
||||
|
@ -334,7 +336,10 @@ class CS3IPlayer : IPlayer {
|
|||
continue
|
||||
}
|
||||
|
||||
null -> break
|
||||
null -> {
|
||||
delay(1000)
|
||||
continue
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -345,7 +350,7 @@ class CS3IPlayer : IPlayer {
|
|||
|
||||
when (metadata.status) {
|
||||
DownloadStatusTell.Active, DownloadStatusTell.Complete -> {
|
||||
val uri = getPlayableFile(metadata, minimumBytes = 10 shl 20)
|
||||
val uri = getPlayableFile(metadata, minimumBytes = minimumBytes)
|
||||
?: throw Exception("Not downloaded enough")
|
||||
activity.runOnUiThread {
|
||||
//Log.i(TAG, "downloaded data: $metadata")
|
||||
|
@ -400,7 +405,8 @@ class CS3IPlayer : IPlayer {
|
|||
id = requestId,
|
||||
uri = link.url,
|
||||
fileName = null,
|
||||
seed = false
|
||||
seed = false,
|
||||
stream = true,
|
||||
)
|
||||
|
||||
val metadata =
|
||||
|
|
|
@ -30,13 +30,13 @@
|
|||
app:show_timeout="0" />
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/download_header"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@android:color/black"
|
||||
android:backgroundTint="@android:color/black">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/download_header"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
|
|
Loading…
Reference in a new issue