Debian Codegraph @

recipes/india_legal_magazine.recipe

raw
1 #!/usr/bin/env python
2
3 from calibre.web.feeds.news import BasicNewsRecipe, classes
4
5
6 class IndiaLegalLive(BasicNewsRecipe):
7 title = 'India Legal Magazine'
8 language = 'en_IN'
9 __author__ = 'unkn0wn'
10 oldest_article = 7 # days
11 max_articles_per_feed = 50
12 encoding = 'utf-8'
13 use_embedded_content = False
14 no_stylesheets = True
15 remove_attributes = ['style', 'height', 'width']
16
17 masthead_url = 'https://d2r2ijn7njrktv.cloudfront.net/IL/uploads/2020/12/03181846/india-legal-live-logo-218x73-1.png'
18
19 def get_cover_url(self):
20 soup = self.index_to_soup('https://www.indialegallive.com/')
21 for citem in soup.findAll('img', src=lambda s: s and s.endswith('shot.jpg')):
22 return citem['src']
23
24 keep_only_tags = [
25 dict(name='h1'),
26 classes('tdb_single_subtitle tdb_single_date tdb_single_featured_image tdb_single_content'),
27 ]
28 remove_tags = [
29 dict(name='div', attrs={'style': 'position:absolute;top:0;left:-9999px;'}),
30 ]
31
32 feeds = [
33 ('Courts', 'https://www.indialegallive.com/constitutional-law-news/courts-news/rss'),
34 ('Ring Side', 'https://www.indialegallive.com/ringside/rss'),
35 ('Cover Story Articles', 'https://www.indialegallive.com/cover-story-articles/rss'),
36 ('Special', 'https://www.indialegallive.com/special/rss'),
37 ('Columns', 'https://www.indialegallive.com/column-news/rss'),
38 ]