Skip to content

Commit

Permalink
[FR - MYCANAL] Fix json parser
Browse files Browse the repository at this point in the history
  • Loading branch information
IceFreak66 authored and joaopa00 committed Mar 31, 2024
1 parent 474e34b commit 0aad873
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions resources/lib/channels/fr/mycanal.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]:
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 0aad873

Please sign in to comment.