From 76ba1fb504ce4240b095816f7e7ac07cad94308a Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 27 Nov 2014 09:33:01 +0530 Subject: [PATCH] Update The New Yorker --- recipes/new_yorker.recipe | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/recipes/new_yorker.recipe b/recipes/new_yorker.recipe index 7c01816f5a..1854110cad 100644 --- a/recipes/new_yorker.recipe +++ b/recipes/new_yorker.recipe @@ -3,6 +3,7 @@ __license__ = 'GPL v3' from calibre.web.feeds.news import BasicNewsRecipe +from calibre import browser class NewYorker(BasicNewsRecipe): @@ -28,6 +29,7 @@ class NewYorker(BasicNewsRecipe): h3 { margin-bottom: 6px; } .caption { font-size: xx-small; font-style: italic; font-weight: normal; } ''' + needs_subscription = 'optional' def parse_index(self): soup = self.index_to_soup('http://www.newyorker.com/magazine?intcid=magazine') @@ -57,3 +59,18 @@ class NewYorker(BasicNewsRecipe): 'description':desc}) return [('Current Issue', articles)] + + # The New Yorker changes the content it delivers based on cookies, so the + # following ensures that we send no cookies + def get_browser(self, *args, **kwargs): + return self + + def clone_browser(self, *args, **kwargs): + return self.get_browser() + + def open_novisit(self, *args, **kwargs): + br = browser() + return br.open_novisit(*args, **kwargs) + open = open_novisit + +