From 0aad873a890acda2e111688c625d674dda2c9043 Mon Sep 17 00:00:00 2001 From: IceFreak66 Date: Sat, 30 Mar 2024 22:13:04 -1000 Subject: [PATCH] [FR - MYCANAL] Fix json parser --- resources/lib/channels/fr/mycanal.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/lib/channels/fr/mycanal.py b/resources/lib/channels/fr/mycanal.py index e119076ef..44ed491e6 100644 --- a/resources/lib/channels/fr/mycanal.py +++ b/resources/lib/channels/fr/mycanal.py @@ -250,7 +250,7 @@ def list_channel(plugin, item_id, **kwargs): """ resp = urlquick.get(URL_REPLAY_CHANNEL % item_id) - react_query_state = REACT_QUERY_STATE.findall(resp.text)[0] + react_query_state = REACT_QUERY_STATE.findall(resp.text)[0].replace("undefined", "\"undefined\"") json_react_query_state = json.loads(react_query_state) for category in json_react_query_state["queries"][0]["state"]["data"]["strates"]: @@ -316,7 +316,7 @@ def list_contents(plugin, item_id, key_value, category, **kwargs): def find_category(item_id, key_value): resp = urlquick.get(URL_REPLAY_CHANNEL % item_id) - react_query_state = REACT_QUERY_STATE.findall(resp.text)[0] + react_query_state = REACT_QUERY_STATE.findall(resp.text)[0].replace("undefined", "\"undefined\"") json_react_query_state = json.loads(react_query_state) for category in json_react_query_state["queries"][0]["state"]["data"]["strates"]: if 'reactKey' in category and category['reactKey'] == key_value: