diff --git a/recipes/natgeohis.recipe b/recipes/natgeohis.recipe index 808127cc84..d562e6b69a 100644 --- a/recipes/natgeohis.recipe +++ b/recipes/natgeohis.recipe @@ -120,6 +120,11 @@ class NatGeo(BasicNewsRecipe): .auth, .time { font-size:small; color:#5c5c5c; } ''' + def get_cover_url(self): + soup = self.index_to_soup('https://ngsingleissues.nationalgeographic.com/history') + wrap = soup.find(attrs={'class':'product-image-wrapper'}) + return wrap.img['src'] + def parse_index(self): soup = self.index_to_soup('https://www.nationalgeographic.com/history/history-magazine') ans = [] @@ -134,7 +139,7 @@ class NatGeo(BasicNewsRecipe): def preprocess_raw_html(self, raw_html, url): data = extract_json(raw_html) return '\n'.join(article_parse(data)) - + def preprocess_html(self, soup): for img in soup.findAll('img', src=True): img['src'] = img['src'] + '?w=1000&h=1000'