#!/usr/bin/env python # vim:fileencoding=utf-8 from calibre.web.feeds.news import BasicNewsRecipe class Grani(BasicNewsRecipe): title = '\u0413\u0440\u0430\u043d\u0438.\u0420\u0443' __author__ = 'bugmen00t' description = '\u0415\u0436\u0435\u0434\u043d\u0435\u0432\u043d\u0430\u044f \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442-\u0433\u0430\u0437\u0435\u0442\u0430. \u041e\u0431\u0437\u043e\u0440\u044b \u0438 \u0430\u043d\u0430\u043b\u0438\u0437 \u0440\u043e\u0441\u0441\u0438\u0439\u0441\u043a\u0438\u0445 \u0438 \u043c\u0438\u0440\u043e\u0432\u044b\u0445 \u043f\u043e\u043b\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0441\u043e\u0431\u044b\u0442\u0438\u0439, \u0441\u0442\u0430\u0442\u044c\u0438 \u0438 \u0432\u0438\u0434\u0435\u043e \u043e \u043f\u043e\u043b\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0437\u0430\u043a\u043b\u044e\u0447\u0451\u043d\u043d\u044b\u0445.' # noqa: E501 publisher = '\u041e\u041e\u041e "\u0424\u043b\u0430\u0432\u0443\u0441"' category = 'newspaper' cover_url = 'https://graniru.org/files/96172.png' language = 'ru' no_stylesheets = False remove_javascript = False auto_cleanup = False remove_empty_feeds = True oldest_article = 30 max_articles_per_feed = 50 remove_tags_before = dict(name='h3') remove_tags_after = dict(name='div', attrs={'class': 'main-text clearfix'}) # Original feeds # feeds = [ # ('\u0412\u0441\u0435 \u043C\u0430\u0442\u0435\u0440\u0438\u0430\u043B\u044B', 'https://graniru.org/export/all-atom.xml'), # ('\u0421\u0442\u0430\u0442\u044C\u0438', 'https://graniru.org/export/articles-atom.xml') # ] # Feeds from mirror site feeds = [ ('\u0412\u0441\u0435 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u044b', 'https://grani2.appspot.com/export/all-atom.xml'), ('\u0421\u0442\u0430\u0442\u044c\u0438', 'https://grani2.appspot.com/export/articles-atom.xml'), ] # Mirror site feeds transformation def print_version(self, url): return url.replace('https://graniru.org/', 'https://grani2.appspot.com/')