Nekmo / dirhunt

Find web directories without bruteforce
MIT License
1.76k stars 236 forks source link

Catch UrlInfo read exceptions #58

Closed Nekmo closed 5 years ago

Nekmo commented 5 years ago
Traceback (most recent call last):
  File "/home/nekmo/Workspace/dirhunt/dirhunt/exceptions.py", line 43, in wrapped
    return func(*args, **kwargs)
  File "/home/nekmo/Workspace/dirhunt/dirhunt/url_info.py", line 162, in callback
    line = self._get_url_info(url_len, extra_len, file)
  File "/home/nekmo/Workspace/dirhunt/dirhunt/url_info.py", line 192, in _get_url_info
    return UrlInfo(self.sessions, file, self.timeout).line(size[0], url_len, extra_len)
  File "/home/nekmo/Workspace/dirhunt/dirhunt/url_info.py", line 115, in line
    if not len(self.text):
  File "/home/nekmo/Workspace/dirhunt/dirhunt/url_info.py", line 111, in text
    self._text = self.get_text()
  File "/home/nekmo/Workspace/dirhunt/dirhunt/url_info.py", line 104, in get_text
    text = self.data['title'] or self.data['body'] or self.data['text'] or ''
  File "/home/nekmo/Workspace/dirhunt/dirhunt/url_info.py", line 86, in data
    self._data = self.get_data()
  File "/home/nekmo/Workspace/dirhunt/dirhunt/url_info.py", line 59, in get_data
    text = resp.raw.read(MAX_RESPONSE_SIZE, decode_content=True)
  File "/home/nekmo/.virtualenvs/dirhunt/lib/python3.6/site-packages/urllib3/response.py", line 401, in read
    raise IncompleteRead(self._fp_bytes_read, self.length_remaining)
  File "/usr/lib/python3.6/contextlib.py", line 99, in __exit__
    self.gen.throw(type, value, traceback)
  File "/home/nekmo/.virtualenvs/dirhunt/lib/python3.6/site-packages/urllib3/response.py", line 307, in _error_catcher
    raise ReadTimeoutError(self._pool, None, 'Read timed out.')
urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='xxxxxxxxxx', port=443): Read timed out.
Traceback (most recent call last):
  File "/home/nekmo/.virtualenvs/dirhunt/lib/python3.6/site-packages/urllib3/response.py", line 302, in _error_catcher
    yield
  File "/home/nekmo/.virtualenvs/dirhunt/lib/python3.6/site-packages/urllib3/response.py", line 384, in read
    data = self._fp.read(amt)
  File "/usr/lib/python3.6/http/client.py", line 449, in read
    n = self.readinto(b)
  File "/usr/lib/python3.6/http/client.py", line 493, in readinto
    n = self.fp.readinto(b)
  File "/usr/lib/python3.6/socket.py", line 586, in readinto
    return self._sock.recv_into(b)
  File "/usr/lib/python3.6/ssl.py", line 1009, in recv_into
    return self.read(nbytes, buffer)
  File "/usr/lib/python3.6/ssl.py", line 871, in read
    return self._sslobj.read(len, buffer)
  File "/usr/lib/python3.6/ssl.py", line 631, in read
    v = self._sslobj.read(len, buffer)
socket.timeout: The read operation timed out