Update Project Syndicate

This commit is contained in:
unkn0w7n 2023-10-23 12:35:47 +05:30
parent 9cc8fb137e
commit 87a0130f14
3 changed files with 10 additions and 4 deletions

View File

@ -132,4 +132,6 @@ class ft(BasicNewsRecipe):
for con in soup.findAll(attrs={'class':'n-content-layout__slot'}): for con in soup.findAll(attrs={'class':'n-content-layout__slot'}):
if con.find('figure'): if con.find('figure'):
con['id'] = 'fig' con['id'] = 'fig'
if h3 := soup.find(**classes('o-topper__standfirst')):
h3.name = 'h3'
return soup return soup

View File

@ -98,7 +98,7 @@ class LiveMint(BasicNewsRecipe):
classes( classes(
'trendingSimilarHeight moreNews mobAppDownload label msgError msgOk taboolaHeight' 'trendingSimilarHeight moreNews mobAppDownload label msgError msgOk taboolaHeight'
' socialHolder imgbig disclamerText disqus-comment-count openinApp2 lastAdSlot' ' socialHolder imgbig disclamerText disqus-comment-count openinApp2 lastAdSlot'
' datePublish sepStory premiumSlider moreStory' ' datePublish sepStory premiumSlider moreStory Joinus'
) )
] ]
@ -149,6 +149,9 @@ class LiveMint(BasicNewsRecipe):
span.extract() span.extract()
for img in soup.findAll('img', attrs={'data-src': True}): for img in soup.findAll('img', attrs={'data-src': True}):
img['src'] = img['data-src'] img['src'] = img['data-src']
if wa := soup.find(**classes('autobacklink-topic')):
if p := wa.findParent('p'):
p.extract()
return soup return soup
def populate_article_metadata(self, article, soup, first): def populate_article_metadata(self, article, soup, first):

View File

@ -61,9 +61,10 @@ class projectsynd(BasicNewsRecipe):
def preprocess_html(self, soup): def preprocess_html(self, soup):
for img in soup.findAll('img', attrs={'old-src':True}): for img in soup.findAll('img', attrs={'old-src':True}):
img['src'] = img['old-src'].replace('medium', 'xlarge') img['src'] = img['old-src'].replace('medium', 'xlarge')
if abst := soup.find(attrs={'itemprop':'abstract'}).find('div'): if abst := soup.find(attrs={'itemprop':'abstract'}):
abst.name = 'p' if div := abst.find('div'):
abst['class'] = 'sub' div.name = 'p'
div['class'] = 'sub'
for div in soup.findAll('div', attrs={'data-line-id':True}): for div in soup.findAll('div', attrs={'data-line-id':True}):
div.name = 'p' div.name = 'p'
for a in soup.findAll('a', href=True): for a in soup.findAll('a', href=True):