From 74a59d04adf855f7c4619f316d2e2f76c3f8ef45 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 4 Mar 2023 06:33:31 +0530 Subject: [PATCH] pep8 --- recipes/dr_dk.recipe | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/recipes/dr_dk.recipe b/recipes/dr_dk.recipe index 814e22d2d6..a9cd6e6bb6 100644 --- a/recipes/dr_dk.recipe +++ b/recipes/dr_dk.recipe @@ -2,7 +2,6 @@ # vim:fileencoding=utf-8 # License: GPLv3 Copyright: 2023, Joel Davies -from __future__ import unicode_literals, division, absolute_import, print_function from calibre.web.feeds.news import BasicNewsRecipe class DRNyheder(BasicNewsRecipe): @@ -52,7 +51,7 @@ class DRNyheder(BasicNewsRecipe): simultaneous_downloads = 20 compress_news_images = True masthead_url = 'https://upload.wikimedia.org/wikipedia/commons/thumb/1/18/DR_logo.svg/1024px-DR_logo.svg.png' - + extra_css = ''' .dre-byline__contributions { margin-bottom: 10px; @@ -75,7 +74,7 @@ class DRNyheder(BasicNewsRecipe): .dre-picture { margin-bottom: 10px; } - + .dre-picture__image { max-width: 100%; height: auto; @@ -86,7 +85,7 @@ class DRNyheder(BasicNewsRecipe): color: #575757; } ''' - + # Skip articles with /stories/ URL as these are Instagram story-style interactive pieces that play videos # Also DRTV as these are just links to the live TV channel def preprocess_raw_html(self, raw_html, url): @@ -103,10 +102,10 @@ class DRNyheder(BasicNewsRecipe): if cover_item: cover_url = cover_item['src'] return cover_url - - + + keep_only_tags = [ - + dict(name="h1", attrs={'class': 'dre-article-title__heading'}), # Title dict(name="div", attrs={'class': 'dre-article-byline'}), # Author dict(name="figure", attrs={'class': 'dre-standard-article__figure'}), # Comment out to remove images @@ -117,10 +116,12 @@ class DRNyheder(BasicNewsRecipe): #dict(name="div", attrs={'class': 'dre-speech'}), #dict(name="div", attrs={'itemprop': 'author'}) ] - + remove_tags = [ dict(name='ol', attrs={'class': 'hydra-latest-news-page__list'}), - dict(name='div', attrs={'class': ['hydra-latest-news-page-short-news__share', 'hydra-latest-news-page-short-news__a11y-container', 'hydra-latest-news-page-short-news__meta', 'hydra-latest-news-page-short-news__image-slider', 'dre-byline__dates']}), + dict(name='div', attrs={'class': [ + 'hydra-latest-news-page-short-news__share', 'hydra-latest-news-page-short-news__a11y-container', + 'hydra-latest-news-page-short-news__meta', 'hydra-latest-news-page-short-news__image-slider', 'dre-byline__dates']}), dict(name="source"), #dict(name='menu', attrs={'class': 'share'}), #dict(name='menu', attrs={'class': 'dr-site-share-horizontal'}),