11
11
12
12
import httpx
13
13
from httpx import Response , Timeout
14
- from httpx ._types import ProxiesTypes
14
+ from httpx ._types import ProxyTypes
15
15
16
16
from googletrans import urls , utils
17
17
from googletrans .constants import (
@@ -42,17 +42,11 @@ class Translator:
42
42
:param user_agent: the User-Agent header to send when making requests.
43
43
:type user_agent: :class:`str`
44
44
45
- :param proxies: proxies configuration.
46
- Dictionary mapping protocol or protocol and host to the URL of the proxy
47
- For example ``{'http': 'foo.bar:3128', 'http://host.name': 'foo.bar:4012'}``
48
- :type proxies: dictionary
45
+ :param proxy: httpx proxy configuration.
49
46
50
47
:param timeout: Definition of timeout for httpx library.
51
48
Will be used for every request.
52
49
:type timeout: number or a double of numbers
53
- :param proxies: proxies configuration.
54
- Dictionary mapping protocol or protocol and host to the URL of the proxy
55
- For example ``{'http': 'foo.bar:3128', 'http://host.name': 'foo.bar:4012'}``
56
50
:param raise_exception: if `True` then raise exception if smth will go wrong
57
51
:type raise_exception: boolean
58
52
"""
@@ -62,14 +56,14 @@ def __init__(
62
56
service_urls : typing .Sequence [str ] = DEFAULT_CLIENT_SERVICE_URLS ,
63
57
user_agent : str = DEFAULT_USER_AGENT ,
64
58
raise_exception : bool = DEFAULT_RAISE_EXCEPTION ,
65
- proxies : typing .Optional [ProxiesTypes ] = None ,
59
+ proxy : typing .Optional [ProxyTypes ] = None ,
66
60
timeout : typing .Optional [Timeout ] = None ,
67
61
http2 : bool = True ,
68
62
list_operation_max_concurrency : int = 2 ,
69
63
):
70
64
self .client = httpx .AsyncClient (
71
65
http2 = http2 ,
72
- proxies = proxies ,
66
+ proxy = proxy ,
73
67
headers = {
74
68
"User-Agent" : user_agent ,
75
69
},
0 commit comments