如何通过代理使用Tumblr api。任何帮助都将不胜感激。
我想使用通过代理进行api调用的Tumblr api。
任何关于如何实现这一目标的帮助都将受到高度赞赏。谢谢。
这是没有代理的api的正常使用方式。它们是我使用proxy的一种方式。
import pytumblr
client = pytumblr.TumblrRestClient(
'<consumer_key>',
'<consumer_secret>',
'<oauth_token>',
'<oauth_secret>',
)
client.info() # get information about the authenticating user
client.dashboard() # get the dashboard for the authenticating user
client.likes() # get the likes for the authenticating user
client.following() # get the blogs followed by the authenticating user
# How can I use it with proxy, that's authenticate with proxy.发布于 2019-02-16 22:56:12
pytumblr使用requests发送超文本传输协议请求。因此,您可以像这样设置bash环境变量'HTTP_PROXY‘和'HTTPS_PROXY’
$ export HTTP_PROXY="http://127.0.0.1:1080" # or socks5
$ export HTTPS_PROXY="http://127.0.0.1:1080"
$ python3 ./tumblr_code.py或
import os
os.environ['HTTP_PROXY'] = 'http://127.0.0.1:1080'
os.environ['HTTPS_PROXY'] = 'http://127.0.0.1:1080'
// remaining pytumblr codeshttps://stackoverflow.com/questions/50430377
复制相似问题