UlionTse / translators

🌏🌍🌎Translators🌎🌍🌏 is a library that aims to bring free, multiple, enjoyable translations to individuals and students in Python. Translators是一个旨在用Python为个人和学生带来免费、多样、愉快翻译的库。
https://pypi.org/project/translators/
GNU General Public License v3.0
1.62k stars 189 forks source link

[Feature]:add proxy pool #115

Closed vincecarterhu closed 1 year ago

vincecarterhu commented 1 year ago

Expect to happened

I want use this proxy pool address but is not easy to add it

Expected APP Version

next newest version

Expected Python Version

=3.6 (Default)

Expected Runtime Environment

NoArch (Default)

Country/Region

Qatar(example)

Expected Output

No response

Code of Conduct

UlionTse commented 1 year ago
import random

your_proxy_pool = [{'http': '123.123'}, {'http': '456.456'}]
print(ts.translate_text(chs_text, proxies=random.choice(your_proxy_pool)))