script-server icon indicating copy to clipboard operation
script-server copied to clipboard

How to get live progress of aria2c Downloader

Open anaschaudhary33 opened this issue 4 years ago • 13 comments

When using script-server the aria2c prints only summary of downloding file but not live progress.

09/09 00:40:21 [NOTICE] Downloading 1 item(s)
 *** Download Progress Summary as of Thu Sep  9 00:41:22 2021 *** 
=
[#aa8b6f 20MiB/100MiB(20%) CN:8 DL:304KiB ETA:4m27s]
FILE: /home/pi/USB/home/Media/100MB.bin
-

 *** Download Progress Summary as of Thu Sep  9 00:42:31 2021 *** 
=
[#aa8b6f 41MiB/100MiB(41%) CN:8 DL:0B]
FILE: /home/pi/USB/home/Media/100MB.bin

While in shell it prints the live progress and also the summary in between as,

09/09 01:01:49 [NOTICE] Downloading 1 item(s)
 *** Download Progress Summary as of Thu Sep  9 01:02:49 2021 ***
====================================================
[#0f8c67 56MiB/100MiB(56%) CN:8 DL:0.9MiB ETA:46s]
FILE: /home/pi/USB/home/Media/100MB.bin
----------------------------------------------------

[#0f8c67 65MiB/100MiB(65%) CN:7 DL:874KiB ETA:40s]^C
09/09 01:03:01

Is there any way to get live downloading progress output in web-server??

Edit: Log file appears as

id:1
user_name:pi
user_id:pi
script:Simple Downloader
start_time:1631127991303
command:/home/pi/app/bugy/conf/scripts/Simple_Downloader.sh add https://speed.hetzner.de/100MB.bin
output_format:terminal
exit_code:-15
>>>>>  OUTPUT STARTED <<<<<

09/09 00:36:31 [[1;32mNOTICE[0m] Downloading 1 item(s)


[0m

[0m

[0m

[0m

[0m

[0m

[0m

[0m

[0m

 *** Download Progress Summary as of Thu Sep  9 00:36:41 2021 *** 
=
[#7ddcef 3.0MiB/100MiB(3%) CN:8 DL:365KiB ETA:4m31s]
FILE: /home/pi/USB/home/Media/100MB.bin
-

[0m

[0m

[0m

[0m

[0m

[0m

[0m

[0m

[0m

[0m

 *** Download Progress Summary as of Thu Sep  9 00:36:52 2021 *** 
=
[#7ddcef 6.3MiB/100MiB(6%) CN:8 DL:336KiB ETA:4m44s]
FILE: /home/pi/USB/home/Media/100MB.bin
-

[0m

[0m

[0m

[0m

[0m

[0m

[0m

[0m
>> STOPPED BY USER

anaschaudhary33 avatar Sep 08 '21 19:09 anaschaudhary33

Hi, could you check the log file for whitespace characters? Are there any caret returns? Also, please make sure, that https://github.com/bugy/script-server/wiki/Script-config#requires_terminal is set to true

bugy avatar Sep 10 '21 09:09 bugy

Already setup the requires_terminal as true. Here is the log file I have also attached the runner and script

anaschaudhary33 avatar Sep 10 '21 17:09 anaschaudhary33

Interesting... How do you see this in a history section? For me it looks correct: image

bugy avatar Sep 10 '21 20:09 bugy

Interesting... How do you see this in a history section? For me it looks correct: image

My history looks similar as yours.

anaschaudhary33 avatar Sep 11 '21 01:09 anaschaudhary33

When using terminal it shows the download progress as gif.

And when the the output is redirect to a file using terminal, aria2c --conf-path=/home/pi/.aria2/aria2_alt.conf https://speed.hetzner.de/100MB.bin > test.log Than test.log

anaschaudhary33 avatar Sep 11 '21 02:09 anaschaudhary33

Cool, looks like a bug indeed.

To help me reproduce it, may I ask you to run your script in script server till the end (without stopping it) and:

  1. Notice if new rows are always added or sometimes they are replaced
  2. Send me the log file after execution (so it have more data than the previous example)

bugy avatar Sep 11 '21 06:09 bugy

Done that. Noticed that no line replaced and only the new lines added. screenshot of output and full output copied from script server.

Log file.

anaschaudhary33 avatar Sep 11 '21 07:09 anaschaudhary33

Hi @anaschauhan33, I tried to reproduce it locally by using your logs, without any success. I believe aria2c behaves differently when run from script server or .sh file. Could you try to execute aria2c directly from script server "script_path"? i.e. "script_path": "aria2c --conf-path=/home/pi/.aria2/aria2_alt.conf"

bugy avatar Sep 14 '21 19:09 bugy

Hi @anaschauhan33, I tried to reproduce it locally by using your logs, without any success. I believe aria2c behaves differently when run from script server or .sh file. Could you try to execute aria2c directly from script server "script_path"? i.e. "script_path": "aria2c --conf-path=/home/pi/.aria2/aria2_alt.conf"

bugy avatar Sep 14 '21 20:09 bugy

You mean should I try to execute the same script (in terminal) which is in script-server's path??

{
  "name": "test",
  "script_path": "conf/scripts/test.sh",
  "requires_terminal": true,
  "output_format": "terminal",
  "parameters": [
    {
      "name": "text",
      "required": false,
      "type": "text"
    }
  ]
}

https://user-images.githubusercontent.com/70742968/133368353-791055ea-7758-4ef7-a9c4-5c19c47ae861.mp4

It is working fine in terminal.

anaschaudhary33 avatar Sep 15 '21 03:09 anaschaudhary33

No, I mean to use this configuration in Script server:

{
  "name": "test",
  "script_path": "aria2c --conf-path=/home/pi/.aria2/aria2_alt.conf",
  "requires_terminal": true,
  "output_format": "terminal",
  "parameters": [
    {
      "name": "text",
      "required": false,
      "type": "text"
    }
  ]
}

If it won't work, I'll try it in ~10 days. I have very limited access to internet now and cannot use a downloader for testing. And from the log files you provided, I don't see any root cause for a problem

bugy avatar Sep 15 '21 13:09 bugy

I have tried. But got the same result. Here is the log file

anaschaudhary33 avatar Sep 15 '21 16:09 anaschaudhary33

If it won't work, I'll try it in ~10 days. I have very limited access to internet now and cannot use a downloader for testing. And from the log files you provided, I don't see any root cause for a problem

Thank you very much. I appreciate your efforts ☺️

anaschaudhary33 avatar Sep 15 '21 16:09 anaschaudhary33