From 68e82904faa39b5e4187fbb8cac5fa36c217b56b Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 10 Jul 2022 20:20:03 +0530 Subject: [PATCH] BQ Prime by unkn0wn --- recipes/bq_prime.recipe | 45 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 recipes/bq_prime.recipe diff --git a/recipes/bq_prime.recipe b/recipes/bq_prime.recipe new file mode 100644 index 0000000000..b0cedb2a96 --- /dev/null +++ b/recipes/bq_prime.recipe @@ -0,0 +1,45 @@ +from calibre.web.feeds.news import BasicNewsRecipe, classes + + +class bq(BasicNewsRecipe): + title = u'BQ Prime' + description = 'Bloomberg Quint: India’s premier multi-platform business and financial news company.' + language = 'en_IN' + __author__ = 'unkn0wn' + oldest_article = 2 # days + max_articles_per_feed = 50 + encoding = 'utf-8' + use_embedded_content = False + no_stylesheets = True + remove_attributes = ['style', 'height', 'width'] + masthead_url = 'https://www.bqprime.com/icons/bqprime-blue.svg' + ignore_duplicate_articles = {'url'} + + keep_only_tags = [ + classes( + 'story-base-template-m__story-content__1sSai print-story-card story-element-text' + ), + dict(name='img', attrs={'property': 'og:image'}) + ] + + remove_tags = [ + classes( + 'desktop-hidden desktop-only bm-container bookmark-m__bookmark-container__30eHl bookmark-m__container__23o1v' + ), + dict(name='div', attrs={'id': 'piano-preview-story'}) + ] + + feeds = [ + ('Articles', 'https://www.bqprime.com/stories.rss'), + ] + + def preprocess_raw_html(self, raw_html, url): + return raw_html.replace('