Skip to content

Commit

Permalink
Removed proxy feature
Browse files Browse the repository at this point in the history
  • Loading branch information
kbshal committed May 22, 2022
1 parent 81c4e3a commit ade5faa
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions api/PYtranslator.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,6 @@ async def translate(self, text, lang_tgt='auto', lang_src='auto', pronounce=Fals
headers=headers,
)
try:
if self.proxies == None or type(self.proxies) != dict:
self.proxies = {}
with requests.Session() as s:
s.proxies = self.proxies
r = s.send(request=response.prepare(),
verify=False,
timeout=self.timeout)
for line in r.iter_lines(chunk_size=1024):
decoded_line = line.decode('utf-8')
if "MkEWBc" in decoded_line:
Expand Down Expand Up @@ -183,14 +176,6 @@ async def detect(self, text):
data=freq,
headers=headers)
try:
if self.proxies == None or type(self.proxies) != dict:
self.proxies = {}
with requests.Session() as s:
s.proxies = self.proxies
r = s.send(request=response.prepare(),
verify=False,
timeout=self.timeout)

for line in r.iter_lines(chunk_size=1024):
decoded_line = line.decode('utf-8')
if "MkEWBc" in decoded_line:
Expand Down

0 comments on commit ade5faa

Please sign in to comment.