This commit is contained in:
Yasir Aris M 2023-10-01 22:17:31 +07:00 committed by GitHub
parent 6270fc497e
commit 3cce0d4907
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,6 +1,6 @@
from asyncio import gather from asyncio import gather
import httpx from httpx AsyncClient, Timeout
from misskaty import app from misskaty import app
from aiohttp import ClientSession from aiohttp import ClientSession
@ -8,14 +8,14 @@ from aiohttp import ClientSession
session = ClientSession() session = ClientSession()
# HTTPx Async Client # HTTPx Async Client
fetch = httpx.AsyncClient( fetch = AsyncClient(
http2=True, http2=True,
verify=False, verify=False,
headers={ headers={
"Accept-Language": "id-ID", "Accept-Language": "id-ID",
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36 Edge/107.0.1418.42", "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36 Edge/107.0.1418.42",
}, },
timeout=httpx.Timeout(20), timeout=Timeout(20),
) )
app.fetch = fetch app.fetch = fetch