mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Covers for mit tech review and seminar magazine
This commit is contained in:
parent
38e1594921
commit
c64eb65376
@ -50,11 +50,11 @@ class MitTechnologyReview(BasicNewsRecipe):
|
||||
def parse_index(self):
|
||||
soup = self.index_to_soup(self.INDEX)
|
||||
# find cover
|
||||
self.cover_url = absurl(soup.find(
|
||||
self.cover_url = soup.find(
|
||||
"div", attrs={"class":lambda name: name.startswith("magazineHero__image") if name else False}).find(
|
||||
"img",
|
||||
src=True
|
||||
)['src'])
|
||||
src=True, attrs={"class":lambda x: x.startswith('image__img') if x else False}
|
||||
)['src']
|
||||
# parse articles
|
||||
current_articles = []
|
||||
classNamePrefixes = ["magazineHero__letter--", "teaserItem__title", "teaserItem--aside__title"]
|
||||
|
@ -14,11 +14,12 @@ class Seminar(BasicNewsRecipe):
|
||||
remove_javascript = True
|
||||
masthead_url = 'https://www.india-seminar.com/semlogo/semlogo_top_1.jpg'
|
||||
ignore_duplicate_articles = {'url'}
|
||||
remove_attributes = ['style', 'height', 'width']
|
||||
|
||||
def get_cover_url(self):
|
||||
cover_url = None
|
||||
soup = self.index_to_soup('https://www.india-seminar.com/')
|
||||
citem = soup.find('img', src=lambda x: x and x.endswith('cover.png'))
|
||||
citem = soup.find('img', src=lambda x: x and 'covers' in x)
|
||||
if citem:
|
||||
cover_url = "https://www.india-seminar.com/" + citem['src']
|
||||
return cover_url
|
||||
|
Loading…
x
Reference in New Issue
Block a user