termux / termux-app

Termux - a terminal emulator application for Android OS extendible by variety of packages.
https://f-droid.org/en/packages/com.termux
Other
35.76k stars 3.76k forks source link

[Feature Request] Termux as a downloader #446

Open sayem314 opened 7 years ago

sayem314 commented 7 years ago

Hi there, what I meant is can we register termux as a downloader globally? So that we could use wget/aria2 as big files downloader. Wget/aria2 in termux works better than phone built-in downloader, especially when the file is really large.

The above screenshot showing option for download link. We need termux right there!

My termux-url-opener context is aria2c -x 4 "$1" --dir=$HOME/storage/downloads and it works super smooth however it would be awesome if there is an option to make android understand termux can download.

I think we need to use some additional intent filter for that? Yeah?

setuidroot commented 6 years ago

I understand the feature you are asking for and I also think it'd be a cool addition. While you could probably add it in yourself (given a rooted phone and some bash scripting.) I just wanted to tell you how I personally do this hoping it may help some people...

As an example in your screenshot, just click and and hold the "download" button and then click "copy link address" in the pop-up prompt. Then open termux and do: wget (paste address/Cntl+Alt+V on hacker's keryboard landscape mode.)

This is an easy way to use termux to download files... I do it all the time b/c termux is far more reliable a downloader and I believe if you lose network for a second (like switching AP around a home WiFi does annoyingly on some phones) the download will continue where it left off as opposed to leaving half a downloaded file in storage and making you start all over again :/

Also tmux downloads the file to it's internal data path if youless you specify otherwise. I just use: 'mv downloaded.file /sdcard/Download' (no quotes) to move it to my regular downloads folder when it's done.

Quasic commented 6 years ago

I use it to fix aborted downloads by other downloaders. Just copy the partial file to a termux r/w location, and use either wget's -c option or curl's -C or --continue-at option.

(It would be handy to have termux-url-downloader or something, though I have a browser in termux-url-opener.)

alive4ever commented 5 years ago

As a workaround, there is Aria2App which can be used to achieve similar purpose, i.e. using aria2c with rpc enabled inside termux and using Aria2App to capture downloads on Android.

wqzq commented 3 years ago

I discovered that you can redirect certain browser's (like Kiwi Browser) downloads to aria using RPC. This is what worked for me:

  1. installed this chromium extension https://github.com/alexhua/Aria2-for-chrome on Kiwi Browser
  2. ran aria2c --dir=/storage/emulated/0/Download --enable-rpc on Termux
  3. went back to Kiwi Browser and configured the extension to intercept all downloads by default

That's it. This is what I'm using since a while now after I found out how much aria2 is more reliable when downloading stuff than most download managers.