Welcome to HBH! If you have tried to register and didn't get a verification email, please using the following link to resend the verification email.

Automatic Program script


maspur's Avatar
Member
0 0

i want to make an automatic file download program from URL

can anyone help me come up with an idea?


Huitzilopochtli's Avatar
....
10 9

You haven't given us a lot of information to work with there man.

Anyway, if it's a static url ie : http://www.site.com/downloads/file.xxx

Using Python 2+

import urllib urllib.urlretrieve ("url", "file.xxx")

Using Python 3+

import urllib.request urllib.request.urlretrieve("url", "file,xxx")

Or using wget:

import wget wget.download('url')

Or if the link changes and is embedded in a webpage:

Send a GET request to the page where the link is. Search the returned html for the correct href tag containing the link. Open the link via one of the above.


maspur's Avatar
Member
0 0

How about using batch.?


Huitzilopochtli's Avatar
....
10 9

Both wget and curl can be used with batch.


maspur's Avatar
Member
0 0

can i put this program code in html?

for example, when someone opens my web he will automatically download my file.3


Huitzilopochtli's Avatar
....
10 9

Probably not. Try an iframe or window.open("link/to/file");