should be 1 MB max. how can I ?
self.MAX_SIZE = 1024 * 1024
try:
response = requests.get(href, stream=True)
total = response.headers.get('content-length')
if len(total) > self.MAX_SIZE:
print "maximum size (%d kbs)" % (self.MAX_SIZE/1024)
else:
if total is None:
pass
else:
os.system('wget -P %s %s'%(PATH, href))
except Exception as e:
pass
What is the output you're getting?
Обсуждают сегодня