#!/usr/bin/env python
# vim:fileencoding=utf-8

from calibre.web.feeds.news import BasicNewsRecipe


class KnifeMedia(BasicNewsRecipe):
    title = '\u041d\u043e\u0436'
    __author__ = 'bugmen00t'
    description = '\u0418\u043d\u0442\u0435\u043b\u043b\u0435\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0439 \u0436\u0443\u0440\u043d\u0430\u043b \u043e \u043a\u0443\u043b\u044c\u0442\u0443\u0440\u0435 \u0438 \u043e\u0431\u0449\u0435\u0441\u0442\u0432\u0435'  # noqa: E501
    publisher = '\u041c\u0438\u0445\u0430\u0438\u043b \u0426\u044b\u0433\u0430\u043d, \u0422\u0430\u0442\u044c\u044f\u043d\u0430 \u041a\u043e\u044d\u043d'
    category = 'blog'
    cover_url = 'https://knife.media/feature/pdd/img/knife_logo.33a98aee.svg'
    language = 'ru'
    no_stylesheets = False
    remove_javascript = False
    auto_cleanup = False
    oldest_article = 14
    max_articles_per_feed = 30

    remove_tags_before = dict(name='div', attrs={'class': 'entry-header'})

    remove_tags_after = dict(name='div', attrs={'class': 'entry-content'})

    remove_tags = [
        dict(name='aside'),
        dict(name='div', attrs={'class': 'entry-header__share share'}),
        dict(name='div', attrs={'class': 'entry-comments'}),
        dict(name='div', attrs={'class': 'entry-footer'}),
        dict(name='div', attrs={'class': 'entry-bottom'}),
        dict(name='figure', attrs={'class': 'figure figure--similar'}),
    ]

    feeds = [
        ('\u041b\u043e\u043d\u0433\u0440\u0438\u0434\u044b', 'https://knife.media/category/longreads/feed/'),
        ('\u041d\u043e\u0432\u043e\u0441\u0442\u0438', 'https://knife.media/category/news/feed/'),
    ]
