diff --git a/osu.py b/osu.py index 5262266c..eed323b5 100644 --- a/osu.py +++ b/osu.py @@ -1,5 +1,6 @@ import asyncio import requests +import functools loop = asyncio.get_event_loop() # Load Osu API key from the osutoken.txt file @@ -15,7 +16,7 @@ async def get_user(user, mode=0): "u": user } # Get the data - r = await loop.run_in_executor(None, requests.get, 'https://osu.ppy.sh/api/get_user?k={k}&m={m}&u={u}'.format(**params)) + r = await loop.run_in_executor(None, functools.partial(requests.get, timeout=6.1) 'https://osu.ppy.sh/api/get_user?k={k}&m={m}&u={u}'.format(**params)) if r.status_code == 200: return r.json()[0] else: