Giter Club home page Giter Club logo

ariam3u8downloader's Introduction

AriaM3U8Downloader

A Swift M3U8 Downloader

Requirements

  • iOS 11.0
  • Swift 5.0

Installation

pod 'AriaM3U8Downloader', :git => 'https://github.com/moxcomic/AriaM3U8Downloader.git'

// 如果需要播放请添加这个Pod
// 或者自己解决本地播放问题
pod 'AriaM3U8Downloader/LocalServer', :git => 'https://github.com/moxcomic/AriaM3U8Downloader.git'

Usage

Swift

import AriaM3U8Downloader

let downloader = AriaM3U8Downloader(withURLString: "https://xxx.m3u8", outputPath: "存放路径")
downloader.start()

回调方法 & 设置项

  • downloadTSSuccessExeBlock
    • 下载每个TS文件完成的回调, 返回TS文件名
  • downloadFileProgressExeBlock
    • 下载进度回调, 返回Float
  • downloadStartExeBlock
    • 下载开始回调
  • downloadPausedExeBlock
    • 下载暂停回调
  • downloadResumeExeBlock
    • 下载恢复回调
  • downloadStopExeBlock
    • 下载停止回调
  • downloadTSFailureExeBlock
    • 下载TS文件失败回调, 返回TS文件名
  • downloadCompleteExeBlock
    • 所有TS文件下载完成, 并且已创建index.m3u8文件
  • downloadM3U8StatusExeBlock
    • 下载状态回调, 返回 Int: 当前下载, Int: 文件总数
  • downloadDidEnterBackgroundExeBlock
    • App进入后台回调
  • downloadDidBecomeActiveExeBlock
    • App进入前台回调
  • downloadStatus
    • isNotReadyToDownload -> 未完成下载准备
    • isReadyToDownload -> 完成下载准备
    • isStart -> 开始下载
    • isPause -> 暂停下载
    • isStop -> 停止下载
    • isDownloading -> 下载中
    • isComplete -> 下载完成
  • maxConcurrentOperationCount
    • 同时最大下载TS文件数量, Int 默认为 3
  • autoPauseWhenAppDidEnterBackground
    • App进入后台是否暂停下载, 默认为 True, 如果需要请设置为 False 并自行实现后台下载

OC

具体未测试, 理论支持

ariam3u8downloader's People

Contributors

moxcomic avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

ariam3u8downloader's Issues

下载到最后会error

http://devimages.apple.com/iphone/samples/bipbop/bipbopall.m3u8

下载完成
-- RECEIVE DOWNLOAD TS SUCCESS NOTIFICATION --
queque count:1
-- RECEIVE DOWNLOAD PROGRESS NOTIFICATION --
-- RECEIVE DOWNLOAD STATUS NOTIFICATION --
-- RECEIVE DOWNLOAD STATUS NOTIFICATION --
Fatal error: Index out of range: file Swift/ContiguousArrayBuffer.swift, line 444
2021-01-19 13:26:23.779609+0900 Example[16350:873886] Fatal error: Index out of range: file Swift/ContiguousArrayBuffer.swift, line 444

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.