Skip to content

Commit

Permalink
Increase API timeout
Browse files Browse the repository at this point in the history
As mentioned in MrKrabat#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.
  • Loading branch information
APachecoDiSanti authored Jul 23, 2021
1 parent ac33b19 commit 2083698
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion resources/lib/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ class API:
VERSON = "1.1.21.0"
TOKEN = "LNDJgOit5yaRIWN"
DEVICE = "com.crunchyroll.windows.desktop"
TIMEOUT = 30


def start(args):
Expand Down Expand Up @@ -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")
Expand Down

0 comments on commit 2083698

Please sign in to comment.