Giter Site home page Giter Site logo

xm2017 / m3u8download Goto Github PK

View Code? Open in Web Editor NEW

This project forked from fanchen001/m3u8download

0.0 0.0 0.0 87 KB

【次元番】使用的M3u8视频下载器[kotlin],支持单任务多线程下载。支持基本的开始,暂停,下载列表功能。目前功能还不是很完善。后续将继续完善相关功能

Kotlin 100.00%

m3u8download's Introduction

M3u8Download

一个简单的M3u8视频下载器[kotlin],支持单任务多线程下载。包含开始,暂停,删除,下载列表功能。

几个关键的类

M3u8Config,M3u8下载器配置,可以配置线程数,下载超时时间,下载路径等

M3u8File,对应M3u8索引文件,通过这个类可以将 m3u8 url 转换成 M3u8,以供下载

M3u8 一个M3u8代表一个完整的视频,也是M3u8Manager 用来管理的基本单位

M3u8Ts M3u8视频切片文件,下载的基本单位.多个ts合并成一个视频

OnM3u8DeleteListener 任务删除回掉接口

OnM3u8DownloadListenr 下载回掉接口

OnM3u8FileListener 查询db里所有下载任务的回掉接口

OnM3u8InfoListener 将m3u8 url 转换成M3u8实体类的回掉接口

使用姿势

M3u8Config.context = applicationContext // set context
M3u8Config.threadCount = 5 //  下载线程数
M3u8Config.m3u8Path = "" // 下载路径
//注册 M3u8File to M3u8 回掉
M3u8Manager.registerInfoListeners(object : OnM3u8InfoListener{
           
    override fun onSuccess(m3u8File: M3u8File, infos: List<M3u8>) {//转换成功
        M3u8Manager.download(infos)//将M3u8 添加到下载任务列表
    }

    override fun onError(m3u8File: M3u8File, e: Throwable) {//转换失败
    }

})
M3u8Manager.download(M3u8File(""))//开始 M3u8File to M3u8

以上是最简单的使用方式。具体其他使用方式,可以参考次元番

m3u8download's People

Contributors

fanchen001 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.