This commit is contained in:
Kovid Goyal 2024-07-22 11:17:58 +05:30
parent d483644f7c
commit 4c7255854d
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 4 additions and 8 deletions

View File

@ -19,25 +19,22 @@ class LiveMint(BasicNewsRecipe):
remove_attributes = ['style', 'height', 'width']
masthead_url = 'https://images.livemint.com/static/livemint-logo-v1.svg'
recipe_specific_options = {
recipe_specific_options = {
'days': {
'short': 'Oldest article to download from this news source. In days ',
'long': 'For example, 0.5, gives you articles from the past 12 hours',
'default': str(oldest_article)
}
}
remove_empty_feeds = True
resolve_internal_links = True
def __init__(self, *args, **kwargs):
BasicNewsRecipe.__init__(self, *args, **kwargs)
d = self.recipe_specific_options.get('days')
if d and isinstance(d, str):
self.oldest_article = float(d)
remove_empty_feeds = True
resolve_internal_links = True
def __init__(self, *args, **kwargs):
BasicNewsRecipe.__init__(self, *args, **kwargs)
if self.output_profile.short_name.startswith('kindle'):
self.title = 'Mint | ' + date.today().strftime('%b %d, %Y')
if is_saturday:

View File

@ -192,7 +192,6 @@ class NatGeo(BasicNewsRecipe):
# self.cover_url = png[0] + '?w=1000&h=1000'
self.cover_url = soup.find('meta', attrs={'property':'og:image'})['content'].split('?')[0] + '?w=1000'
name = soup.find(attrs={'class':lambda x: x and 'Header__Description' in x.split()})
# self.title = 'National Geographic ' + self.tag_to_string(name)
ans = {}
if photoart := soup.find(attrs={'class':lambda x: x and 'BgImagePromo__Container__Text__Link' in x.split()}):