removed user agent setting since curl_impersonate does it
This commit is contained in:
1 parent
17219507bf
commit
0cfcca01bb
1 file changed
-6
@@ -11,12 +11,9 @@ import random
|
|||||||
from aioproxies import AioProxies
|
from aioproxies import AioProxies
|
||||||
from aioweb import Response
|
from aioweb import Response
|
||||||
from aioweb_tls import CurlCffi, TLSSession
|
from aioweb_tls import CurlCffi, TLSSession
|
||||||
from fake_useragent import UserAgent
|
|
||||||
|
|
||||||
from monitor_utils.constants import CLIENT_IDENTIFIERS, RETRY_LIMIT, TIMEOUT_SECONDS
|
from monitor_utils.constants import CLIENT_IDENTIFIERS, RETRY_LIMIT, TIMEOUT_SECONDS
|
||||||
|
|
||||||
UA = UserAgent()
|
|
||||||
|
|
||||||
|
|
||||||
def get_default_session(
|
def get_default_session(
|
||||||
proxies: AioProxies,
|
proxies: AioProxies,
|
||||||
@@ -48,9 +45,6 @@ def get_default_session(
|
|||||||
A TLSSession over a curl_cffi backend with a random impersonation, with
|
A TLSSession over a curl_cffi backend with a random impersonation, with
|
||||||
the proxy pool attached as proxy_pool.
|
the proxy pool attached as proxy_pool.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
headers = headers or {}
|
|
||||||
headers.setdefault("User-Agent", UA.chrome)
|
|
||||||
impersonate = random.choice(CLIENT_IDENTIFIERS)
|
impersonate = random.choice(CLIENT_IDENTIFIERS)
|
||||||
session = TLSSession(
|
session = TLSSession(
|
||||||
backend=CurlCffi(impersonate=impersonate), headers=headers, timeout=timeout
|
backend=CurlCffi(impersonate=impersonate), headers=headers, timeout=timeout
|
||||||
|
|||||||
Reference in new issue
Block a user