rbignon / doctoshotgun

Script to automatically book a vaccine slot on Doctolib in the next seven days.
GNU General Public License v3.0
549 stars 142 forks source link

Adding support for proxy configuration #300

Closed seranpion closed 2 years ago

seranpion commented 2 years ago

As others, I have ran into (temporary? Several hours so far) blacklisting of my IP (cf. here). The use of a proxy helped work around that blocking.

But on windows, the corresponding environment variables have no effect. So here is a new --proxy PROXY parameter to explicitely define a proxy for the HTTPS protocole.

Note that the use of some proxy schemes (e.g. "socks5://") require additional package (e.g. "PySocks"). I don't know if that's worth mentioning in the doc though. It is reported at runtime on the output.

rbignon commented 2 years ago

Hello,

Thank you for your patch. However, it would be better to use the standard https_proxy environment variable?

seranpion commented 2 years ago

Hello.

While the requests python package do mention a https_proxy environment variable, I have not seen it having any effect in my setup (Windows 10, Python 3.9).

However, I won't complain if you keep this this PR on hold until there is more feedback on the captcha issue. I expect this feature to be useless to most.

seranpion commented 2 years ago

Nevermind, I must have done a bad manipulation back then. The https_proxy environment variable does work.