Comments (3)
@ksantr,
If I understand you correctly, you use the raw data: broker.find(data=data, limit=1)
. Right?
Could you insert at the beginning of executable file the following code, run it and send the log file (issue3.log) to constverum [] gmail dot com
(you can also attach it here, but be careful, it shows your real ip)?
import logging
logging.basicConfig(
filename='./issue3.log',
format='%(asctime)s - %(levelname)s - %(name)s - %(message)s',
datefmt='[%H:%M:%S]',
level=logging.DEBUG)
from proxybroker.
@ksantr thank you for logs, they were useful! I understood what was the problem =)
TL;DR
You need to update ProxyBroker. In latest versions this bug is fixed.
Bug: when the limit is reached we closed active tasks, but didn't clear the queue and so the test continued.
# api.py
def _done(self):
if self._isDone:
return
self._isDone = True
self._to_check.clear() # clear the queue <= added in v0.1.2
for f in self._on_check:
if not f.cancelled():
f.cancel()
self._tasks.cancel()
self.push_to_result(None)
log.debug('Done!')
Tip: use search by key instead of the expectedType
property (my fault; not marked as private - this is an experimental):
# bad
if proxy.expectedType == 'H':
ptype = 'http'
elif proxy.expectedType == 'S':
ptype = 'socks5'
# good
if 'HTTP' in proxy.types:
ptype = 'http'
elif 'SOCKS5' in proxy.types:
ptype = 'socks5'
Just in case some further information:
If we remove the infinite loop (server3.2.py.issue.txt, line 54: while True:
), then the execution time will depend on the number of live proxy. In our case, to find 2 live proxies among 22,5 k takes on average 5-15 seconds. Why is such difference? Because proxies are stored in an unordered collection (set)), so the order of proxy check is different every run.
In case we use providers instead of raw data, the execution time takes 2-4 seconds.
from proxybroker.
Thanks for fix.
from proxybroker.
Related Issues (20)
- Start server in new thread HOT 1
- Log/Output File Change HOT 1
- new free proxy site: https://pzzqz.com with free api HOT 5
- bash: proxybroker: command not found HOT 3
- is it possible to create a docker container with broker.serve()
- set_wakeup_fd only works in main thread of the main interpreter HOT 1
- Unable to start Proxybroker HOT 2
- I'm not sure what i'm doing wrong HOT 1
- Windows: Python-CFFI error HOT 4
- How to convert this ProxyBroker script to exe? HOT 2
- TypeError: function() argument 'code' must be code, not str HOT 1
- I managed to run this on Windows HOT 4
- trabl install end start HOT 1
- TypeError: As of 3.10, the *loop* parameter was removed from Queue() since it is no longer necessary HOT 4
- Not maintained. USE `proxybroker2` INSTEAD. HOT 1
- Error
- /home/user/.local/lib/python3.10/site-packages/proxybroker/cli.py:379: DeprecationWarning: There is no current event loop loop = asyncio.get_event_loop() Traceback (most recent call last): File "/home/user/.local/bin/proxybroker", line 8, in <module> sys.exit(cli()) File "/home/user/.local/lib/python3.10/site-packages/proxybroker/cli.py", line 380, in cli proxies = asyncio.Queue(loop=loop) File "/usr/lib/python3.10/asyncio/queues.py", line 34, in __init__ super().__init__(loop=loop) File "/usr/lib/python3.10/asyncio/mixins.py", line 17, in __init__ raise TypeError( TypeError: As of 3.10, the *loop* parameter was removed from Queue() since it is no longer necessary
- TypeError: Queue.__init__() got an unexpected keyword argument 'loop' HOT 3
- What is judges? HOT 1
- TypeError: As of 3.10, the *loop* parameter was removed from Queue() since it is no longer necessary
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from proxybroker.