Script to Download Ubuntu Gutsy ASAP

D

danfolkes

I thought I would post the source to a program that I made that will
download the http://ubuntu.media.mit.edu/ubuntu-releases/gutsy/
as soon as its posted.

It checks the site every 10 min time.sleep(600)

This is mostly untested so I would appreciate comments, and if you use
it, post that too! :)
<code>

import time
import urllib

mysock = urllib.urlopen("http://ubuntu.media.mit.edu/ubuntu-releases/
gutsy/ubunt
u-7.10-desktop-i386.iso")
#print mysock
while 1:
image = mysock.read()
if image[0:1]!='<':
oFile = open(r"image.iso",'wb')
oFile.write(image)
oFile.close
break
exit
print "Wait ", time.localtime()
time.sleep(600)


</code>

enjoy,
Daniel Folkes
(e-mail address removed)
http://danfolkes.com
 
E

Eduardo O. Padoan

I thought I would post the source to a program that I made that will
download the http://ubuntu.media.mit.edu/ubuntu-releases/gutsy/
as soon as its posted.

It checks the site every 10 min time.sleep(600)

This is mostly untested so I would appreciate comments, and if you use
it, post that too! :)
<code>

import time
import urllib

mysock = urllib.urlopen("http://ubuntu.media.mit.edu/ubuntu-releases/
gutsy/ubunt
u-7.10-desktop-i386.iso")
#print mysock
while 1:
image = mysock.read()
if image[0:1]!='<':
oFile = open(r"image.iso",'wb')
oFile.write(image)
oFile.close
break
exit
print "Wait ", time.localtime()
time.sleep(600)


</code>

enjoy,

Please, don't do it. Use the torrent, Luke.
Also, use the HTTP error code - while the file is not at the server,
you will receive a 404, I think.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,902
Latest member
Elena68X5

Latest Threads

Top