download ammofiles of unknown content-length

This commit is contained in:
Tonsofattraction 2015-08-24 15:27:40 +03:00
parent 8a776a3ffc
commit 098971ba4c

View File

@ -158,8 +158,7 @@ class HttpOpener(object):
def open(self, *args, **kwargs):
if self.data_info.status_code == 200:
self._detect_gzip()
if not self.gzip \
and (not self.data_length or not str(self.data_length).isdigit() or int(self.data_length) > 10 ** 8):
if not self.gzip and self.data_length > 10 ** 8:
logging.info(
"Ammofile data is larger than 100MB. Reading from stream..")
return HttpStreamWrapper(self.url)