mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
NatGeo update
This commit is contained in:
parent
9b97543bef
commit
71c4c2af20
@ -41,6 +41,7 @@ def parse_lead_image(media):
|
|||||||
yield '<div class="cap">' + media['caption'] + '</div>'
|
yield '<div class="cap">' + media['caption'] + '</div>'
|
||||||
if 'credit' in media:
|
if 'credit' in media:
|
||||||
yield '<div class="cred">' + media['credit'] + '</div>'
|
yield '<div class="cred">' + media['credit'] + '</div>'
|
||||||
|
yield '</p>'
|
||||||
|
|
||||||
|
|
||||||
def parse_body(item):
|
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'
|
masthead_url = 'https://i.natgeofe.com/n/e76f5368-6797-4794-b7f6-8d757c79ea5c/ng-logo-2fl.png?w=600&h=600'
|
||||||
remove_empty_feeds = True
|
remove_empty_feeds = True
|
||||||
resolve_internal_links = True
|
resolve_internal_links = True
|
||||||
|
ignore_duplicate_articles = {'url'}
|
||||||
|
|
||||||
extra_css = '''
|
extra_css = '''
|
||||||
.sub, blockquote { color:#404040; }
|
.sub, blockquote { color:#404040; }
|
||||||
@ -171,5 +173,6 @@ class NatGeo(BasicNewsRecipe):
|
|||||||
|
|
||||||
def preprocess_html(self, soup):
|
def preprocess_html(self, soup):
|
||||||
for img in soup.findAll('img', src=True):
|
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
|
return soup
|
||||||
|
@ -40,6 +40,7 @@ def parse_lead_image(media):
|
|||||||
yield '<div class="cap">' + media['caption'] + '</div>'
|
yield '<div class="cap">' + media['caption'] + '</div>'
|
||||||
if 'credit' in media:
|
if 'credit' in media:
|
||||||
yield '<div class="cred">' + media['credit'] + '</div>'
|
yield '<div class="cred">' + media['credit'] + '</div>'
|
||||||
|
yield '</p>'
|
||||||
|
|
||||||
|
|
||||||
def parse_body(item):
|
def parse_body(item):
|
||||||
@ -156,5 +157,6 @@ class NatGeo(BasicNewsRecipe):
|
|||||||
|
|
||||||
def preprocess_html(self, soup):
|
def preprocess_html(self, soup):
|
||||||
for img in soup.findAll('img', src=True):
|
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'
|
img['src'] = img['src'] + '?w=1000&h=1000'
|
||||||
return soup
|
return soup
|
||||||
|
@ -45,6 +45,7 @@ def parse_lead_image(media):
|
|||||||
yield '<div class="cap">' + media['caption'] + '</div>'
|
yield '<div class="cap">' + media['caption'] + '</div>'
|
||||||
if 'credit' in media:
|
if 'credit' in media:
|
||||||
yield '<div class="cred">' + media['credit'] + '</div>'
|
yield '<div class="cred">' + media['credit'] + '</div>'
|
||||||
|
yield '</p>'
|
||||||
|
|
||||||
|
|
||||||
def parse_body(item):
|
def parse_body(item):
|
||||||
@ -175,5 +176,6 @@ class NatGeo(BasicNewsRecipe):
|
|||||||
|
|
||||||
def preprocess_html(self, soup):
|
def preprocess_html(self, soup):
|
||||||
for img in soup.findAll('img', src=True):
|
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
|
return soup
|
||||||
|
Loading…
x
Reference in New Issue
Block a user