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

from __future__ import absolute_import, division, print_function, unicode_literals

from calibre.web.feeds.news import BasicNewsRecipe


class TInvariant(BasicNewsRecipe):
    title = 'T-Invariant'
    __author__ = 'bugmen00t'
    description = 'T-Invariant is a multimedia project of scientists and science journalists. Our task is to be a bridge between the academic community in Russia and outside Russia. Let’s keep in touch!'  # noqa: E501
    publisher = '\u0422-\u0438\u043d\u0432\u0430\u0440\u0438\u0430\u043d\u0442 / T-invariant'
    category = 'news'
    cover_url = 'https://t-invariant.org/wp-content/uploads/2023/02/logo-s.png'
    # cover_url = u'https://tinyurl.com/t-invariant/wp-content/uploads/2023/02/logo-s.png'
    # language              = 'ru'
    language = 'en_RU'
    # language              = 'uk'
    # language              = 'de'
    # language              = 'he'
    no_stylesheets = False
    remove_javascript = False
    auto_cleanup = False
    oldest_article = 45
    max_articles_per_feed = 15

    remove_tags_before = dict(name='h1')

    remove_tags_after = dict(name='article')

    remove_tags = [
        dict(name='div', attrs={'class': 'media mg-info-author-block'}),
        dict(name='div', attrs={'class': 'mg-blog-category mb-1'}),
        dict(name='span', attrs={'class': 'newses-tags'}),
        dict(name='div', attrs={'class': 'post-share'}),
        dict(name='h4'),
    ]

    feeds = [
        # Russian version
        # Direct links
        # ('\u0412\u0441\u0435 \u043C\u0430\u0442\u0435\u0440\u0438\u0430\u043B\u044B', ‘https://www.t-invariant.org/feed/'),
        # ('\u0410\u0440\u0445\u0438\u0432', ‘https://www.t-invariant.org/category/online/feed/'),
        # ('\u0410\u0441\u0442\u0440\u043E\u043D\u043E\u043C\u0438\u044F', ‘https://www.t-invariant.org/category/astronomy/feed/'),
        # ('\u0411\u0438\u043E\u043B\u043E\u0433\u0438\u044F', ‘https://www.t-invariant.org/category/biologiya/feed/'),
        # ('\u0412\u043E\u0439\u043D\u0430', ‘https://www.t-invariant.org/category/war/feed/'),
        # ('\u0412\u0441\u0451 \u0441\u043B\u043E\u0436\u043D\u043E', ‘https://www.t-invariant.org/category/vsyo-slozhno/feed/'),
        # ('\u0414\u0432\u0430 \u0433\u043E\u0434\u0430 \u0432\u043E\u0439\u043D\u0435', ‘https://www.t-invariant.org/category/dva-goda-vojne/feed/'),
        # ('\u0414\u0432\u0435 \u0441\u0442\u043E\u0440\u043E\u043D\u044B \u043E\u0434\u043D\u043E\u0439 \u043D\u0430\u0443\u043A\u0438', ‘https://www.t-invariant.org/category/dve-storony-odnoj-nauki/feed/'),
        # ('\u0414\u0438\u0441\u043A\u0443\u0441\u0441\u0438\u0438', ‘https://www.t-invariant.org/category/discussion/feed/'),
        # ('\u0414\u0438\u0441\u0441\u0435\u0440\u043D\u0435\u0442', ‘https://www.t-invariant.org/category/dissernet/feed/'),
        # ('\u0418\u0418', ‘https://www.t-invariant.org/category/ai/feed/'),
        # ('\u0418\u043D\u0444\u043E\u0440\u043C\u0430\u0442\u0438\u043A\u0430', ‘https://www.t-invariant.org/category/computer-science/feed/'),
        # ('\u0418\u0441\u0442\u043E\u0440\u0438\u044F', ‘https://www.t-invariant.org/category/history/feed/'),
        # ('\u041A\u043B\u0438\u043C\u0430\u0442', ‘https://www.t-invariant.org/category/climate-ru/feed/'),
        # ('\u041A\u043E\u043D\u0442\u0440\u044D\u0432\u043E\u043B\u044E\u0446\u0438\u044F', ‘https://www.t-invariant.org/category/kontrevolyutsiya/feed/'),
        # ('\u041A\u043E\u0440\u0440\u0443\u043F\u0446\u0438\u044F', ‘https://www.t-invariant.org/category/korruptsiya/feed/'),
        # ('\u041B\u0436\u0435\u043D\u0430\u0443\u043A\u0430', ‘https://www.t-invariant.org/category/pseudoscience/feed/'),
        # ('\u041C\u0430\u0442\u0435\u043C\u0430\u0442\u0438\u043A\u0430', ‘https://www.t-invariant.org/category/mathematics/feed/'),
        # ('\u041C\u043E\u0437\u0433', ‘https://www.t-invariant.org/category/brain/feed/'),
        # ('\u041D\u0430\u0443\u043A\u0430 \u0432 \u0423\u043A\u0440\u0430\u0438\u043D\u0435', ‘https://www.t-invariant.org/category/ukrainian-science/feed/'),
        # ('\u041D\u0430\u0443\u0447\u043D\u0430\u044F \u043F\u043E\u043B\u0438\u0442\u0438\u043A\u0430', ‘https://www.t-invariant.org/category/science-policy-ru/feed/'),
        # ('\u041D\u043E\u0432\u043E\u0441\u0442\u0438', ‘https://www.t-invariant.org/category/news/feed/'),
        # ('\u041E\u043F\u0440\u043E\u0441', ‘https://www.t-invariant.org/category/survey-ru/feed/'),
        # ('\u041F\u043E\u0437\u0438\u0446\u0438\u044F', ‘https://www.t-invariant.org/category/standpiont/feed/'),
        # ('\u041F\u043E\u043B\u0438\u0442\u043E\u043B\u043E\u0433\u0438\u044F', ‘https://www.t-invariant.org/category/political-science/feed/'),
        # ('\u041F\u043E\u043F\u0443\u043B\u044F\u0440\u0438\u0437\u0430\u0446\u0438\u044F \u043D\u0430\u0443\u043A\u0438', ‘https://www.t-invariant.org/category/popular-science/feed/'),
        # ('\u041F\u0440\u0430\u0432\u043E', ‘https://www.t-invariant.org/category/pravo/feed/'),
        # ('\u041F\u0440\u043E\u0433\u0440\u0435\u0441\u0441', ‘https://www.t-invariant.org/category/progress/feed/'),
        # ('\u041F\u0441\u0438\u0445\u043E\u043B\u043E\u0433\u0438\u044F', ‘https://www.t-invariant.org/category/psihologiya/feed/'),
        # ('\u0420\u0410\u041D', ‘https://www.t-invariant.org/category/ras/feed/'),
        # ('\u0420\u0435\u043B\u0438\u0433\u0438\u044F', ‘https://www.t-invariant.org/category/religion/feed/'),
        # ('\u0420\u0435\u043B\u043E\u043A\u0430\u0446\u0438\u044F', ‘https://www.t-invariant.org/category/relocation/feed/'),
        # ('\u0420\u0435\u043F\u0440\u0435\u0441\u0441\u0438\u0438', ‘https://www.t-invariant.org/category/repression/feed/'),
        # ('\u0420\u0443\u0441\u0441\u043A\u0438\u0439 \u044F\u0437\u044B\u043A', ‘https://www.t-invariant.org/category/russian-language/feed/'),
        # ('\u0421\u0430\u043D\u043A\u0446\u0438\u0438', ‘https://www.t-invariant.org/category/sanctions/feed/'),
        # ('\u0421\u043E\u0437\u0434\u0430\u0442\u0435\u043B\u0438', ‘https://www.t-invariant.org/category/creators/feed/'),
        # ('\u0421\u043E\u0446\u0438\u043E\u043B\u043E\u0433\u0438\u044F', ‘https://www.t-invariant.org/category/sociology/feed/'),
        # ('\u0422\u0435\u0440\u0440\u043E\u0440\u0438\u0437\u043C', ‘https://www.t-invariant.org/category/terrorizm/feed/'),
        # ('\u0423\u043D\u0438\u0432\u0435\u0440\u0441\u0438\u0442\u0435\u0442\u044B', ‘https://www.t-invariant.org/category/universities/feed/'),
        # ('\u0424\u0438\u0437\u0438\u043A\u0430', ‘https://www.t-invariant.org/category/physics/feed/'),
        # ('\u0424\u0438\u043B\u043E\u0441\u043E\u0444\u0438\u044F', ‘https://www.t-invariant.org/category/philosophy/feed/'),
        # ('\u0428\u043A\u043E\u043B\u0430', ‘https://www.t-invariant.org/category/shkola/feed/'),
        # ('\u042D\u043A\u0441\u043F\u0435\u0440\u0442\u0438\u0437\u0430 \u043D\u0430\u0443\u043A\u0438', ‘https://www.t-invariant.org/category/science-assessment/feed/'),
        # ('\u042D\u043D\u0435\u0440\u0433\u0435\u0442\u0438\u043A\u0430', ‘https://www.t-invariant.org/category/energy/feed/'),
        # ('\u042D\u0442\u0438\u043A\u0430', ‘https://www.t-invariant.org/category/ethics/feed/'),
        # Censorship bypass
        # ('\u0412\u0441\u0435 \u043C\u0430\u0442\u0435\u0440\u0438\u0430\u043B\u044B', 'https://tinyurl.com/t-invariant/feed/'),
        # ('\u0410\u0440\u0445\u0438\u0432', 'https://tinyurl.com/t-invariant/category/online/feed/'),
        # ('\u0410\u0441\u0442\u0440\u043E\u043D\u043E\u043C\u0438\u044F', 'https://tinyurl.com/t-invariant/category/astronomy/feed/'),
        # ('\u0411\u0438\u043E\u043B\u043E\u0433\u0438\u044F', 'https://tinyurl.com/t-invariant/category/biologiya/feed/'),
        # ('\u0412\u043E\u0439\u043D\u0430', 'https://tinyurl.com/t-invariant/category/war/feed/'),
        # ('\u0412\u0441\u0451 \u0441\u043B\u043E\u0436\u043D\u043E', 'https://tinyurl.com/t-invariant/category/vsyo-slozhno/feed/'),
        # ('\u0414\u0432\u0430 \u0433\u043E\u0434\u0430 \u0432\u043E\u0439\u043D\u0435', 'https://tinyurl.com/t-invariant/category/dva-goda-vojne/feed/'),
        # ('\u0414\u0432\u0435 \u0441\u0442\u043E\u0440\u043E\u043D\u044B \u043E\u0434\u043D\u043E\u0439 \u043D\u0430\u0443\u043A\u0438', 'https://tinyurl.com/t-invariant/category/dve-storony-odnoj-nauki/feed/'),
        # ('\u0414\u0438\u0441\u043A\u0443\u0441\u0441\u0438\u0438', 'https://tinyurl.com/t-invariant/category/discussion/feed/'),
        # ('\u0414\u0438\u0441\u0441\u0435\u0440\u043D\u0435\u0442', 'https://tinyurl.com/t-invariant/category/dissernet/feed/'),
        # ('\u0418\u0418', 'https://tinyurl.com/t-invariant/category/ai/feed/'),
        # ('\u0418\u043D\u0444\u043E\u0440\u043C\u0430\u0442\u0438\u043A\u0430', 'https://tinyurl.com/t-invariant/category/computer-science/feed/'),
        # ('\u0418\u0441\u0442\u043E\u0440\u0438\u044F', 'https://tinyurl.com/t-invariant/category/history/feed/'),
        # ('\u041A\u043B\u0438\u043C\u0430\u0442', 'https://tinyurl.com/t-invariant/category/climate-ru/feed/'),
        # ('\u041A\u043E\u043D\u0442\u0440\u044D\u0432\u043E\u043B\u044E\u0446\u0438\u044F', 'https://tinyurl.com/t-invariant/category/kontrevolyutsiya/feed/'),
        # ('\u041A\u043E\u0440\u0440\u0443\u043F\u0446\u0438\u044F', 'https://tinyurl.com/t-invariant/category/korruptsiya/feed/'),
        # ('\u041B\u0436\u0435\u043D\u0430\u0443\u043A\u0430', 'https://tinyurl.com/t-invariant/category/pseudoscience/feed/'),
        # ('\u041C\u0430\u0442\u0435\u043C\u0430\u0442\u0438\u043A\u0430', 'https://tinyurl.com/t-invariant/category/mathematics/feed/'),
        # ('\u041C\u043E\u0437\u0433', 'https://tinyurl.com/t-invariant/category/brain/feed/'),
        # ('\u041D\u0430\u0443\u043A\u0430 \u0432 \u0423\u043A\u0440\u0430\u0438\u043D\u0435', 'https://tinyurl.com/t-invariant/category/ukrainian-science/feed/'),
        # ('\u041D\u0430\u0443\u0447\u043D\u0430\u044F \u043F\u043E\u043B\u0438\u0442\u0438\u043A\u0430', 'https://tinyurl.com/t-invariant/category/science-policy-ru/feed/'),
        # ('\u041D\u043E\u0432\u043E\u0441\u0442\u0438', 'https://tinyurl.com/t-invariant/category/news/feed/'),
        # ('\u041E\u043F\u0440\u043E\u0441', 'https://tinyurl.com/t-invariant/category/survey-ru/feed/'),
        # ('\u041F\u043E\u0437\u0438\u0446\u0438\u044F', 'https://tinyurl.com/t-invariant/category/standpiont/feed/'),
        # ('\u041F\u043E\u043B\u0438\u0442\u043E\u043B\u043E\u0433\u0438\u044F', 'https://tinyurl.com/t-invariant/category/political-science/feed/'),
        # ('\u041F\u043E\u043F\u0443\u043B\u044F\u0440\u0438\u0437\u0430\u0446\u0438\u044F \u043D\u0430\u0443\u043A\u0438', 'https://tinyurl.com/t-invariant/category/popular-science/feed/'),
        # ('\u041F\u0440\u0430\u0432\u043E', 'https://tinyurl.com/t-invariant/category/pravo/feed/'),
        # ('\u041F\u0440\u043E\u0433\u0440\u0435\u0441\u0441', 'https://tinyurl.com/t-invariant/category/progress/feed/'),
        # ('\u041F\u0441\u0438\u0445\u043E\u043B\u043E\u0433\u0438\u044F', 'https://tinyurl.com/t-invariant/category/psihologiya/feed/'),
        # ('\u0420\u0410\u041D', 'https://tinyurl.com/t-invariant/category/ras/feed/'),
        # ('\u0420\u0435\u043B\u0438\u0433\u0438\u044F', 'https://tinyurl.com/t-invariant/category/religion/feed/'),
        # ('\u0420\u0435\u043B\u043E\u043A\u0430\u0446\u0438\u044F', 'https://tinyurl.com/t-invariant/category/relocation/feed/'),
        # ('\u0420\u0435\u043F\u0440\u0435\u0441\u0441\u0438\u0438', 'https://tinyurl.com/t-invariant/category/repression/feed/'),
        # ('\u0420\u0443\u0441\u0441\u043A\u0438\u0439 \u044F\u0437\u044B\u043A', 'https://tinyurl.com/t-invariant/category/russian-language/feed/'),
        # ('\u0421\u0430\u043D\u043A\u0446\u0438\u0438', 'https://tinyurl.com/t-invariant/category/sanctions/feed/'),
        # ('\u0421\u043E\u0437\u0434\u0430\u0442\u0435\u043B\u0438', 'https://tinyurl.com/t-invariant/category/creators/feed/'),
        # ('\u0421\u043E\u0446\u0438\u043E\u043B\u043E\u0433\u0438\u044F', 'https://tinyurl.com/t-invariant/category/sociology/feed/'),
        # ('\u0422\u0435\u0440\u0440\u043E\u0440\u0438\u0437\u043C', 'https://tinyurl.com/t-invariant/category/terrorizm/feed/'),
        # ('\u0423\u043D\u0438\u0432\u0435\u0440\u0441\u0438\u0442\u0435\u0442\u044B', 'https://tinyurl.com/t-invariant/category/universities/feed/'),
        # ('\u0424\u0438\u0437\u0438\u043A\u0430', 'https://tinyurl.com/t-invariant/category/physics/feed/'),
        # ('\u0424\u0438\u043B\u043E\u0441\u043E\u0444\u0438\u044F', 'https://tinyurl.com/t-invariant/category/philosophy/feed/'),
        # ('\u0428\u043A\u043E\u043B\u0430', 'https://tinyurl.com/t-invariant/category/shkola/feed/'),
        # ('\u042D\u043A\u0441\u043F\u0435\u0440\u0442\u0438\u0437\u0430 \u043D\u0430\u0443\u043A\u0438', 'https://tinyurl.com/t-invariant/category/science-assessment/feed/'),
        # ('\u042D\u043D\u0435\u0440\u0433\u0435\u0442\u0438\u043A\u0430', 'https://tinyurl.com/t-invariant/category/energy/feed/'),
        # ('\u042D\u0442\u0438\u043A\u0430', 'https://tinyurl.com/t-invariant/category/ethics/feed/'),
        # English version
        # ('T-invariant (English)', 'https://www.t-invariant.org/en/feed/'),
        # Censorship bypass
        ('T-invariant (English)', 'https://tinyurl.com/t-invariant/en/feed/'),
        # Ukrainian version
        # ('T-invariant (\u0423\u043A\u0440\u0430\u0457\u043D\u0441\u044C\u043A\u0430)', 'https://www.t-invariant.org/uk/feed/'),
        # Censorship bypass
        # ('T-invariant (\u0423\u043A\u0440\u0430\u0457\u043D\u0441\u044C\u043A\u0430)', 'https://tinyurl.com/t-invariant/uk/feed/'),
        # German version
        # ('T-invariant (Deutsch)', 'https://www.t-invariant.org/de/feed/'),
        # Censorship bypass
        # ('T-invariant (Deutsch)', 'https://tinyurl.com/t-invariant/de/feed/'),
        # Hebrew version
        # ('T-invariant (\u05E2\u05D1\u05E8\u05D9\u05EA)', 'https://www.t-invariant.org/he/feed/'),
        # Censorship bypass
        # ('T-invariant (\u05E2\u05D1\u05E8\u05D9\u05EA)', 'https://tinyurl.com/t-invariant/he/feed/'),
    ]
