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] 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