I wrote a python program to download a file from the internet :
url = "http://download2163.mediafire.com/icum151v51zg/55rll9s5ioshz5n/Alcohol52_FE_2-0-3-6850.exe"
file_name ='file'
u = urllib2.urlopen(url)
f = open(file_name, 'wb')
buffer = u.read()
f.write(buffer)
f.close()
And it work correctly. The problem is that in this program the link that is used to download the file is not costant ! The file that i want to download was been uploaded using mediafire. I found out that the link of this page (http://www.mediafire.com/download/55rll9s5ioshz5n/Alcohol52_FE_2-0-3-6850.exe) is costant, and in this page I found the link that i put in my program. Infact by clicking on the button "download (6.77 MB)" with the right button of my mouse and selecting "gain this link" , I gained the direct link that I used in my program : http://download2163.mediafire.com/icum151v51zg/55rll9s5ioshz5n/Alcohol52_FE_2-0-3-6850.exe
But this second direct link - that is the direct link I really need - is variable!
I have found the way to gain this variable and important direct link : using the first and costant link(http://www.mediafire.com/download/55rll9s5ioshz5n/Alcohol52_FE_2-0-3-6850.exe) I downloaded the HTML page, and inside of this HTML file I found the direct link that I needed!
The problem is: sometimes when my python program try to download the HTML page it download the right page that contain the direct link, but sometime it download wrong one, with the captcha! So the direct link can not be founded.
I' m looking for a way to avoid this captcha and to be sure that my python program Always download the correct HTML page with the direct link inside !
Any suggestions ?
If there isn't any way, does anyone know how can I gain the direct link of a file that I want upload on the internet and that I want to be downloaded by my python program ?