Coder Social home page Coder Social logo

cornerant / digger Goto Github PK

View Code? Open in Web Editor NEW
546.0 16.0 73.0 2.63 MB

Digger is a lightweight download framework that requires only one line of code to complete the file download task

License: MIT License

Ruby 1.08% Swift 97.98% Objective-C 0.93%
download swift urlsession file breakpoints video large digger mp4 url

digger's Introduction

Ant Just Go

  • 📙 Focusing on Swift & iOS
  • 🔨 Creator of applications and frameworks

digger's People

Contributors

cornerant 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  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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

digger's Issues

progress.fractionCompleted is always 1.0

Digger.download(self.fileurl.absoluteString)
			.progress { progress in
				print(progress.fractionCompleted)
			}
			.completion { result in
				switch result {
				case .success(let url):
					print(url)
					
				case .failure(let error):
					print(error)
				}
			}

Testing on ios 9.1 to 13.

NSURLErrorDomain - 999

2019-09-25 21:23:43.031411+0500 DownlloadingAudio[62336:476680] Task <020590E6-FA46-467C-850D-D35CF918D0F8>.<1> load failed with error Error Domain=NSURLErrorDomain Code=-999 "cancelled" UserInfo={NSErrorFailingURLStringKey=https://staging-cmolds.com/masjideaisha/admin/public/collection/yaseen/audio.mp3, NSErrorFailingURLKey=https://staging-cmolds.com/masjideaisha/admin/public/collection/yaseen/audio.mp3, NSURLErrorRelatedURLSessionTaskErrorKey=(
"LocalDataTask <020590E6-FA46-467C-850D-D35CF918D0F8>.<1>"
), NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <020590E6-FA46-467C-850D-D35CF918D0F8>.<1>, NSLocalizedDescription=cancelled} [-999]
DiggerLog*
file : DiggerDelegate.swift
method : notifyCompletionCallback(
:
:)
line : [184]:
info : Error Domain=NSURLErrorDomain Code=-999 "cancelled" UserInfo={NSErrorFailingURLStringKey=https://staging-cmolds.com/masjideaisha/admin/public/collection/yaseen/audio.mp3, NSErrorFailingURLKey=https://staging-cmolds.com/masjideaisha/admin/public/collection/yaseen/audio.mp3, _NSURLErrorRelatedURLSessionTaskErrorKey=(
"LocalDataTask <020590E6-FA46-467C-850D-D35CF918D0F8>.<1>"
), _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <020590E6-FA46-467C-850D-D35CF918D0F8>.<1>, NSLocalizedDescription=cancelled}

How can I use Post

API need post request by JWT

How can I add jwt to request By Digger

Thank you

How to resume files mp3 ?

Hello again and thanks again for your hard work and great plugin.
I tied how to use func startTask to resume file download mp3 after I killed my app then I go to screen list download and I start resume download again but it did not work for me ?

I did not need use this func Digger.download(url) again but I used this DiggerManager.shared.startTask(for: url)

Thanks for your replied!

作者你好,看到你的库我很激动

之前我也花了一些时间写了一个很你这个库很像的下载器,里面的类名,方法名称,链式调用的特点,都很像,可能这就是缘分吧。本人水平有限,你写得应该会比我好,所以打算使用你的库,但是好像有不满足我的需求。
我需要传入一个urlString数组,然后开启下载,下载的过程中我要得到这组任务的总进度,并且这组任务全部下载完,我在拿到回调做事情处理,也就是一个multiDownload的方法。如果你有兴趣的话,请加入这个功能,或者加我的QQ:176516837,一起讨论

iOS8崩溃

dyld: Symbol not found: _NSURLSessionTaskPriorityDefault
Referenced from: /private/var/mobile/Containers/Bundle/Application/*******
Expected in: /System/Library/Frameworks/Foundation.framework/Foundation
in /private/var/mobile/Containers/Bundle/Application/**********
(lldb)

需要在Digger的Target中添加CFNetwork

Request - Can you please add existing contributors to grant access to this code's repo?

https://github.com/cornerAnt/Digger/network

Hi @cornerAnt
This is a great library - but colleagues are turned off that it's not been updated in a long time.
Please grab the usernames from network that you see fit - and just add them into repo -
this will allow Digger to live on. People that have spent the time to do pull request - will have time to fix stuff too.

I'm finding swiftlint autofix is making the network stuff stop working - I'd be happy to spend time fixing - but if the project is abandoned - less so.
Also completely open to suggesting a different repo to use.

'deinitialize()' is unavailable: the default argument to deinitialize(count:) has been removed, please specify the count explicitly

Since upgrading to Swift 5, I get the following errors:

valuePointer.deinitialize() //'deinitialize()' is unavailable: the default argument to deinitialize(count:) has been removed, please specify the count explicitly

valuePointer.deallocate(capacity: 1) //'deallocate(capacity:)' is unavailable: Swift currently only supports freeing entire heap blocks, use deallocate() instead

let message = data.withUnsafeBytes { bytes -> [UInt8] in
                return Array(UnsafeBufferPointer(start: bytes, count: data.count))
            } //'withUnsafeBytes' is deprecated: use `withUnsafeBytes<R>(_: (UnsafeRawBufferPointer) throws -> R) rethrows -> R` instead

When can we expect a fix on this? I see it is out of date and needs some maintenance ASAP.

Can't change cachesDirectory

Anyone else able to change the cachesDirectory? This has no effect:

DiggerCache.cachesDirectory = "custom_name"

All downloads end up in a folder called "Digger" no matter what I set.

Install from cocoapods not working

Hi! Great library!

In Podfile, I added pod 'Digger' under target 'Digger' do, but I'm getting the error

Analyzing dependencies
[!] Unable to find a specification for `Digger`

stopAllTasks() not working

In the example project, I press the top Stop button, but the downloads keep running.

I also commented
NotificationCenter.default.post(name:NSNotification.Name(rawValue: suspendNotificationName), object: ExampleCell.self)
but they still keep running. So it might be something in Digger, not in the example project.

I'm running iOS 11 Simulator.

Uploads

Hey,

Just wondering if you'd consider adding an upload functionality with most of the benefits you've currently got when downloading with Digger (resume even when the user quits the app etc)?

Bug: startTask or stopTask

This is every concern:

When I paused the download at index 0 and resume download at index 0 4 times then it loaded on success 4 times too ?

Why ?

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.