I want to use proxy (with/without auth) with Twitter API via Tweepy in Python
Reading the documentation I tried something (I think really wrong) like this:
auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
auth.set_access_token(access_token, access_token_secret)
api = tweepy.API(auth, proxy='1.2.3.4:1234')
But obviously didn’t work
2
Answers
Since Tweepy doesn’t seems to support proxy, you can change the ones on your system changing the
https_proxy
variableOn Linux:
On Windows:
You can do it before launching the script or inside it, using subprocess to run a command
I had the same issue due to twitter ban in my country, all i did was to download a VPN application(Hide me VPN) and the code worked.