This commit is contained in:
Lorenzo Di Fuccia 2018-07-11 15:36:18 +02:00
commit 78a1c5aeb1

View file

@ -181,7 +181,7 @@ class SafariBooks:
HEADERS = { HEADERS = {
"accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", "accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"accept-encoding": "gzip, deflate, br", "accept-encoding": "gzip, deflate",
"accept-language": "it-IT,it;q=0.9,en-US;q=0.8,en;q=0.7", "accept-language": "it-IT,it;q=0.9,en-US;q=0.8,en;q=0.7",
"cache-control": "no-cache", "cache-control": "no-cache",
"cookie": "", "cookie": "",
@ -780,8 +780,7 @@ class SafariBooks:
self.display.error("Error trying to retrieve this CSS: %s\n From: %s" % (css_file, url)) self.display.error("Error trying to retrieve this CSS: %s\n From: %s" % (css_file, url))
with open(css_file, 'wb') as s: with open(css_file, 'wb') as s:
for chunk in response.iter_content(1024): s.write(response.content)
s.write(chunk)
self.css_done_queue.put(1) self.css_done_queue.put(1)
self.display.state(len(self.css), self.css_done_queue.qsize()) self.display.state(len(self.css), self.css_done_queue.qsize())