From e96490d78f5efc6f18e2cad4becefbfb9962f3f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20D=C5=82ugosz?= Date: Tue, 15 Oct 2019 21:14:06 +0200 Subject: [PATCH 1/4] jazzpress doesn't publish epub any more --- recipes/jazzpress.recipe | 55 ---------------------------------------- 1 file changed, 55 deletions(-) delete mode 100644 recipes/jazzpress.recipe diff --git a/recipes/jazzpress.recipe b/recipes/jazzpress.recipe deleted file mode 100644 index 9d89a8dd98..0000000000 --- a/recipes/jazzpress.recipe +++ /dev/null @@ -1,55 +0,0 @@ -#!/usr/bin/env python2 -# -*- coding: utf-8 -*- - -__license__ = 'GPL v3' -__copyright__ = u'Łukasz Grąbczewski 2011-2013' -__version__ = '2.0' - -import re -import os -from calibre import walk -from calibre.utils.zipfile import ZipFile -from calibre.ptempfile import PersistentTemporaryFile -from calibre.web.feeds.news import BasicNewsRecipe - - -class jazzpress(BasicNewsRecipe): - __author__ = u'Łukasz Grąbczewski' - title = 'JazzPRESS' - language = 'pl' - publisher = 'Fundacja Popularyzacji Muzyki Jazzowej EuroJAZZ' - publication_type = 'magazine' - description = u'Internetowa gazeta poświęcona muzyce improwizowanej' - - conversion_options = { - 'authors': 'Fundacja Popularyzacji Muzyki Jazzowej EuroJAZZ', - 'publisher': publisher, 'language': language, - 'preserve_cover_aspect_ratio': True, 'remove_first_image': True - } - - def build_index(self): - browser = self.get_browser() - browser.open('http://radiojazz.fm/') - - # find the link - epublink = browser.find_link( - url_regex=re.compile(r'e_jazzpress\d\d\d\d\_epub')) - - # download ebook - self.report_progress(0, _('Downloading ePUB')) - response = browser.follow_link(epublink) - book_file = PersistentTemporaryFile(suffix='.epub') - book_file.write(response.read()) - book_file.close() - - # convert - self.report_progress(0.2, _('Converting to OEB')) - oeb = self.output_dir + '/INPUT/' - if not os.path.exists(oeb): - os.makedirs(oeb) - with ZipFile(book_file.name) as f: - f.extractall(path=oeb) - - for f in walk(oeb): - if f.endswith('.opf'): - return f # convert From 5b78ef38109a4b0ac5fbfe4b87baf03fabe0fefe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20D=C5=82ugosz?= Date: Tue, 15 Oct 2019 21:38:19 +0200 Subject: [PATCH 2/4] =?UTF-8?q?powr=C3=B3t=20Krula?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- recipes/km_blog.recipe | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/recipes/km_blog.recipe b/recipes/km_blog.recipe index 2a7a98703d..545d27d6a2 100644 --- a/recipes/km_blog.recipe +++ b/recipes/km_blog.recipe @@ -14,7 +14,7 @@ class km_blog(BasicNewsRecipe): __author__ = 'teepel ' language = 'pl' description = 'Wiadomości z bloga korwin-mikke.pl/blog' - INDEX = 'http://korwin-mikke.pl/blog' + INDEX = 'https://korwin-mikke.pl/blog' remove_empty_feeds = True oldest_article = 7 max_articles_per_feed = 100 @@ -22,16 +22,8 @@ class km_blog(BasicNewsRecipe): no_stylesheets = True remove_empty_feeds = True - feeds = [(u'blog', u'http://korwin-mikke.pl/blog/rss')] + feeds = [(u'blog', u'https://korwin-mikke.pl/blog/rss')] - keep_only_tags = [] - # this line should show title of the article, but it doesnt work - keep_only_tags.append(dict(name='div', attrs={'class': 'posts view'})) - keep_only_tags.append(dict(name='div', attrs={'class': 'text'})) - keep_only_tags.append(dict(name='h1')) + keep_only_tags = [dict(name='div', attrs={'class': ['header-standard header-classic single-header', 'post-image', 'post-entry blockquote-style-1']})] - remove_tags = [] - remove_tags.append(dict(name='p', attrs={'class': 'float_right'})) - remove_tags.append(dict(name='p', attrs={'class': 'date'})) - - remove_tags_after = [(dict(name='div', attrs={'class': 'text'}))] + remove_tags = [dict(name='div', attrs={'class': 'penci-hide-tagupdated'})] From 7d54f6325d44775fbc5ac035aca097e20daabc76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20D=C5=82ugosz?= Date: Tue, 15 Oct 2019 22:41:04 +0200 Subject: [PATCH 3/4] update kresy.pl --- recipes/kresy_pl.recipe | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/recipes/kresy_pl.recipe b/recipes/kresy_pl.recipe index db8e8878dc..f8a5f737a9 100644 --- a/recipes/kresy_pl.recipe +++ b/recipes/kresy_pl.recipe @@ -6,12 +6,9 @@ class Kresy(BasicNewsRecipe): __author__ = 'fenuks' description = u'portal społeczności kresowej' language = 'pl' - masthead_url = 'http://www.kresy.pl/public/img/logo.png' - cover_url = 'http://www.kresy.pl/public/img/logo.png' oldest_article = 7 max_articles_per_feed = 100 no_stylesheets = True - keep_only_tags = [dict(id='artykul')] - remove_tags = [ - dict(attrs={'class': ['twitter-share-button', 'likefbborder', 'tagi']})] - feeds = [(u'Wszystkie', u'http://www.kresy.pl/rss')] + keep_only_tags = [dict(name='div', attrs={'class': ['big-slider big-preview single-big', 'entry-content-wrapper clearfix standard-content']})] + remove_tags = [dict(attrs={'class': ['entry-footer', 'kresy_donate']})] + feeds = [(u'Wszystkie', u'https://www.kresy.pl/rss')] From dd7f03b859b227df92b40ce75645feb47a158e69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20D=C5=82ugosz?= Date: Wed, 16 Oct 2019 01:04:29 +0200 Subject: [PATCH 4/4] update Krytyka Polityczna --- recipes/kp.recipe | 38 +++++++------------------------------- 1 file changed, 7 insertions(+), 31 deletions(-) diff --git a/recipes/kp.recipe b/recipes/kp.recipe index a4f9cd78ce..00f878a8f3 100644 --- a/recipes/kp.recipe +++ b/recipes/kp.recipe @@ -11,43 +11,19 @@ class KrytykaPolitycznaRecipe(BasicNewsRecipe): category = u'News' description = u' Lewicowe pismo zaangażowane w bieg spraw publicznych w Polsce.' cover_url = '' + masthead_url = 'https://krytykapolityczna.pl/file/2015/09/krytyka-logo.png' remove_empty_feeds = True no_stylesheets = True oldest_article = 7 - max_articles_per_feed = 100000 + max_articles_per_feed = 50 recursions = 0 - no_stylesheets = True - remove_javascript = True simultaneous_downloads = 3 - keep_only_tags = [] - keep_only_tags.append(dict(name='h1', attrs={'class': 'print-title'})) - keep_only_tags.append(dict(name='div', attrs={'class': 'print-content'})) + keep_only_tags = [(dict(name='h1')), + (dict(name='div', attrs={'class': ['entry-meta','post-preview','entry-details', 'entry-content']}))] - remove_tags = [] - remove_tags.append(dict(attrs={'class': ['field field-type-text field-field-story-switch', 'field field-type-filefield field-field-story-temp', - 'field field-type-text field-field-story-author', 'field field-type-text field-field-story-lead-switch']})) + remove_tags = [(dict(attrs={'class': ['_ning_zone_inner','book-item site-commerc','wp-embedded-content', + 'read-also','meta-date-modified updated', 'textwidget']}))] - extra_css = ''' - body {font-family: verdana, arial, helvetica, geneva, sans-serif ;} - td.contentheading{font-size: large; font-weight: bold;} - ''' - - feeds = [ - ('Wszystkie', 'http://www.krytykapolityczna.pl/rss.xml') - ] - - def print_version(self, url): - soup = self.index_to_soup(url) - print_ico = soup.find(attrs={'class': 'print-page'}) - print_uri = print_ico['href'] - self.log('PRINT', print_uri) - return 'http://www.krytykapolityczna.pl/' + print_uri - - def preprocess_html(self, soup): - for alink in soup.findAll('a'): - if alink.string is not None: - tstr = alink.string - alink.replaceWith(tstr) - return soup + feeds = [('Wszystkie', 'https://www.krytykapolityczna.pl/rss')]