Похожие чаты

My piece of code downloads more then 1MB when it

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

1 ответов

5 просмотров

What is the output you're getting?

Похожие вопросы

Обсуждают сегодня

Карта сайта