Video Download Manager
Types
Link copied to clipboard
data class CreateNotificationMetadata(val type: VideoDownloadManager.DownloadType, val bytesDownloaded: Long, val bytesTotal: Long, val hlsProgress: Long? = null, val hlsTotal: Long? = null, val bytesPerSecond: Long)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
data class DownloadInfo(val source: String?, val folder: String?, val ep: VideoDownloadManager.DownloadEpisodeMetadata, val links: List<ExtractorLink>)
Link copied to clipboard
data class DownloadItem(val source: String?, val folder: String?, val ep: VideoDownloadManager.DownloadEpisodeMetadata, val links: List<ExtractorLink>)
Link copied to clipboard
data class DownloadMetaData(id: Int?, var bytesDownloaded: Long = 0, var bytesWritten: Long = 0, var totalBytes: Long? = null, lastUpdatedMs: Long = 0, lastDownloadedBytes: Long = 0, createNotificationCallback: (VideoDownloadManager.CreateNotificationMetadata) -> Unit, internalType: VideoDownloadManager.DownloadType = DownloadType.IsPending, var hlsProgress: Int = 0, var hlsTotal: Int? = null, var hlsWrittenProgress: Int = 0, downloadFileInfoTemplate: VideoDownloadManager.DownloadedFileInfo? = null) : Closeable
This class handles the notifications, as well as the relevant key
Link copied to clipboard
data class DownloadQueueResumePackage(val index: Int, val pkg: VideoDownloadManager.DownloadResumePackage)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
bytes have the size end-start where the byte range is [start,end) note that ByteArray is a pointer and therefore cant be stored without cloning it
Link copied to clipboard
Properties
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Functions
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
suspend fun downloadEpisode(context: Context?, source: String?, folder: String?, ep: VideoDownloadManager.DownloadEpisodeMetadata, links: List<ExtractorLink>, notificationCallback: (Int, Notification) -> Unit)
Link copied to clipboard
fun downloadEpisodeUsingWorker(context: Context, source: String?, folder: String?, ep: VideoDownloadManager.DownloadEpisodeMetadata, links: List<ExtractorLink>)
Link copied to clipboard
suspend fun downloadFromResume(context: Context, pkg: VideoDownloadManager.DownloadResumePackage, notificationCallback: (Int, Notification) -> Unit, setKey: Boolean = true)
Link copied to clipboard
fun downloadFromResumeUsingWorker(context: Context, pkg: VideoDownloadManager.DownloadResumePackage)
Link copied to clipboard
suspend fun downloadThing(context: Context, link: IDownloadableMinimum, name: String, folder: String, extension: String, tryResume: Boolean, parentId: Int?, createNotificationCallback: (VideoDownloadManager.CreateNotificationMetadata) -> Unit, parallelConnections: Int = 3, minimumSize: Long = 100): VideoDownloadManager.DownloadStatus
download a file that consist of a single stream of data
Link copied to clipboard
Base path where downloaded things should be stored, changes depending on settings. Returns the file and a string to be stored for future file retrieval. UniFile.filePath is not sufficient for storage.
Link copied to clipboard
Gets the default download path as an UniFile. Vital for legacy downloads, be careful about changing anything here.
Link copied to clipboard
fun getDownloadFileInfoAndUpdateSettings(context: Context, id: Int): VideoDownloadManager.DownloadedFileInfoResult?
Link copied to clipboard
fun getDownloadResumePackage(context: Context, id: Int): VideoDownloadManager.DownloadResumePackage?
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun setupStream(baseFile: <Error class: unknown class>, name: String, folder: String?, extension: String, tryResume: Boolean): VideoDownloadManager.StreamData
Sets up the appropriate file and creates a data stream from the file. Used for initializing downloads.
fun setupStream(context: Context, name: String, folder: String?, extension: String, tryResume: Boolean): VideoDownloadManager.StreamData
Link copied to clipboard