From b9e5579b320edff4fddc14b7ed46dd082e1a7e07 Mon Sep 17 00:00:00 2001 From: dandy Date: Fri, 3 May 2024 16:42:37 +0300 Subject: [PATCH] repair hdrezka plugin --- addons/plugin.video.hdrezka.tv/addon.xml | 2 +- addons/plugin.video.hdrezka.tv/default.py | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/addons/plugin.video.hdrezka.tv/addon.xml b/addons/plugin.video.hdrezka.tv/addon.xml index ec88fae..2bd463f 100644 --- a/addons/plugin.video.hdrezka.tv/addon.xml +++ b/addons/plugin.video.hdrezka.tv/addon.xml @@ -1,5 +1,5 @@  - + diff --git a/addons/plugin.video.hdrezka.tv/default.py b/addons/plugin.video.hdrezka.tv/default.py index 391be3b..9bcfdb9 100644 --- a/addons/plugin.video.hdrezka.tv/default.py +++ b/addons/plugin.video.hdrezka.tv/default.py @@ -228,10 +228,10 @@ def index(self, uri=None, page=None, query_filter=None): for i, name in enumerate(titles): info = self.get_item_additional_info(post_ids[i]) - title = helpers.built_title(name, country_years[i], **info) + title = helpers.built_title(name, country_years[i*2], **info) image = self._normalize_url(common.parseDOM(div_covers[i], "img", ret='src')[0]) item_uri = router.build_uri('show', uri=router.normalize_uri(links[i])) - year, country, genre = get_media_attributes(country_years[i]) + year, country, genre = get_media_attributes(country_years[i*2]) item = xbmcgui.ListItem(title) item.setArt({'thumb': image, 'icon': image}) item.setInfo( @@ -432,12 +432,15 @@ def get_item_additional_info(self, post_id): "is_touch": 1 }) - additional['description'] = common.parseDOM(response.text, 'div', attrs={'class': 'b-content__bubble_text'})[0] + try: + additional['description'] = common.parseDOM(response.text, 'div', attrs={'class': 'b-content__bubble_text'})[0] + except IndexError: + log(f'fault parse description post_id: {post_id}') try: additional['age_limit'] = re.search(r'(\d+\+)', response.text).group(1) except AttributeError: - log(f'fault parse age_limit post_id: "{post_id}"') + log(f'fault parse age_limit post_id: {post_id}') try: site_rating = common.parseDOM(response.text, 'div', attrs={'class': 'b-content__bubble_rating'})[0]