Coder Social home page Coder Social logo

unityfiledownloader's Introduction

UnityFileDownloader☁️

downloads License: MIT

A file downloader that handles asyncronous and concurrent file downloading, implicit multi-part file downloading, pausing/restarting, properties with per-file granularity and more.

Appendix

This file downloader was built because UnityWebRequest and recent solutions built by Unity and third-parties are subpar and bare of features. While this project is written 100% in C#, this downloader should support all platforms that Unity does. If you have any feedback, please reach out to me at [email protected], or submit an issue or pull request. Collaboration is encouraged!

Features

  • Concurrently download any amount of files while adhering to a fixed number of asyncronous tasks
  • Implicitly handles multi-part file downloading, including pausing/restarting of chunked downloads
  • Provides both task-based asyncronous methods and standard callbacks for errors, individual file completion, all file completion, and more
  • Granularity of properties can be on a per-file basis, providing the ability to pause/restart, and to get/set progress, timeouts, headers, callbacks and more
  • Optionally handle "atomic" file downloading by deleting all downloaded (partially or impartially) files and ability to continue downloading through HTTP/S errors
  • Code structure that allows for modularity of both download fulfillment (such as UnityWebRequest) and dispatching of downloads.

Usage/Examples

using UFD;
using System;

// ... in some class
public class Example
{
    async void Download()
    {
        UnityFileDownloader ufd = new UnityFileDownloader(new string[] {
            "https://wallpaperaccess.com/full/87731.jpg",
        });
        await ufd.Download();
    }

}

Issues

  • Unity Editor termination and application lifecycle methods do not stop this downloader from functioning.

TODO

The following features are some of which I deem to be deseriable and not currently implemented:

  • Dynamic chunk sizing based on download speeds
  • Cleanup of class structure to provide complete modularity of download fulfillment and downloader.
  • Provide alternative fulfillers to UnityWebRequest, perhaps unlocking better platform specific performance.

unityfiledownloader's People

Contributors

jpgordon00 avatar

Watchers

James Cloos 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.