From e06288bc50e2e7b34ff5fc52b83e347b86ae80b8 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 11 Feb 2017 13:52:23 +0530 Subject: [PATCH] News download: Allow individual recipes to turn on gzip transfer encoding --- src/calibre/web/feeds/news.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/calibre/web/feeds/news.py b/src/calibre/web/feeds/news.py index 37fe4b594c..1e9ad4718e 100644 --- a/src/calibre/web/feeds/news.py +++ b/src/calibre/web/feeds/news.py @@ -389,6 +389,10 @@ class BasicNewsRecipe(Recipe): #: with the URL scheme of your particular website. resolve_internal_links = False + #: Set to True if you want to use gziped transfers. Note that some old servers flake out with this + #: so it is off by default. + handle_gzip = False + # See the built-in recipes for examples of these settings. def short_title(self): @@ -492,6 +496,8 @@ class BasicNewsRecipe(Recipe): ''' br = browser(*args, **kwargs) br.addheaders += [('Accept', '*/*')] + if self.handle_gzip: + br.set_handle_gzip(True) return br def clone_browser(self, br):