This commit is contained in:
Kovid Goyal 2022-11-24 13:53:36 +05:30
parent 5a404de21a
commit 11eeaf1f70
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -1,6 +1,7 @@
from collections import defaultdict
from calibre.web.feeds.news import BasicNewsRecipe, classes
class Frontline(BasicNewsRecipe):
title = u'Frontline'
__author__ = 'unkn0wn'
@ -23,12 +24,12 @@ class Frontline(BasicNewsRecipe):
keep_only_tags = [
classes('article')
]
remove_tags = [
classes('shareicon-article articleBottomLine secheader mobilesocialicons'),
dict(name='h2', attrs={'class':'title'})
]
def preprocess_html(self, soup):
for img in soup.findAll('img', attrs={'data-original':True}):
img['src'] = img['data-original']
@ -63,4 +64,4 @@ class Frontline(BasicNewsRecipe):
continue
self.log(section, '\n\t', title, '\n\t', desc, '\n\t\t', url)
feeds_dict[section].append({"title": title, "url": url})
return [(section, articles) for section, articles in feeds_dict.items()]
return [(section, articles) for section, articles in feeds_dict.items()]