def configure_proxy(self):
""" Configure a proxy so that the API accepts it, had to use httplib2.. """
if self.proxy is not None:
prox_list = self.proxy.split(":")
prox_list[0] = ""
prox_list[1] = '.'.join(re.findall(r"\d+", prox_list[1]))
return httplib2.ProxyInfo(proxy_type=httplib2.socks.PROXY_TYPE_HTTP,
proxy_host=prox_list[1],
proxy_port=prox_list[2])
else:
return None
评论列表
文章目录