Update toiprint.recipe

This commit is contained in:
unkn0w7n 2023-11-25 10:43:36 +05:30
parent 0fc95de045
commit 2d3d47fc7f

View File

@ -95,6 +95,13 @@ class toiprint(BasicNewsRecipe):
def preprocess_raw_html(self, raw, *a): def preprocess_raw_html(self, raw, *a):
data = json.loads(raw) data = json.loads(raw)
tags = []
for x in data:
tags.append(x['TagName'])
if not any(x in {'ArticleBody', 'Photographs'} for x in tags):
self.abort_article('not an article')
body = '' body = ''
for x in data: for x in data:
if x['TagName'] == 'ArticleTitle': if x['TagName'] == 'ArticleTitle':