xbmc / addon-check

Automatic checks for new repository submissions
GNU General Public License v3.0
52 stars 42 forks source link

Add option to prevent checking if addon already exists in Kodi addon repository #207

Open goggle opened 5 years ago

goggle commented 5 years ago

This tools tries to establish a internet connection to check if the addon is already available in Kodi's addon repository. If establish that connection fails, I get this:

Traceback (most recent call last):
  File "/tmp/kodi-check/lib/python3.7/site-packages/urllib3/response.py", line 425, in _error_catcher
    yield
  File "/tmp/kodi-check/lib/python3.7/site-packages/urllib3/response.py", line 507, in read
    data = self._fp.read(amt) if not fp_closed else b""
  File "/usr/lib64/python3.7/http/client.py", line 457, in read
    n = self.readinto(b)
  File "/usr/lib64/python3.7/http/client.py", line 501, in readinto
    n = self.fp.readinto(b)
  File "/usr/lib64/python3.7/socket.py", line 589, in readinto
    return self._sock.recv_into(b)
  File "/usr/lib64/python3.7/ssl.py", line 1071, in recv_into
    return self.read(nbytes, buffer)
  File "/usr/lib64/python3.7/ssl.py", line 929, in read
    return self._sslobj.read(len, buffer)
socket.timeout: The read operation timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/tmp/kodi-check/lib/python3.7/site-packages/requests/models.py", line 750, in generate
    for chunk in self.raw.stream(chunk_size, decode_content=True):
  File "/tmp/kodi-check/lib/python3.7/site-packages/urllib3/response.py", line 564, in stream
    data = self.read(amt=amt, decode_content=decode_content)
  File "/tmp/kodi-check/lib/python3.7/site-packages/urllib3/response.py", line 529, in read
    raise IncompleteRead(self._fp_bytes_read, self.length_remaining)
  File "/usr/lib64/python3.7/contextlib.py", line 130, in __exit__
    self.gen.throw(type, value, traceback)
  File "/tmp/kodi-check/lib/python3.7/site-packages/urllib3/response.py", line 430, in _error_catcher
    raise ReadTimeoutError(self._pool, None, "Read timed out.")
urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='kodi.mirror.wearetriple.com', port=443): Read timed out.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/tmp/kodi-check/bin/kodi-addon-checker", line 8, in <module>
    sys.exit(main())
  File "/tmp/kodi-check/lib/python3.7/site-packages/kodi_addon_checker/__main__.py", line 86, in main
    all_repo_addons = check_addon.get_all_repo_addons()
  File "/tmp/kodi-check/lib/python3.7/site-packages/kodi_addon_checker/check_addon.py", line 121, in get_all_repo_addons
    repo_addons[branch] = Repository(branch, branch_url)
  File "/tmp/kodi-check/lib/python3.7/site-packages/kodi_addon_checker/addons/Repository.py", line 23, in __init__
    content = requests.get(path, timeout=(10, 10)).content
  File "/tmp/kodi-check/lib/python3.7/site-packages/requests/api.py", line 75, in get
    return request('get', url, params=params, **kwargs)
  File "/tmp/kodi-check/lib/python3.7/site-packages/requests/api.py", line 60, in request
    return session.request(method=method, url=url, **kwargs)
  File "/tmp/kodi-check/lib/python3.7/site-packages/requests/sessions.py", line 533, in request
    resp = self.send(prep, **send_kwargs)
  File "/tmp/kodi-check/lib/python3.7/site-packages/requests/sessions.py", line 668, in send
    history = [resp for resp in gen] if allow_redirects else []
  File "/tmp/kodi-check/lib/python3.7/site-packages/requests/sessions.py", line 668, in <listcomp>
    history = [resp for resp in gen] if allow_redirects else []
  File "/tmp/kodi-check/lib/python3.7/site-packages/requests/sessions.py", line 247, in resolve_redirects
    **adapter_kwargs
  File "/tmp/kodi-check/lib/python3.7/site-packages/requests/sessions.py", line 686, in send
    r.content
  File "/tmp/kodi-check/lib/python3.7/site-packages/requests/models.py", line 828, in content
    self._content = b''.join(self.iter_content(CONTENT_CHUNK_SIZE)) or b''
  File "/tmp/kodi-check/lib/python3.7/site-packages/requests/models.py", line 757, in generate
    raise ConnectionError(e)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='kodi.mirror.wearetriple.com', port=443): Read timed out.

It would be nice to have at least an option provided to prevent that check.