#!/usr/pkg/bin/python3.13
# News source: https://www.rtvslo.si
# License: GPLv3
# Copyright: 2022, TadejS


from calibre.web.feeds.news import BasicNewsRecipe


class MMCRTV(BasicNewsRecipe):
    title = u'MMC RTV Slovenija'
    __author__ = u'TadejS'
    description = u"Prvi interaktivni multimedijski portal, MMC RTV Slovenija"
    oldest_article = 3
    max_articles_per_feed = 100
    language = 'sl'
    no_stylesheets = True
    use_embedded_content = False
    encoding = 'utf-8'
    publication_type = 'newspaper'

    cover_url = 'https://img.rtvslo.si/_static/novi/logo/tvmmc-light-bg.png'

    keep_only_tags = [
        dict(name='header', attrs={'class': 'article-header'}),
        dict(name='div', attrs={'class': 'article-body'}),
    ]
    remove_tags=[
        dict(name='div', attrs={'class':'gallery-grid'}),
        dict(name='div', attrs={'class':'gallery'}),
        dict(name='div', attrs={'class':'exposed-article'}),
        dict(name='div', attrs={'class':'d-lg-none'}),
        dict(name='div', attrs={'class':'section-heading'}),
    ]

    feeds = [
        (u'Slovenija', u'https://www.rtvslo.si/feeds/01.xml'),
        (u'Evropska unija', u'https://www.rtvslo.si/feeds/16.xml'),
        (u'Svet', u'https://www.rtvslo.si/feeds/02.xml'),
        (u'Gospodarstvo', u'https://www.rtvslo.si/feeds/04.xml'),
        (u'Okolje', u'https://www.rtvslo.si/feeds/12.xml'),
        (u'Znanost in tehnologija', u'https://www.rtvslo.si/feeds/09.xml'),
        (u'Kultura', u'https://www.rtvslo.si/feeds/05.xml'),
        (u'Šport', u'https://www.rtvslo.si/feeds/03.xml'),
        (u'Zabava', u'https://www.rtvslo.si/feeds/06.xml'),
        (u'Ture avanture', u'https://www.rtvslo.si/feeds/28.xml'),
        (u'Črna kronika', u'https://www.rtvslo.si/feeds/08.xml'),
    ]
