aboutsummaryrefslogtreecommitdiff
path: root/authentication
diff options
context:
space:
mode:
authorBobby <[email protected]>2024-08-26 16:46:08 -0400
committerBobby <[email protected]>2024-08-26 16:46:08 -0400
commit33238c84606224ae78eaeae37ee1597eb7d9a217 (patch)
treece8c3b3cec43ff8c2a3815b3fcad59f5c02f3c88 /authentication
parentf1de90601ff844ff21196ce22432aa3d65623517 (diff)
downloadyugen-33238c84606224ae78eaeae37ee1597eb7d9a217.tar.xz
yugen-33238c84606224ae78eaeae37ee1597eb7d9a217.zip
temp auth on rate limit
Diffstat (limited to 'authentication')
-rw-r--r--authentication/utils.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/authentication/utils.py b/authentication/utils.py
index 2b8f3e1..5dd5d78 100644
--- a/authentication/utils.py
+++ b/authentication/utils.py
@@ -76,6 +76,9 @@ def exchange_code(code):
return response.json()
def get_user_mal_list(access_token, limit=10, offset=0):
+ if not access_token or access_token == "":
+ return [], None, None
+
base_url = f"https://api.myanimelist.net/v2/users/@me/animelist?limit={limit}&offset={offset}&fields=my_list_status,anime&sort=list_updated_at"
headers = {"Authorization": f"Bearer {access_token}"}
response = requests.get(base_url, headers=headers)