0

I am using the aria2c downloader ( https://aria2.github.io/ ) in my python script. The aria2c is a command-line tool to batch download some stuff.

import os
#...
os.system("aria2c " + url)

The output of aria2c is displayed in the same console with the downloaded percentage and download speed etc.

Now, I want to convert my python program to a GUI. The GUI must display information of the download speed and percentage, which must be graphical labels in Tkinter GUI.

Is there any way to use aria2c and achieve this?

Ali Sajjad
  • 3,589
  • 1
  • 28
  • 38

2 Answers2

0

Seems like aria2p solves your problem. Here's the link.

Parsa Noori
  • 198
  • 1
  • 1
  • 10
  • 1
    I tried this but the library does not even download simple links without error... Will try again and let you know! Who knows they fixed the bugs... – Ali Sajjad Aug 19 '20 at 19:43
  • Well if you think this library is not useful then others would thank you to fork it and update it. And yes they may have fixed the bugs since you said they are major problems – Parsa Noori Aug 19 '20 at 19:46
  • Hey, aria2p's author here. Don't hesitate to report bugs on the issue tracker: https://github.com/pawamoy/aria2p/issues. Also please note that aria2p is just a frontend/client for aria2c, which must run as a daemon with RPC enabled. – pawamoy Sep 12 '20 at 12:53
-1

Python default library's subprocess module allows you to call and interact with other programs. That will certainly suit your problem very well.

michaeldel
  • 2,204
  • 1
  • 13
  • 19
  • So how do I interact? – Ali Sajjad Apr 12 '20 at 15:45
  • Please read the provided documentation or/and a tutorial if you have a hard time getting started (_e.g._ https://pymotw.com/3/subprocess/) – michaeldel Apr 12 '20 at 15:48
  • Actually I am also using subprocess in my program. I don't have any problem understanding the documentation. My question is related to how to get the required output of aria2 into a GUI. Actually, the output of aria2 in the console changes every second. Let's just say I want to make it look like a GUI download manager. – Ali Sajjad Apr 12 '20 at 16:01
  • “Console changes” are still writes to `stdout` (or `stderr`, whatever), so there is not much difference with processing “regular” outputs. – michaeldel Apr 12 '20 at 16:04
  • Did you find some way to achieve this, if , can you please mentioned it here. – Sandeep Prasad Kushwaha Apr 16 '20 at 16:58