mirror of
https://github.com/myned/modufur.git
synced 2024-11-01 13:02:38 +00:00
Change fetch logic to be more logical
This commit is contained in:
parent
65329b81d4
commit
78c78c61d1
1 changed files with 3 additions and 3 deletions
|
@ -87,10 +87,10 @@ asession = aiohttp.ClientSession()
|
|||
async def fetch(url, *, params={}, json=False, response=False, text=False):
|
||||
async with asession.get(url, params=params, headers={
|
||||
'User-Agent': 'Myned/Modufur (https://github.com/Myned/Modufur)'}, ssl=False) as r:
|
||||
if json:
|
||||
return await r.json()
|
||||
elif response:
|
||||
if response:
|
||||
return r
|
||||
elif json:
|
||||
return await r.json()
|
||||
elif text:
|
||||
return await r.text()
|
||||
else:
|
||||
|
|
Loading…
Reference in a new issue