From 213dee41dab0138bfb97327c8a52bf32f0679b14 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 22 Dec 2022 11:04:09 +0530 Subject: [PATCH] Economist: Dont download interactive articles They dont work well and break conversion to EPUB with giant embedded SVG images. Fixes #2000279 [Fetch news for The Economist fails](https://bugs.launchpad.net/calibre/+bug/2000279) --- recipes/economist.recipe | 3 +++ recipes/economist_free.recipe | 3 +++ 2 files changed, 6 insertions(+) diff --git a/recipes/economist.recipe b/recipes/economist.recipe index 43063f2c4b..977a94c143 100644 --- a/recipes/economist.recipe +++ b/recipes/economist.recipe @@ -307,6 +307,9 @@ class Economist(BasicNewsRecipe): sub = safe_dict(part, "print", "subheadline") or '' if sub and section != sub: desc = sub + ' :: ' + desc + if '/interactive/' in url: + self.log('Skipping interactive article:', title, url) + continue feeds_dict[section].append({"title": title, "url": url, "description": desc}) self.log(' ', title, url, '\n ', desc) return [(section, articles) for section, articles in feeds_dict.items()] diff --git a/recipes/economist_free.recipe b/recipes/economist_free.recipe index 43063f2c4b..977a94c143 100644 --- a/recipes/economist_free.recipe +++ b/recipes/economist_free.recipe @@ -307,6 +307,9 @@ class Economist(BasicNewsRecipe): sub = safe_dict(part, "print", "subheadline") or '' if sub and section != sub: desc = sub + ' :: ' + desc + if '/interactive/' in url: + self.log('Skipping interactive article:', title, url) + continue feeds_dict[section].append({"title": title, "url": url, "description": desc}) self.log(' ', title, url, '\n ', desc) return [(section, articles) for section, articles in feeds_dict.items()]