Use the CensorshipCircumvention methods to fetch bridges for the country/autodetection

This commit is contained in:
Miguel Jacq 2021-12-14 10:48:47 +11:00
parent c101536d90
commit 3f4cb6a02e
No known key found for this signature in database
GPG key ID: EEA4341C6D97A0B6
5 changed files with 72 additions and 46 deletions

View file

@ -127,6 +127,11 @@ class CensorshipCircumvention(object):
endpoint = "https://bridges.torproject.org/moat/circumvention/settings"
data = {}
if country:
self.common.log(
"CensorshipCircumvention",
"censorship_obtain_settings",
f"Trying to obtain bridges for country={country}",
)
data = {"country": country}
if transports:
data.append({"transports": transports})