sharkcz / rpms / calibre

Forked from rpms/calibre 4 years ago
Clone
Blob Blame History Raw
From 5c11a09575a33aacb161aada10296ba16a15f74e Mon Sep 17 00:00:00 2001
From: Kovid Goyal <kovid@kovidgoyal.net>
Date: Mon, 19 Aug 2019 08:27:33 +0530
Subject: [PATCH 71/71] Update Foreign Affairs

---
 recipes/foreignaffairs.recipe | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/recipes/foreignaffairs.recipe b/recipes/foreignaffairs.recipe
index 60f095db5c..1f1b89175f 100644
--- a/recipes/foreignaffairs.recipe
+++ b/recipes/foreignaffairs.recipe
@@ -164,8 +164,7 @@ class ForeignAffairsRecipe(BasicNewsRecipe):
     FRONTPAGE = INDEX + '/magazine'
 
     keep_only_tags = [
-        dict(attrs={'class': lambda x: x and set(x.split()).intersection(
-            set('article-header l-article-column'.split()))}),
+        classes('article-header article-body'),
     ]
 
     conversion_options = {'comments': description, 'tags': category, 'language': 'en',
@@ -199,8 +198,9 @@ def preprocess_raw_html(self, raw_html, url):
         return html.tostring(root, encoding='unicode')
 
     def preprocess_html(self, soup):
-        for img in soup.findAll('img', attrs={'ng-src': True}):
-            img['src'] = img['ng-src']
+        for attr in ('ng-src', 'data-blazy'):
+            for img in soup.findAll('img', attrs={attr: True}):
+                img['src'] = img[attr]
         return soup
 
     def get_browser(self):