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

__license__ = 'GPL v3'
__copyright__ = '2015, lcd1232, malexey1984@gmail.com'
__author__ = 'lcd1232'

from calibre.web.feeds.news import BasicNewsRecipe


class Computerra(BasicNewsRecipe):
    title = '\u041a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0440\u0430'
    __author__ = 'lcd1232 (with fixes by bugmen00t)'
    description = 'Компьютерра: все новости про компьютеры, железо, новые технологии, информационные технологии'
    cover_url = 'https://yt3.ggpht.com/ytc/AKedOLRCMA71rKaP4HfL2W26A-VdvsBj9BcOo7S6poTR=s900-c-k-c0x00ffffff-no-rj'
    language = 'ru'
    oldest_article = 100
    max_articles_per_feed = 50
    use_embedded_content = False
    remove_javascript = True
    no_stylesheets = False
    conversion_options = {'linearize_tables': True}
    simultaneous_downloads = 5

    remove_tags_before = dict(name='article')

    remove_tags_after = dict(name='article')

    remove_tags = [
        dict(name='ul', attrs={'class': 'breadcrumbs'}),
        dict(name='div', attrs={'class': 'post-info__likes post-info-likes'}),
        dict(name='div', attrs={'class': 'cta-row'}),
        dict(name='div', attrs={'class': 'post-info__img'}),
        dict(name='div', attrs={'class': 'post-footer__wrap'}),
        dict(name='div', attrs={'class': 'widget featured-posts'}),
    ]

    feeds = [('\u041a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0440\u0430', 'https://www.computerra.ru/feed/')]
