{"id":1655,"url":"https://github.com/cornerAnt/Digger","last_synced_at":"2025-08-02T04:32:10.951Z","repository":{"id":49543062,"uuid":"109131327","full_name":"cornerAnt/Digger","owner":"cornerAnt","description":"Digger is a lightweight download framework that requires only one line of code to complete the file download task","archived":false,"fork":false,"pushed_at":"2021-05-05T11:02:34.000Z","size":2698,"stargazers_count":545,"open_issues_count":19,"forks_count":73,"subscribers_count":16,"default_branch":"master","last_synced_at":"2024-04-24T19:04:55.139Z","etag":null,"topics":["breakpoints","digger","download","file","ios","large","mp4","swift","url","urlsession","video"],"latest_commit_sha":null,"homepage":null,"language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cornerAnt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-11-01T12:54:27.000Z","updated_at":"2024-04-19T13:48:50.000Z","dependencies_parsed_at":"2022-08-20T07:40:22.043Z","dependency_job_id":null,"html_url":"https://github.com/cornerAnt/Digger","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cornerAnt%2FDigger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cornerAnt%2FDigger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cornerAnt%2FDigger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cornerAnt%2FDigger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cornerAnt","download_url":"https://codeload.github.com/cornerAnt/Digger/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228439068,"owners_count":17920017,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["breakpoints","digger","download","file","ios","large","mp4","swift","url","urlsession","video"],"created_at":"2024-01-05T20:15:52.436Z","updated_at":"2024-12-06T08:31:22.993Z","avatar_url":"https://github.com/cornerAnt.png","language":"Swift","funding_links":[],"categories":["Networking"],"sub_categories":["Video","Other free courses"],"readme":"\u003cdiv align=center\u003e\n\u003cimg src=\"https://github.com/cornerAnt/Digger/blob/master/Images/logo.png\"/\u003e\n\u003c/div\u003e\n\n[![Version](http://img.shields.io/cocoapods/v/Digger.svg?style=flat)](https://cocoapods.org/pods/Digger)\n[![Carthage compatible](https://camo.githubusercontent.com/3dc8a44a2c3f7ccd5418008d1295aae48466c141/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f43617274686167652d636f6d70617469626c652d3442433531442e7376673f7374796c653d666c6174)](https://github.com/Carthage/Carthage)\n[![Version](https://camo.githubusercontent.com/fc56303af12c023343f338a762b6bfb2a5f1e4dc/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d677265656e2e7376673f7374796c653d666c6174)](LICENSE)\n\n\n[中文说明](https://github.com/cornerAnt/Digger/blob/master/CN_README.md)\n\nDigger is a lightweight download framework that requires only one line of code to complete the file download task.\n\nBased on URLSession, pure Swift language implementation, support chain syntax call, real-time download progress, real-time download speed, breakpoint download.\n\nThe user forces the app to be shut down, for example by sliding off the app.\nDigger can still resume downloading tasks.\n\n\n\u003cdiv align=center\u003e\n\u003cimg src=\"https://github.com/cornerAnt/Digger/blob/master/Images/demo.gif\"/\u003e\n\u003c/div\u003e\n\n\n## Features:\n- Large file download\n- Multi thread Download\n- Thread safety\n- Breakpoint downloading\n- Controllable concurrency\n\n## Requirements\"\n\n- iOS 8.0+\n- Xcode 9.0+\n- Swift 4.0+\n## Installation\n\n### CocoaPods\n\nAdd to your Podfile:\n\n```ruby\npod 'Digger'\n```\n\n### Carthage\n\nAdd to your Cartfile:\n\n```\ngithub \"cornerAnt/Digger\"\n```\n\n## Usage\n\n###Basic:\nDownload a file in the Digger directory under the sandbox's Caches\n\n```swift\n   let url = \"http://example.com/digger.mp4\"\n   Digger.download(url)\n\n```\nChoose different callbacks depending on your needs\n\n```swift\n        \n  Digger.download(url)\n        .progress(nil)\n        .speed(nil)\n        .completion(nil)\n```\n\n\n```swift\n   let url = \"http://example.com/digger.mp4\"\n\n        Digger.download(url)\n            .progress({ (progresss) in\n                print(progresss.fractionCompleted)\n\n            })\n            .speed({ (speed) in\n                print(speed)\n            })\n            .completion { (result) in\n                \n                switch result {\n                case .success(let url):\n                    print(url)\n                    \n                case .failure(let error):\n                    print(error)\n                    \n                }\n                \n        }\n}\n\n```\n\nConfig yourself\n\n```swift\n\n/// Start the task at once,default is true\n\nDiggerManager.shared.startDownloadImmediately = false\n\n/// maxConcurrentTasksCount,deault is 3\n\nDiggerManager.shared.maxConcurrentTasksCount = 4\n\n///  request timeout,deault is 100 \n\nDiggerManager.shared.timeout = 150\n\n/// allowsCellularAccess,deault is true\n\nDiggerManager.shared.allowsCellularAccess = false\n\n/// loglevel,deault is high\n/*\n***************DiggerLog****************\nfile   : ExampleController.swift\nmethod : viewDidLoad()\nline   : [31]:\ninfo   : digger log\n\n*/\n// If you want to close,set the level to be .none\n\nDiggerManager.shared.logLevel = .none\n\n\n\n\n// MARK:-  DiggerCache\n\n/// In the sandbox cactes directory, custom your cache directory\n\nDiggerCache.cachesDirectory = \"Directory\"\n\n/// Delete all downloaded files\n\nDiggerCache.cleanDownloadFiles()\n\n/// Delete all temporary download files\n\nDiggerCache.cleanDownloadTempFiles()\n\n/// Get the system's available memory size\n\n_ = DiggerCache.systemFreeSize()\n\n/// Get the size of the downloaded file\n\n_ = DiggerCache.downloadedFilesSize()\n\n/// Get the path to all downloaded files\n_ = DiggerCache.pathsOfDownloadedfiles\n}\n```\n \n\n\n## Contributing\n\n1. Fork\n2. Commit changes to a branch in your fork\n3. Push your code and make a pull request\n\n\n## License\n\nDigger is Copyright (c) 2017 cornerAnt and released as open source under the attached [MIT License](LICENSE).\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FcornerAnt%2FDigger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FcornerAnt%2FDigger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FcornerAnt%2FDigger/lists"}