Skip to content

Avoid blocking script in epg.py and content.py when wrong data in json#47

Open
frankdpGH wants to merge 2 commits intoadd-ons:masterfrom
frankdpGH:master
Open

Avoid blocking script in epg.py and content.py when wrong data in json#47
frankdpGH wants to merge 2 commits intoadd-ons:masterfrom
frankdpGH:master

Conversation

@frankdpGH
Copy link
Contributor

  1. Error epg.py :
    2026-03-09 14:17:09.539 T:84 info : [plugin.video.play] [resources.lib.play.epg] Date is 2026-03-07 and channel is play
    title': 'Achter De Schermen - S7 - Aflevering 8', 'type': 'video'}, 'published': True, 'shortFormType': None, 'subtype': 'longForm', 'type': 'video', 'uuid': 'd32cf133-abb5-4a5a-b936-19eeea65e510'}, 'wonId': '#108 - Dina Tersago bezorgt ons een lumbago | met Lukas Lelie'
    File "/.Kodi/data/addons/plugin.video.play/resources/lib/play/epg.py", line 162, in _parse_program
    won_id=int(data['program']['wonId']) if data['program']['wonId'] else None,
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ValueError: invalid literal for int() with base 10: '#108 - Dina Tersago bezorgt ons een lumbago'

  2. Error in content .py :
    2026-03-09 18:48:19.881 T:83 info : [plugin.video.play] [resources.lib.play.content] Card_Video : {'uuid': '3a5787d9-a639-4d3f-881d-0d4376b8831a', 'title': "Klara's gekke treinavontuur", 'images': [], 'type': 'PROGRAM', 'subtitle': None, 'parentalRating': 'AL', 'category': None, 'categoryId': None, 'badge': None, 'brand': 'kinepolis', 'duration': None, 'position': None, 'teaser': None}
    File "/.Kodi/data/addons/plugin.video.play/resources/lib/play/content.py", line 603, in _parse_cards_data
    poster=card.get('images')[0].get('url'),
    ~~~~~~~~~~~~~~~~~~^^^
    IndexError: list index out of range

Handle cases where 'images' may not be present in card data.
Avoid blocking script for epg in case of wrong data
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant