httpscreenshot
httpscreenshot copied to clipboard
Does not work on OSX qsize(): not supported
On OSX Queue.qsize() breaks for multiprocessor queues. There are two calls to this function in httpscreenshot.
Locally I was able to get httpscreenshot to run on OSX by changing these to use the .empty() method, but this results in not getting any stdout feedback on how many items left in the queue... unless you hack some external global counter... but then you have to contend with thread-safe (and multi-processor safe) access to that... so I'm not sure its worth a pull request. Hopefully someone will update the OSX libs to implement qsize(), but in the meantime if anyone wants to run this on OSX, here is what worked for me:
@@ -194,12 +194,12 @@ def worker(urlQueue, tout, debug, headless, doProfile, vhosts, subs, extraHosts,
while True:
#Try to get a URL from the Queue
- if urlQueue.qsize() > 0:
+ if not urlQueue.empty():
try:
curUrl = urlQueue.get(timeout=tout)
except Queue.Empty:
continue
- print '[+] '+str(urlQueue.qsize())+' URLs remaining'
+ print '[+] more URLs remaining'
screenshotName = quote(curUrl[0], safe='')
if(debug):
print '[+] Got URL: '+curUrl[0]