471,356 Members | 1,637 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,356 software developers and data experts.

Script to Download Ubuntu Gutsy ASAP

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
da*******@gmail.com
http://danfolkes.com

Oct 18 '07 #1
1 1282
On 10/18/07, danfolkes <da*******@gmail.comwrote:
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.

--
http://www.advogato.org/person/eopadoan/
Bookmarks: http://del.icio.us/edcrypt
Oct 18 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

8 posts views Thread by Martin Maney | last post: by
2 posts views Thread by SPE - Stani's Python Editor | last post: by
2 posts views Thread by Danny Boy | last post: by
11 posts views Thread by Ix | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.