Giter Site home page Giter Site logo

Comments (1)

bkw777 avatar bkw777 commented on July 23, 2024

This is not as simple as the sudo or xterm options.
The download command isn't simply run, it's highly integrated.

The .deb files are downloaded in batch by writing a special aria2c syntax job file format to stdin, and parsing the stdout to monitor progress while working.

To support a different downloader, you would need to write a whole different "driver" for that downloader, essentially a replacement DownloadManager.vala (also other parts would need to be decoupled a little to make it so all the special bits are inside DownloadManager, to allow drop-in replacement of some other DownloadManager, but that's not a problem)

Never the less I've always wanted this to be configurable too.

I think I should do 2 things.
1 - Make AsyncTask more generic and clean up the seperation so that everything special to aria2c is all just inside DownloadManager, and then it would be possible to have other versions of DownloadManager that drop in without having to change anything else. I've been planning to do that to make a version that uses libcurl instead of an external executable.

2 - That would be nice just on principle but in addition to that it would be useful to have an option like the xterm option where there is both internal and external options, where even if the internal option is all integrated, the external options are simpler where they DO just run the command with only a simple string substitution for the url and filename etc. This method of operating would be less efficient since it would have to run the command once per individual file, and it's a lot of files. But that's ok as long as the good reference method is still always available built-in.

There is still a bit of a problem with special settings like proxy. Each different downloader would have it's own different way of doing that. I guess that will have to be handled by supplying more special tokens similar to printf format specifiers, like instead of %s for string, maybe %u for url and %p for proxy, etc, or maybe do them as environment variables like ${URL} , ${PROXY}, etc.

Hm, I guess we could even still support batch mode by having a variable for a url list. At run-time, we decide whether to run a loop if single-file downloads or a single batch download by just looking at the configured command to see which it has ${URL} or ${URLLIST} in it.

The checksums would be a little more work. Righ now it hands the checksums to aria2c, and aria2c is what checks the checksums. With any other command, we'd have to do our own checksum verification.

Similarly we'd have to provide progress monitoring by repeatedly statting the partial download file instead of reading the progress from the command output, or we just accept the progress being messier by just dumping the commands progress output to stdout instead of generating our own progress bar.

I guess I've just convinced myself it's doable.

from mainline.

Related Issues (20)

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.