mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Merge branch 'master' of https://github.com/unkn0w7n/calibre
This commit is contained in:
commit
c376d2e25d
@ -48,6 +48,7 @@ class IndianExpress(BasicNewsRecipe):
|
|||||||
def parse_index(self):
|
def parse_index(self):
|
||||||
|
|
||||||
section_list = [
|
section_list = [
|
||||||
|
('Daily Briefing', 'https://indianexpress.com/section/live-news/'),
|
||||||
('Front Page', 'https://indianexpress.com/print/front-page/'),
|
('Front Page', 'https://indianexpress.com/print/front-page/'),
|
||||||
('India', 'https://indianexpress.com/section/india/'),
|
('India', 'https://indianexpress.com/section/india/'),
|
||||||
# ('Express Network', 'https://indianexpress.com/print/express-network/'),
|
# ('Express Network', 'https://indianexpress.com/print/express-network/'),
|
||||||
|
@ -163,6 +163,14 @@ class NatGeo(BasicNewsRecipe):
|
|||||||
resolve_internal_links = True
|
resolve_internal_links = True
|
||||||
ignore_duplicate_articles = {'url'}
|
ignore_duplicate_articles = {'url'}
|
||||||
|
|
||||||
|
recipe_specific_options = {
|
||||||
|
'res': {
|
||||||
|
'short': 'For hi-res images, select a resolution from the\nfollowing options: 800, 1000, 1200 or 1500',
|
||||||
|
'long': 'This is useful for non e-ink devices, and for a lower file size\nthan the default, use 400 or 300.',
|
||||||
|
'default': '600'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
extra_css = '''
|
extra_css = '''
|
||||||
blockquote { color:#404040; }
|
blockquote { color:#404040; }
|
||||||
.byline, i { font-style:italic; color:#202020; }
|
.byline, i { font-style:italic; color:#202020; }
|
||||||
@ -223,8 +231,11 @@ class NatGeo(BasicNewsRecipe):
|
|||||||
for h2 in soup.findAll('h2'):
|
for h2 in soup.findAll('h2'):
|
||||||
h2.name = 'h4'
|
h2.name = 'h4'
|
||||||
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'
|
res = '?w=600'
|
||||||
img['src'] = img['src'] + '?w=600&h=600'
|
w = self.recipe_specific_options.get('res')
|
||||||
|
if w and isinstance(w, str):
|
||||||
|
res = '?w=' + w
|
||||||
|
img['src'] = img['src'] + res
|
||||||
return soup
|
return soup
|
||||||
|
|
||||||
def populate_article_metadata(self, article, soup, first):
|
def populate_article_metadata(self, article, soup, first):
|
||||||
|
@ -163,6 +163,14 @@ 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'
|
||||||
resolve_internal_links = True
|
resolve_internal_links = True
|
||||||
|
|
||||||
|
recipe_specific_options = {
|
||||||
|
'res': {
|
||||||
|
'short': 'For hi-res images, select a resolution from the\nfollowing options: 800, 1000, 1200 or 1500',
|
||||||
|
'long': 'This is useful for non e-ink devices, and for a lower file size\nthan the default, use 400 or 300.',
|
||||||
|
'default': '600'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
extra_css = '''
|
extra_css = '''
|
||||||
blockquote { color:#404040; }
|
blockquote { color:#404040; }
|
||||||
.byline, i { font-style:italic; color:#202020; }
|
.byline, i { font-style:italic; color:#202020; }
|
||||||
@ -198,8 +206,11 @@ class NatGeo(BasicNewsRecipe):
|
|||||||
for h2 in soup.findAll('h2'):
|
for h2 in soup.findAll('h2'):
|
||||||
h2.name = 'h4'
|
h2.name = 'h4'
|
||||||
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'
|
res = '?w=600'
|
||||||
img['src'] = img['src'] + '?w=600&h=600'
|
w = self.recipe_specific_options.get('res')
|
||||||
|
if w and isinstance(w, str):
|
||||||
|
res = '?w=' + w
|
||||||
|
img['src'] = img['src'] + res
|
||||||
return soup
|
return soup
|
||||||
|
|
||||||
def populate_article_metadata(self, article, soup, first):
|
def populate_article_metadata(self, article, soup, first):
|
||||||
|
@ -176,6 +176,11 @@ class NatGeo(BasicNewsRecipe):
|
|||||||
'date': {
|
'date': {
|
||||||
'short': 'The date of the edition to download (Month-YYYY format)',
|
'short': 'The date of the edition to download (Month-YYYY format)',
|
||||||
'long': 'For example, March-2023'
|
'long': 'For example, March-2023'
|
||||||
|
},
|
||||||
|
'res': {
|
||||||
|
'short': 'For hi-res images, select a resolution from the\nfollowing options: 800, 1000, 1200 or 1500',
|
||||||
|
'long': 'This is useful for non e-ink devices, and for a lower file size\nthan the default, use 400 or 300.',
|
||||||
|
'default': '600'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -231,8 +236,11 @@ class NatGeo(BasicNewsRecipe):
|
|||||||
for h2 in soup.findAll('h2'):
|
for h2 in soup.findAll('h2'):
|
||||||
h2.name = 'h4'
|
h2.name = 'h4'
|
||||||
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'
|
res = '?w=600'
|
||||||
img['src'] = img['src'] + '?w=600&h=600'
|
w = self.recipe_specific_options.get('res')
|
||||||
|
if w and isinstance(w, str):
|
||||||
|
res = '?w=' + w
|
||||||
|
img['src'] = img['src'] + res
|
||||||
return soup
|
return soup
|
||||||
|
|
||||||
def populate_article_metadata(self, article, soup, first):
|
def populate_article_metadata(self, article, soup, first):
|
||||||
|
@ -70,8 +70,7 @@ class outlook(BasicNewsRecipe):
|
|||||||
self.description = self.tag_to_string(summ)
|
self.description = self.tag_to_string(summ)
|
||||||
tme = soup.find(attrs={'class':'arr__timeago'})
|
tme = soup.find(attrs={'class':'arr__timeago'})
|
||||||
if tme:
|
if tme:
|
||||||
self.timefmt = ' [' + self.tag_to_string(tme).strip() + ']'
|
self.timefmt = ' [' + self.tag_to_string(tme).split('-')[-1].strip() + ']'
|
||||||
|
|
||||||
|
|
||||||
ans = []
|
ans = []
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user