mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Update Le Monde Diplomatique - cono sur
Fixes #1946593 [Updated recipe for El diplo](https://bugs.launchpad.net/calibre/+bug/1946593)
This commit is contained in:
parent
2447aa0745
commit
65b0bada6f
@ -1,9 +1,8 @@
|
||||
# -*- mode: python; coding: utf-8; -*-
|
||||
# vim: set syntax=python fileencoding=utf-8
|
||||
|
||||
from __future__ import absolute_import, division, print_function, unicode_literals
|
||||
__license__ = 'GPL v3'
|
||||
__copyright__ = '2020, Darko Miletic <darko.miletic at gmail.com>'
|
||||
__copyright__ = '2021, Darko Miletic <darko.miletic at gmail.com>'
|
||||
|
||||
'''
|
||||
www.eldiplo.org
|
||||
@ -27,6 +26,7 @@ class ElDiplo2020(BasicNewsRecipe):
|
||||
remove_empty_feeds = True
|
||||
publication_type = 'magazine'
|
||||
auto_cleanup = True
|
||||
auto_cleanup_keep = '//div[contains(@class, "autor")] | //div[@class="edicion"]'
|
||||
delay = 1
|
||||
simultaneous_downloads = 1
|
||||
timeout = 8
|
||||
@ -38,12 +38,13 @@ class ElDiplo2020(BasicNewsRecipe):
|
||||
handle_gzip = True
|
||||
compress_news_images = True
|
||||
scale_news_images_to_device = True
|
||||
masthead_url = 'https://www.eldiplo.org/wp-content/themes/eldiplo/img/logo.png'
|
||||
masthead_url = 'https://www.eldiplo.org/wp-content/themes/_polenta_/assets/diplo.png'
|
||||
INDEX = 'https://www.eldiplo.org/'
|
||||
|
||||
|
||||
extra_css = """
|
||||
body{font-family: Roboto, sans-serif}
|
||||
.entry-title{font-family: Spectral, serif}
|
||||
body{font-family: "GT Super", serif}
|
||||
.autor{font-family: Inter, serif}
|
||||
"""
|
||||
|
||||
conversion_options = {
|
||||
@ -63,11 +64,10 @@ class ElDiplo2020(BasicNewsRecipe):
|
||||
def parse_index(self):
|
||||
articles = []
|
||||
soup = self.index_to_soup(self.INDEX)
|
||||
mylink = soup.find('a', {'class':'edicion_cover'})
|
||||
mylink = soup.find('span', text='Sumario')
|
||||
if mylink is None:
|
||||
return None
|
||||
self.cover_url = mylink.img['src']
|
||||
indexurl = mylink['href']
|
||||
return None
|
||||
indexurl = "https://www.eldiplo.org" + mylink.parent['href']
|
||||
self.log(indexurl)
|
||||
parts = indexurl.split('www.eldiplo.org/', 1)
|
||||
series = parts[1].split('-', 1)[0]
|
||||
|
Loading…
x
Reference in New Issue
Block a user