mirror of
https://github.com/myned/modufur.git
synced 2024-11-01 21: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 def fetch(url, *, params={}, json=False, response=False, text=False):
|
||||||
async with asession.get(url, params=params, headers={
|
async with asession.get(url, params=params, headers={
|
||||||
'User-Agent': 'Myned/Modufur (https://github.com/Myned/Modufur)'}, ssl=False) as r:
|
'User-Agent': 'Myned/Modufur (https://github.com/Myned/Modufur)'}, ssl=False) as r:
|
||||||
if json:
|
if response:
|
||||||
return await r.json()
|
|
||||||
elif response:
|
|
||||||
return r
|
return r
|
||||||
|
elif json:
|
||||||
|
return await r.json()
|
||||||
elif text:
|
elif text:
|
||||||
return await r.text()
|
return await r.text()
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in a new issue