Skip to content

Commit 97229e6

Browse files
authored
fix docip bug & add support for python 3.11 (#205)
1 parent 2344ee1 commit 97229e6

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

proxypool/crawlers/public/docip.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def parse(self, html):
2525
proxy_list = result['data']
2626
for proxy_item in proxy_list:
2727
host = proxy_item['ip']
28-
port = proxy_item['port']
28+
port = host.split(':')[-1]
2929
yield Proxy(host=host, port=port)
3030
except json.JSONDecodeError:
3131
print("json.JSONDecodeError")

proxypool/processors/tester.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ def run(self):
8282
logger.debug(f'testing proxies use cursor {cursor}, count {TEST_BATCH}')
8383
cursor, proxies = self.redis.batch(cursor, count=TEST_BATCH)
8484
if proxies:
85-
tasks = [self.test(proxy) for proxy in proxies]
85+
tasks = [self.loop.create_task(self.test(proxy)) for proxy in proxies]
8686
self.loop.run_until_complete(asyncio.wait(tasks))
8787
if not cursor:
8888
break

requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ redis>=3.5.3,<4.0.0
1111
lxml>=4.6.5,<5.0.0
1212
fake_headers>=1.0.2,<2.0.0
1313
maxminddb_geolite2==2018.703
14-
gevent>=21.8.0,<22.0.0
14+
gevent>=21.8.0,<24.0.0
1515
tornado>=6.0,<7.0
1616
itsdangerous==0.24
1717
MarkupSafe<2.1.0

0 commit comments

Comments
 (0)