SpiderClub / haipproxy

:sparkling_heart: High available distributed ip proxy pool, powerd by Scrapy and Redis

Home Page:https://spiderclub.github.io/haipproxy/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

api 接口 bug

whg517 opened this issue · comments

1. api 获取代理全部为 https 的代理

usage_registry = {task['name']: ProxyFetcher('task') for task in VALIDATOR_TASKS}

因为 ProxyFetcher('task') 传入为字符串'task'

if usage not in score_map.keys():

在判断不在 sorce_map 中会赋值为 https
usage = 'https'

所以这里逻辑有点问题。正确获取对应 usage 的 proxy 应该是

- usage_registry = {task['name']: ProxyFetcher('task') for task in VALIDATOR_TASKS}
+ usage_registry = {task['name']: ProxyFetcher(task['name']) for task in VALIDATOR_TASKS}

2. delete 接口参数设置错误

@app.route("/proxy/delete/<usage>/<proxy>")

使用这个接口的方式应该是

http://127.0.0.1:5000/proxy/delete/zhihu/http://1.63.153.153:80

但是很明显这个 URL 是有问题的 对于 proxy 参数,如果要正常传入应该在 request body 中发送。

建议优化接口参数接收方式和数据接收方式。

感谢指出错误。
api这个功能目前还在开发中,master上的东西并不是稳定的。目前精力不是很够,所以一直没更新,api这里最大的问题还是在于多个用户的IP使用隔离机制,这一点也还在探索之中