Python: Automatic Download Manager

A forum for general discussion of the Python programming language.

Python: Automatic Download Manager

Postby precyoz » Wed Jul 03, 2013 6:35 am

Is it possible to make an Automatic Download Manager in Python(with wxpython)? "Automatic" in such a way that, your files will automatically and continuously be downloaded when you turn on your PC and automatically stop the downloading when you shut down your PC. Anyway, the download manager should contain an ftp and HTTP site text control and a username and password that relates to what ftp or HTTP site you fill in, and a connect/download button to start the downloading.

Any help is greatly appreciated :)
Posts: 18
Joined: Wed Jul 03, 2013 6:23 am

Re: Python: Automatic Download Manager

Postby Crimson King » Wed Jul 03, 2013 7:09 am

Hi, yes of course it's possible, Python is a general-purpose language so you can code many different things with it.

Never tried anything like that, but maybe you should check the standard library (a quick search gave me this result regarding ftp ftplib)

Try coding this and when you get some errors come back and post them, we'll be happy to help you out.
User avatar
Crimson King
Posts: 166
Joined: Fri Mar 08, 2013 2:42 pm
Location: Dublin, Ireland

Re: Python: Automatic Download Manager

Postby micseydel » Wed Jul 03, 2013 8:48 am

The issue of the GUI (graphical user interface, wxpython) is separate from the point of your program. In order to accomplish this whole task, I recommend you write it without a GUI first, then add a GUI on after you've gotten the functionality set. If you've written the program properly before you add the GUI, having the GUI use the existing code should be easy. In order to accomplish this, you will "separate interface from implementation".

What that means is that your functions which the GUI would use will not include input() calls or print statements. Use parameter passing and function return values.

As Crimson King said, once you get started we can give you more help, but at this point you should just pick small parts of the program to work on at a time, get started, and then when you have issues ask as specific of questions as possible here. And we'll expect that you've read this, and you may be ignored if you appear to not have read it since your next post won't be your first.
Due to the reasons discussed here we will be moving to on October 1, 2016.

This forum will be locked down and no one will be able to post/edit/create threads, etc. here from thereafter. Please create an account at the new site to continue discussion.
User avatar
Posts: 2988
Joined: Tue Feb 12, 2013 2:18 am
Location: Mountain View, CA

Re: Python: Automatic Download Manager

Postby precyoz » Sat Jul 13, 2013 1:37 pm

I have tried this code to download a file (a folder that has an updated file everyday) from an ftp site:

Code: Select all
import os
from ftplib import FTP

ftp = FTP("","myuser", "mypass")


listing = []
ftp.retrlines("LIST", listing.append)
words = listing[0].split(None, 8)
filename = words[-1].lstrip()

#download the file
local_filename = os.path.join(r"C:\example", file)
lf = open(local_filename, "wb")
ftp.retrbinary("RETR " + filename, lf.write, 8*1024)

But when i run the script, it says:

Traceback (most recent call last):
File "C:/Users/turtle/Desktop/OUTPUT/", line 4, in <module>
ftp = FTP("", "myuser", "mypass")
File "C:\Python27\lib\", line 117, in __init__
File "C:\Python27\lib\", line 132, in connect
self.sock = socket.create_connection((, self.port), self.timeout)
File "C:\Python27\lib\", line 553, in create_connection
for res in getaddrinfo(host, port, 0, SOCK_STREAM):
gaierror: [Errno 11004] getaddrinfo failed

Can you tell me what should be the correct code?
Last edited by precyoz on Mon Jul 15, 2013 4:06 am, edited 2 times in total.
Posts: 18
Joined: Wed Jul 03, 2013 6:23 am

Re: Python: Automatic Download Manager

Postby snippsat » Sat Jul 13, 2013 2:46 pm

Change your code to ftp = FTP("", "myuser", "mypass")
The ftp:// is only used for a URl connetion,ftplib library expect the hostname of your FTP server.
User avatar
Posts: 1250
Joined: Thu Feb 21, 2013 12:04 am

Re: Python: Automatic Download Manager

Postby precyoz » Mon Jul 15, 2013 4:05 am

Thanks for your help. :)

I just made the ftp shorter.
Code: Select all
ftp = FTP("", "myuser", "mypass")

But it's getting this error.
Code: Select all
Traceback (most recent call last):
  File "C:\Users\turtle\Desktop\OUTPUT\", line 4, in <module>
    ftp = FTP("", "ljvillarin30", "skies-zen")
  File "C:\Python27\lib\", line 119, in __init__
    self.login(user, passwd, acct)
  File "C:\Python27\lib\", line 387, in login
    resp = self.sendcmd('USER ' + user)
  File "C:\Python27\lib\", line 244, in sendcmd
    return self.getresp()
  File "C:\Python27\lib\", line 219, in getresp
    raise error_perm, resp
error_perm: 530 Permission denied.

What was 530 Permission Denied means? :? Is it all about the passive/active mode issue? Or is it about the ftp/HTTP proxy? :?
Posts: 18
Joined: Wed Jul 03, 2013 6:23 am

Re: Python: Automatic Download Manager

Postby precyoz » Thu Jul 18, 2013 6:55 am

Can anyone Help me about the "530 Permission Denied" error in my script?
Posts: 18
Joined: Wed Jul 03, 2013 6:23 am

Return to General Discussions

Who is online

Users browsing this forum: No registered users and 5 guests