From 1dfe8ebee859a50873074c406ebcb637a98a8bfe Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 29 Oct 2017 23:48:38 +0530 Subject: [PATCH] Update El Mundo Fixes #1728386 [Updated recipe for spanish El Mundo](https://bugs.launchpad.net/calibre/+bug/1728386) --- recipes/elmundo.recipe | 92 +++++++++++++++----------------------- recipes/icons/elmundo.png | Bin 691 -> 488 bytes 2 files changed, 35 insertions(+), 57 deletions(-) diff --git a/recipes/elmundo.recipe b/recipes/elmundo.recipe index 43d9744a11..1241482367 100644 --- a/recipes/elmundo.recipe +++ b/recipes/elmundo.recipe @@ -1,7 +1,9 @@ +# -*- mode: python -*- +# -*- coding: utf-8 -*- # vim:fileencoding=utf-8 __license__ = 'GPL v3' -__copyright__ = '2009-2013, Darko Miletic ' +__copyright__ = '2009-2017, Darko Miletic ' ''' elmundo.es ''' @@ -25,17 +27,16 @@ class ElMundo(BasicNewsRecipe): remove_empty_feeds = True language = 'es' ignore_duplicate_articles = {'url'} - masthead_url = 'http://estaticos03.elmundo.es/assets/desktop/master/img/iconos/elmundo-portada.png' + masthead_url = 'http://e00-elmundo.uecdn.es/assets/v7/img/svg/elmundo.svg' publication_type = 'newspaper' articles_are_obfuscated = True + auto_cleanup = True temp_files = [] - needs_subscription = 'optional' - LOGIN = 'https://seguro.elmundo.es/registro/login.html' extra_css = """ - body{font-family: Arial,Helvetica,sans-serif} + body{font-family: "PT serif",Georgia,serif,times} .metadata_noticia{font-size: small} .pestana_GDP{font-size: small; font-weight:bold} - h1 {color: #333333; font-family: Georgia,"Times New Roman",Times,serif} + h1 {color: #333333; font-family: "Clear Sans Bold",Arial,sans-serif,helvetica} .hora{color: red} .update{color: gray} """ @@ -44,62 +45,37 @@ class ElMundo(BasicNewsRecipe): 'comments': description, 'tags': category, 'language': language, 'publisher': publisher } - remove_tags_before = dict( - attrs={'class': ['titular', 'antetitulo', 'entrada']}) - remove_tags_after = dict( - name='div', attrs={'id': ['desarrollo_noticia', 'tamano']}) - remove_tags = [ - dict(name='div', attrs={'class': 'comentarios'}), - dict(name=['meta', 'link', 'iframe', 'object']) - ] - remove_attributes = ['lang', 'border'] - - def get_browser(self): - br = BasicNewsRecipe.get_browser(self) - if self.username is not None and self.password is not None: - br.open(self.LOGIN) - br.select_form(name='login') - br['nick'] = self.username - br['clave'] = self.password - br.submit() - return br + remove_tags = [dict(attrs={'class': lambda x: x and ('aside-tools' or 'publicidad') in x.split()})] feeds = [ - (u'Portada', u'http://elmundo.feedsportal.com/elmundo/rss/portada.xml'), - (u'Deportes', u'http://elmundo.feedsportal.com/elmundodeporte/rss/portada.xml'), - (u'Econom\xeda', u'http://elmundo.feedsportal.com/elmundo/rss/economia.xml'), - (u'Espa\xf1a', u'http://elmundo.feedsportal.com/elmundo/rss/espana.xml'), - (u'Internacional', u'http://elmundo.feedsportal.com/elmundo/rss/internacional.xml'), - (u'Cultura', u'http://elmundo.feedsportal.com/elmundo/rss/internacional.xml'), - (u'Ciencia/Ecolog\xeda', u'http://elmundo.feedsportal.com/elmundo/rss/ciencia.xml'), - (u'Comunicaci\xf3n', u'http://elmundo.feedsportal.com/elmundo/rss/comunicacion.xml'), - (u'Televisi\xf3n', u'http://elmundo.feedsportal.com/elmundo/rss/television.xml'), - (u'Salud', u'http://elmundo.feedsportal.com/elmundosalud/rss/portada.xml'), - (u'Solidaridad', u'http://elmundo.feedsportal.com/elmundo/rss/solidaridad.xml'), - (u'Su vivienda', u'http://elmundo.feedsportal.com/elmundo/rss/suvivienda.xml'), - (u'Motor', u'http://elmundo.feedsportal.com/elmundodeporte/rss/motor.xml'), - (u'Madrid', u'http://elmundo.feedsportal.com/elmundo/rss/madrid.xml'), - (u'Barcelona', u'http://elmundo.feedsportal.com/elmundo/rss/barcelona.xml'), - (u'Pa\xeds Vasco', u'http://elmundo.feedsportal.com/elmundo/rss/paisvasco.xml'), - (u'Baleares', u'http://elmundo.feedsportal.com/elmundo/rss/baleares.xml'), - (u'Castilla y Le\xf3n', u'http://elmundo.feedsportal.com/elmundo/rss/castillayleon.xml'), - (u'Valladolid', u'http://elmundo.feedsportal.com/elmundo/rss/valladolid.xml'), - (u'Valencia', u'http://elmundo.feedsportal.com/elmundo/rss/valencia.xml'), - (u'Alicante', u'http://elmundo.feedsportal.com/elmundo/rss/alicante.xml'), - (u'Castell\xf3n', u'http://elmundo.feedsportal.com/elmundo/rss/castellon.xml'), - (u'Andaluc\xeda', u'http://elmundo.feedsportal.com/elmundo/rss/andalucia.xml'), - (u'Sevilla', u'http://elmundo.feedsportal.com/elmundo/rss/andalucia_sevilla.xml'), - (u'M\xe1laga', u'http://elmundo.feedsportal.com/elmundo/rss/andalucia_malaga.xml') + (u'Portada', u'http://estaticos.elmundo.es/elmundo/rss/portada.xml'), + (u'Deportes', u'http://estaticos.elmundo.es/elmundodeporte/rss/portada.xml'), + (u'Economia', u'http://estaticos.elmundo.es/elmundo/rss/economia.xml'), + (u'Espa\xf1a', u'http://estaticos.elmundo.es/elmundo/rss/espana.xml'), + (u'Internacional', u'http://estaticos.elmundo.es/elmundo/rss/internacional.xml'), + (u'Cultura', u'http://estaticos.elmundo.es/elmundo/rss/cultura.xml'), + (u'Ciencia/Ecolog\xeda', u'http://estaticos.elmundo.es/elmundo/rss/ciencia.xml'), + (u'Comunicaci\xf3n', u'http://estaticos.elmundo.es/elmundo/rss/comunicacion.xml'), + (u'Televisi\xf3n', u'http://estaticos.elmundo.es/elmundo/rss/television.xml'), + (u'Salud', u'http://estaticos.elmundo.es/elmundosalud/rss/portada.xml'), + (u'Solidaridad', u'http://estaticos.elmundo.es/elmundo/rss/solidaridad.xml'), + (u'Su vivienda', u'http://estaticos.elmundo.es/elmundo/rss/suvivienda.xml'), + (u'Motor', u'http://estaticos.elmundo.es/elmundodeporte/rss/motor.xml'), + (u'Madrid', u'http://estaticos.elmundo.es/elmundo/rss/madrid.xml'), + (u'Barcelona', u'http://estaticos.elmundo.es/elmundo/rss/barcelona.xml'), + (u'Pa\xeds Vasco', u'http://estaticos.elmundo.es/elmundo/rss/paisvasco.xml'), + (u'Baleares', u'http://estaticos.elmundo.es/elmundo/rss/baleares.xml'), + (u'Castilla y Le\xf3n', u'http://estaticos.elmundo.es/elmundo/rss/castillayleon.xml'), + (u'Valladolid', u'http://estaticos.elmundo.es/elmundo/rss/valladolid.xml'), + (u'Valencia', u'http://estaticos.elmundo.es/elmundo/rss/valencia.xml'), + (u'Alicante', u'http://estaticos.elmundo.es/elmundo/rss/alicante.xml'), + (u'Castell\xf3n', u'http://estaticos.elmundo.es/elmundo/rss/castellon.xml'), + (u'Andaluc\xeda', u'http://estaticos.elmundo.es/elmundo/rss/andalucia.xml'), + (u'Sevilla', u'http://estaticos.elmundo.es/elmundo/rss/andalucia_sevilla.xml'), + (u'M\xe1laga', u'http://estaticos.elmundo.es/elmundo/rss/andalucia_malaga.xml') ] - def get_article_url(self, article): - realurl = article.get('guid', None) - if '/album/' in realurl or '/envivos/' in realurl: - return None - return realurl - - # Obtener la imagen de portada def get_cover_url(self): cover = self.masthead_url st = time.localtime() @@ -137,4 +113,6 @@ class ElMundo(BasicNewsRecipe): def image_url_processor(self, baseurl, url): if url.startswith('//'): return 'http:' + url + if url.startswith('file://'): + return url.replace('file://', 'http://') return url diff --git a/recipes/icons/elmundo.png b/recipes/icons/elmundo.png index 153cba8e9367464393ad16fc20be17caf4311ef5..dedee51de8ab1f09dbceb4acf6922d96bbf51877 100644 GIT binary patch literal 488 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!6#=yXs@#Xw?AcwQSBeIx*fm;}a85w5HkpK!R zBzpw;GB8xBGB7kWGcf%852Rl(Fa&WhFp5SnFj!4zU=Yv09wk2kXilD|i(^Q|t)xHy z|JyTzz~le_|4SNKPrD5?h~fYLq?YcKE&AFCKmZYF^0YKCFt7pg0~$C@fJ_-6vj8gh zx{>i%&$m=A9v&X9fPd^e5>IFeO$af7%Fdp6bK@T-X69x)W@cw)Ahu;@K79D4=){8P ziMdUh4j-B7SOc`}fM$MB)}9e3c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