Skip to content

Commit

Permalink
repair hdrezka plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
dandygithub committed May 3, 2024
1 parent cd98588 commit b9e5579
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion addons/plugin.video.hdrezka.tv/addon.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="plugin.video.hdrezka.tv" name="Hdrezka.tv" version="3.2.0" provider-name="MrStealth, dandy, DesSolo">
<addon id="plugin.video.hdrezka.tv" name="Hdrezka.tv" version="3.2.1" provider-name="MrStealth, dandy, DesSolo">
<requires>
<import addon="xbmc.python" version="3.0.0"/>
<import addon="script.module.xbmc.helpers" version="3.0.0"/>
Expand Down
11 changes: 7 additions & 4 deletions addons/plugin.video.hdrezka.tv/default.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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'<b style="color: #333;">(\d+\+)</b>', 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]
Expand Down

0 comments on commit b9e5579

Please sign in to comment.