- Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtranslate.py
More file actions
Latest commit
35 lines (25 loc) · 730 Bytes
/
Copy pathtranslate.py
File metadata and controls
35 lines (25 loc) · 730 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# -*- coding: utf-8 -*-
"""
Programa desarrollado por el Licenciado César Cordero Rodríguez.
Bajo licencia GPLv3.
Puede ser modificado, copiado y distribuido.
Se desarrolló con fines educativos.
"""
# A translator in Python using Tor Proxy:
frompy_translatorimportTranslator
importsys
proxy= {
'socks': 'socks://localhost:9050',
'socks': 'socks://localhost:9050',
}
ROTATING_PROXY_LIST= {
'socks': 'socks://localhost:9050'
}
text=""
iflen(sys.argv) ==3:
text=sys.argv[1]
eliflen(sys.argv) ==4andsys.argv[3] =="using_file":
file=open(sys.argv[1], "r")
text=file.read()
s=Translator(proxies=proxy).translate(text=text, dest=sys.argv[2]).text
print(s)