From 71c4c2af203f39feec648d12663317f6a2c2d74d Mon Sep 17 00:00:00 2001
From: unkn0w7n <51942695+unkn0w7n@users.noreply.github.com>
Date: Thu, 2 Nov 2023 13:05:57 +0530
Subject: [PATCH] NatGeo update
---
recipes/natgeo.recipe | 5 ++++-
recipes/natgeohis.recipe | 2 ++
recipes/natgeomag.recipe | 4 +++-
3 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/recipes/natgeo.recipe b/recipes/natgeo.recipe
index 75be28af39..920cc92332 100644
--- a/recipes/natgeo.recipe
+++ b/recipes/natgeo.recipe
@@ -41,6 +41,7 @@ def parse_lead_image(media):
yield '
' + media['caption'] + '
'
if 'credit' in media:
yield '' + media['credit'] + '
'
+ yield ''
def parse_body(item):
@@ -124,6 +125,7 @@ class NatGeo(BasicNewsRecipe):
masthead_url = 'https://i.natgeofe.com/n/e76f5368-6797-4794-b7f6-8d757c79ea5c/ng-logo-2fl.png?w=600&h=600'
remove_empty_feeds = True
resolve_internal_links = True
+ ignore_duplicate_articles = {'url'}
extra_css = '''
.sub, blockquote { color:#404040; }
@@ -171,5 +173,6 @@ class NatGeo(BasicNewsRecipe):
def preprocess_html(self, soup):
for img in soup.findAll('img', src=True):
- img['src'] = img['src'] + '?w=700&h=700'
+ # for high res images use '?w=2000&h=2000'
+ img['src'] = img['src'] + '?w=1000&h=1000'
return soup
diff --git a/recipes/natgeohis.recipe b/recipes/natgeohis.recipe
index e23c17859a..b5d74258b9 100644
--- a/recipes/natgeohis.recipe
+++ b/recipes/natgeohis.recipe
@@ -40,6 +40,7 @@ def parse_lead_image(media):
yield '' + media['caption'] + '
'
if 'credit' in media:
yield '' + media['credit'] + '
'
+ yield ''
def parse_body(item):
@@ -156,5 +157,6 @@ class NatGeo(BasicNewsRecipe):
def preprocess_html(self, soup):
for img in soup.findAll('img', src=True):
+ # for high res images use '?w=2000&h=2000'
img['src'] = img['src'] + '?w=1000&h=1000'
return soup
diff --git a/recipes/natgeomag.recipe b/recipes/natgeomag.recipe
index 9089ae444d..bec1e910c0 100644
--- a/recipes/natgeomag.recipe
+++ b/recipes/natgeomag.recipe
@@ -45,6 +45,7 @@ def parse_lead_image(media):
yield '' + media['caption'] + '
'
if 'credit' in media:
yield '' + media['credit'] + '
'
+ yield ''
def parse_body(item):
@@ -175,5 +176,6 @@ class NatGeo(BasicNewsRecipe):
def preprocess_html(self, soup):
for img in soup.findAll('img', src=True):
- img['src'] = img['src'] + '?w=1000&h=1000'
+ # for high res images use '?w=2000&h=2000'
+ img['src'] = img['src'] + '?w=1200&h=1200'
return soup