This commit is contained in:
Kovid Goyal 2023-09-26 20:14:54 +05:30
parent 3c83a23a88
commit 209f04025f
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -13,7 +13,7 @@ dt = datetime(year, month, day)
class BusinessStandardPrint(BasicNewsRecipe):
title = 'Business Standard Print Edition'
__author__ = 'unkn0wn'
description = 'India's most respected business daily, Articles from Today\'s Paper'
description = "India's most respected business daily, Articles from Today's Paper"
language = 'en_IN'
masthead_url = 'https://bsmedia.business-standard.com/include/_mod/site/html5/images/business-standard-logo.png'
encoding = 'utf-8'
@ -24,7 +24,7 @@ class BusinessStandardPrint(BasicNewsRecipe):
no_stylesheets = True
remove_javascript = True
remove_attributes = ['width', 'height', 'style']
def __init__(self, *args, **kwargs):
BasicNewsRecipe.__init__(self, *args, **kwargs)
if self.output_profile.short_name.startswith('kindle'):
@ -75,7 +75,7 @@ class BusinessStandardPrint(BasicNewsRecipe):
def preprocess_raw_html(self, raw, *a):
root = parse(raw)
m = root.xpath('//script[@id="__NEXT_DATA__"]')
data = json.loads(m[0].text)
img_url = None
@ -83,7 +83,7 @@ class BusinessStandardPrint(BasicNewsRecipe):
img_url = data['props']['pageProps']['articleSchema']['articleImageUrl']
art_url = 'https://www.business-standard.com' + data['props']['pageProps']['url']
data = data['props']['pageProps']['data']
title = '<h1 title="{}">'.format(art_url) + data['pageTitle'] + '</h1>'