mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
pep8
This commit is contained in:
parent
5a404de21a
commit
11eeaf1f70
@ -1,6 +1,7 @@
|
|||||||
from collections import defaultdict
|
from collections import defaultdict
|
||||||
from calibre.web.feeds.news import BasicNewsRecipe, classes
|
from calibre.web.feeds.news import BasicNewsRecipe, classes
|
||||||
|
|
||||||
|
|
||||||
class Frontline(BasicNewsRecipe):
|
class Frontline(BasicNewsRecipe):
|
||||||
title = u'Frontline'
|
title = u'Frontline'
|
||||||
__author__ = 'unkn0wn'
|
__author__ = 'unkn0wn'
|
||||||
@ -23,12 +24,12 @@ class Frontline(BasicNewsRecipe):
|
|||||||
keep_only_tags = [
|
keep_only_tags = [
|
||||||
classes('article')
|
classes('article')
|
||||||
]
|
]
|
||||||
|
|
||||||
remove_tags = [
|
remove_tags = [
|
||||||
classes('shareicon-article articleBottomLine secheader mobilesocialicons'),
|
classes('shareicon-article articleBottomLine secheader mobilesocialicons'),
|
||||||
dict(name='h2', attrs={'class':'title'})
|
dict(name='h2', attrs={'class':'title'})
|
||||||
]
|
]
|
||||||
|
|
||||||
def preprocess_html(self, soup):
|
def preprocess_html(self, soup):
|
||||||
for img in soup.findAll('img', attrs={'data-original':True}):
|
for img in soup.findAll('img', attrs={'data-original':True}):
|
||||||
img['src'] = img['data-original']
|
img['src'] = img['data-original']
|
||||||
@ -63,4 +64,4 @@ class Frontline(BasicNewsRecipe):
|
|||||||
continue
|
continue
|
||||||
self.log(section, '\n\t', title, '\n\t', desc, '\n\t\t', url)
|
self.log(section, '\n\t', title, '\n\t', desc, '\n\t\t', url)
|
||||||
feeds_dict[section].append({"title": title, "url": 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()]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user