mirror of
https://github.com/PaiGramTeam/MibooGram.git
synced 2024-11-28 10:41:48 +00:00
18 lines
324 B
Python
18 lines
324 B
Python
|
import typing
|
||
|
|
||
|
import httpx
|
||
|
|
||
|
from utils.patch.methods import patch, patchable
|
||
|
|
||
|
try:
|
||
|
import ujson as jsonlib
|
||
|
except ImportError:
|
||
|
import json as jsonlib
|
||
|
|
||
|
|
||
|
@patch(httpx.Response)
|
||
|
class Response:
|
||
|
@patchable
|
||
|
def json(self, **kwargs: typing.Any) -> typing.Any:
|
||
|
return jsonlib.loads(self.content, **kwargs)
|