From 2083698fcb56c1c4ab4ddbaad82571f8895cf9d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Agust=C3=ADn=20Pacheco=20Di=20Santi?= <61388677+APachecoDiSanti@users.noreply.github.com> Date: Thu, 22 Jul 2021 22:20:20 -0300 Subject: [PATCH] Increase API timeout As mentioned in https://github.com/MrKrabat/plugin.video.crunchyroll/issues/32 by simply increasing the timeout when doing API requests to Crunchyroll the addon can successfully load the user's Queue and no longer has loading errors. This solved the issue for me and it will help people with slower internet have a smooth experience using the addon. --- resources/lib/api.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/resources/lib/api.py b/resources/lib/api.py index 4a47727..0fcfeef 100644 --- a/resources/lib/api.py +++ b/resources/lib/api.py @@ -42,6 +42,7 @@ class API: VERSON = "1.1.21.0" TOKEN = "LNDJgOit5yaRIWN" DEVICE = "com.crunchyroll.windows.desktop" + TIMEOUT = 30 def start(args): @@ -153,7 +154,7 @@ def request(args, method, options, failed=False): # send payload url = API.URL + method + ".0.json" - response = urlopen(url, payload.encode("utf-8")) + response = urlopen(url, payload.encode("utf-8"), TIMEOUT) # parse response json_data = response.read().decode("utf-8")