From 28340111d1c1dca31205584080bd53617c8c1d2d Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 26 Jul 2024 10:47:11 +0530 Subject: [PATCH] pep8 --- recipes/corriere_della_sera_en.recipe | 16 ++++++++-------- recipes/el_correo.recipe | 10 ++-------- 2 files changed, 10 insertions(+), 16 deletions(-) diff --git a/recipes/corriere_della_sera_en.recipe b/recipes/corriere_della_sera_en.recipe index 83821dc214..3606d0eb7e 100644 --- a/recipes/corriere_della_sera_en.recipe +++ b/recipes/corriere_della_sera_en.recipe @@ -37,12 +37,6 @@ class ilCorriereEn(BasicNewsRecipe): remove_javascript = True no_stylesheets = True - def get_article_url(self, article): - articleUrl = article.get('link') - segments = articleUrl.split('/') - basename = '/'.join(segments[:3]) + '/' + \ - 'International/english/articoli/' - recipe_specific_options = { 'days': { 'short': 'Oldest article to download from this news source. In days ', @@ -57,7 +51,13 @@ class ilCorriereEn(BasicNewsRecipe): if d and isinstance(d, str): self.oldest_article = float(d) - # the date has to be redone with the url structure + def get_article_url(self, article): + articleUrl = article.get('link') + segments = articleUrl.split('/') + basename = '/'.join(segments[:3]) + '/' + \ + 'International/english/articoli/' + + # the date has to be redone with the url structure mlist1 = ['gennaio', 'febbraio', 'marzo', 'aprile', 'maggio', 'giugno', 'luglio', 'agosto', 'settembre', 'ottobre', 'novembre', 'dicembre'] mlist2 = ['01', '02', '03', '04', '05', @@ -71,7 +71,7 @@ class ilCorriereEn(BasicNewsRecipe): newDateUrl = '20' + myDate[0] + '/' + noMonth + '/' + myDate[2] + '/' - # clean the article title + # clean the article title articleURLseg = segments[5].split('-') myArticle = (articleURLseg[0])[:-9] + '.shtml' diff --git a/recipes/el_correo.recipe b/recipes/el_correo.recipe index 158cf4cc75..5f42a7aa2e 100644 --- a/recipes/el_correo.recipe +++ b/recipes/el_correo.recipe @@ -22,7 +22,7 @@ class elcorreo(BasicNewsRecipe): remove_empty_feeds = True resolve_internal_links = True max_articles_per_feed = 25 # articles - compress_news_images = True + compress_news_images = True recipe_specific_options = { 'days': { @@ -63,7 +63,7 @@ class elcorreo(BasicNewsRecipe): dict(attrs={'data-voc-component':['dropdown', 'modal', 'slider-grab']}), classes( 'v-mdl-ath__img-c v-adv v-i-b v-mdl-ath__c--2 v-d-cmp-adv v-d-cmp-nws ' - 'v-pill-m--zoom v-stk-adv slider-grab g-artboard v-d-cmp-rld v-pill-m--glly' + 'v-pill-m--zoom v-stk-adv slider-grab g-artboard v-d-cmp-rld v-pill-m--glly' ) ] @@ -96,12 +96,6 @@ class elcorreo(BasicNewsRecipe): } } - def __init__(self, *args, **kwargs): - BasicNewsRecipe.__init__(self, *args, **kwargs) - d = self.recipe_specific_options.get('days') - if d and isinstance(d, str): - self.oldest_article = float(d) - def get_browser(self, *args, **kwargs): kwargs['user_agent'] = 'Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)' br = BasicNewsRecipe.get_browser(self, *args, **kwargs)