calibre/recipes/deutsche_welle_hr.recipe
unkn0w7n 0c8aacd740 DW (all languages) update.
realized that they all require the same code.
2023-06-18 20:07:41 +05:30

43 lines
1.4 KiB
Plaintext

from calibre.web.feeds.news import BasicNewsRecipe, classes
class DeutscheWelle_hr(BasicNewsRecipe):
title = 'Deutsche Welle'
__author__ = 'unkn0wn'
description = 'Vesti iz Njemacke i svijeta'
publisher = 'Deutsche Welle'
category = 'news, politics, Germany'
oldest_article = 2
max_articles_per_feed = 100
use_embedded_content = False
no_stylesheets = True
language = 'hr'
publication_type = 'newsportal'
remove_empty_feeds = True
masthead_url = 'http://www.dw-world.de/skins/std/channel1/pics/dw_logo1024.gif'
remove_javascript = True
ignore_duplicate_articles = {'title', 'url'}
remove_attributes = ['height', 'width', 'style']
keep_only_tags = [
dict(name='article')
]
remove_tags = [
dict(name=['footer', 'source']),
dict(attrs={'data-tracking-name':'sharing-icons-inline'}),
classes('kicker advertisement vjs-wrapper')
]
feeds = [
(u'Svijet', u'http://rss.dw-world.de/rdf/rss-cro-svijet'),
(u'Europa', u'http://rss.dw-world.de/rdf/rss-cro-eu'),
(u'Njemacka', u'http://rss.dw-world.de/rdf/rss-cro-ger'),
(u'Vijesti', u'http://rss.dw-world.de/rdf/rss-cro-all')
]
def preprocess_html(self, soup):
for img in soup.findAll('img', srcset=True):
img['src'] = img['srcset'].split()[6]
return soup