mirror of
git://github.com/kovidgoyal/calibre.git
synced 2025-12-06 10:15:33 +01:00
Compare commits
2 commits
91697b777a
...
4a5e505ccf
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4a5e505ccf | ||
|
|
7b64f8a396 |
2 changed files with 12 additions and 2 deletions
|
|
@ -14,12 +14,22 @@ class IndiaLegalLive(BasicNewsRecipe):
|
|||
no_stylesheets = True
|
||||
remove_attributes = ['style', 'height', 'width']
|
||||
|
||||
masthead_url = 'https://d2r2ijn7njrktv.cloudfront.net/IL/uploads/2020/12/03181846/india-legal-live-logo-218x73-1.png'
|
||||
|
||||
def get_cover_url(self):
|
||||
soup = self.index_to_soup('https://www.indialegallive.com/')
|
||||
for citem in soup.findAll('img', src=lambda s: s and s.endswith('shot.jpg')):
|
||||
return citem['src']
|
||||
|
||||
keep_only_tags = [
|
||||
dict(name='h1'),
|
||||
classes(
|
||||
'tdb_single_subtitle tdb_single_date tdb_single_featured_image tdb_single_content'
|
||||
),
|
||||
]
|
||||
remove_tags = [
|
||||
dict(name='div', attrs={'style':'position:absolute;top:0;left:-9999px;'}),
|
||||
]
|
||||
|
||||
feeds = [
|
||||
('Courts', 'https://www.indialegallive.com/constitutional-law-news/courts-news/rss'),
|
||||
|
|
|
|||
|
|
@ -733,9 +733,9 @@ def populate_anchors(self, name):
|
|||
frag = item.get('id', None) or item.get('name')
|
||||
if not frag:
|
||||
continue
|
||||
text = lead_text(item, num_words=4)
|
||||
text = lead_text(item, num_words=4).strip()
|
||||
ac.append((text, frag))
|
||||
ac.sort(key=lambda text_frag: numeric_sort_key(text_frag[0]))
|
||||
ac.sort(key=lambda text_frag: numeric_sort_key(text_frag[0] or text_frag[1]))
|
||||
self.anchor_names.model().set_names(self.anchor_cache[name])
|
||||
self.update_target()
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue