-
Refactor code to remove duplication
-
Add documentation for calls
-
Import packages to watch from external JSON file (project name, URL, type for match [release or name])
-
Update version file from gist without external ruby gist tool
-
probably use https://pypi.org/project/python-gist/
-
-
Error handling for the common errors
-
Deal with lost connections and timeouts
-
-
Build an import module
-
Put in error handling for offline errors
-
Add error handling for HTTP status code returned other than 200
-
https://www.digitalocean.com/community/tutorials/how-to-use-web-apis-in-python-3
-
Define function that grabs data, verifies return code
-
-
-
Make version list independent of ordering
-
Refactor data calls to GraphQL / GitHub QPI v4
-
Refactor Update classes for duplicated initialization
-
Add dead man switch
-
At midnight ":bell: All’s well, all’s well. :bell:"
-
-
Refactor get_version to be handled only once inside the Update Class
-
Started on
refactor-get_version branch
-
-
Add GitHub auth to forgo rate limits
-
Read Packages to check from external JSON file
-
Refactor package initialization into class
-
Refactor version stringing into two reusable functions
Traceback (most recent call last):
File "update_bot.py", line 197, in <module>
main()
File "update_bot.py", line 189, in main
schedule.run_pending()
File "/usr/local/lib/python2.7/dist-packages/schedule/__init__.py", line 452, in run_pending
default_scheduler.run_pending()
File "/usr/local/lib/python2.7/dist-packages/schedule/__init__.py", line 75, in run_pending
self._run_job(job)
File "/usr/local/lib/python2.7/dist-packages/schedule/__init__.py", line 129, in _run_job
ret = job.run()
File "/usr/local/lib/python2.7/dist-packages/schedule/__init__.py", line 377, in run
ret = self.job_func()
File "update_bot.py", line 22, in do_update
qBittorrent(),
File "update_bot.py", line 130, in __init__
self.verstring = (liquidize(self.get_data(self.srcstring)).p.string)
File "update_bot.py", line 88, in get_data
data = requests.get(srcstring, headers)
File "/usr/local/lib/python2.7/dist-packages/requests/api.py", line 72, in get
return request('get', url, params=params, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/requests/api.py", line 58, in request
return session.request(method=method, url=url, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 508, in request
resp = self.send(prep, **send_kwargs)
File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 618, in send
r = adapter.send(request, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/requests/adapters.py", line 508, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='www.qbittorrent.org', port=443): Max retries exceeded with url: /news.php (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0xb5fc73b0>: Failed to establish a new connection: [Errno 111] Connection refused',))
File "update_bot.py", line 59, in notify
send_bot_msg(message)
File "update_bot.py", line 54, in send_bot_msg
bot.sendMessage(user_id, message)
File "/usr/local/lib/python2.7/dist-packages/telepot/__init__.py", line 456, in sendMessage
return self._api_request('sendMessage', _rectify(p))
File "/usr/local/lib/python2.7/dist-packages/telepot/__init__.py", line 434, in _api_request
return api.request((self._token, method, params, files), **kwargs)
File "/usr/local/lib/python2.7/dist-packages/telepot/api.py", line 130, in request
r = fn(*args, **kwargs) # `fn` must be thread-safe
File "/usr/local/lib/python2.7/dist-packages/urllib3/request.py", line 148, in request_encode_body
return self.urlopen(method, url, **extra_kw)
File "/usr/local/lib/python2.7/dist-packages/urllib3/poolmanager.py", line 321, in urlopen
response = conn.urlopen(method, u.request_uri, **kw)
File "/usr/local/lib/python2.7/dist-packages/urllib3/connectionpool.py", line 639, in urlopen
_stacktrace=sys.exc_info()[2])
File "/usr/local/lib/python2.7/dist-packages/urllib3/util/retry.py", line 357, in increment
raise six.reraise(type(error), error, _stacktrace)
File "/usr/local/lib/python2.7/dist-packages/urllib3/connectionpool.py", line 601, in urlopen
chunked=chunked)
File "/usr/local/lib/python2.7/dist-packages/urllib3/connectionpool.py", line 380, in _make_request
httplib_response = conn.getresponse(buffering=True)
File "/usr/lib/python2.7/httplib.py", line 1111, in getresponse
response.begin()
File "/usr/lib/python2.7/httplib.py", line 444, in begin
version, status, reason = self._read_status()
File "/usr/lib/python2.7/httplib.py", line 400, in _read_status
line = self.fp.readline(_MAXLINE + 1)
File "/usr/lib/python2.7/socket.py", line 476, in readline
data = self._sock.recv(self._rbufsize)
File "/usr/lib/python2.7/ssl.py", line 714, in recv
return self.read(buflen)
File "/usr/lib/python2.7/ssl.py", line 608, in read
v = self._sslobj.read(len or 1024)
urllib3.exceptions.ProtocolError: ('Connection aborted.', error(104, 'Connection reset by peer'))
File "update_bot.py", line 73, in notify
send_bot_msg(message)
File "update_bot.py", line 68, in send_bot_msg
bot.sendMessage(user_id, message)
File "/usr/local/lib/python2.7/dist-packages/telepot/__init__.py", line 456, in sendMessage
return self._api_request('sendMessage', _rectify(p))
File "/usr/local/lib/python2.7/dist-packages/telepot/__init__.py", line 434, in _api_request
return api.request((self._token, method, params, files), **kwargs)
File "/usr/local/lib/python2.7/dist-packages/telepot/api.py", line 130, in request
r = fn(*args, **kwargs) # `fn` must be thread-safe
File "/usr/local/lib/python2.7/dist-packages/urllib3/request.py", line 148, in request_encode_body
return self.urlopen(method, url, **extra_kw)
File "/usr/local/lib/python2.7/dist-packages/urllib3/poolmanager.py", line 321, in urlopen
response = conn.urlopen(method, u.request_uri, **kw)
File "/usr/local/lib/python2.7/dist-packages/urllib3/connectionpool.py", line 639, in urlopen
_stacktrace=sys.exc_info()[2])
File "/usr/local/lib/python2.7/dist-packages/urllib3/util/retry.py", line 357, in increment
raise six.reraise(type(error), error, _stacktrace)
File "/usr/local/lib/python2.7/dist-packages/urllib3/connectionpool.py", line 601, in urlopen
chunked=chunked)
File "/usr/local/lib/python2.7/dist-packages/urllib3/connectionpool.py", line 380, in _make_request
httplib_response = conn.getresponse(buffering=True)
File "/usr/lib/python2.7/httplib.py", line 1121, in getresponse
response.begin()
File "/usr/lib/python2.7/httplib.py", line 438, in begin
version, status, reason = self._read_status()
File "/usr/lib/python2.7/httplib.py", line 394, in _read_status
line = self.fp.readline(_MAXLINE + 1)
File "/usr/lib/python2.7/socket.py", line 480, in readline
data = self._sock.recv(self._rbufsize)
File "/usr/local/lib/python2.7/dist-packages/urllib3/contrib/pyopenssl.py", line 274, in recv
return self.recv(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/urllib3/contrib/pyopenssl.py", line 263, in recv
raise SocketError(str(e))
urllib3.exceptions.ProtocolError: ('Connection aborted.', error("(104, 'ECONNRESET')",))
G870A version "G870AUCS2DQD1" is already known.
qBittorrent version "3.3.15" is already known.
KeePassXC version "2.2.0" is already known.
Atom version "1.19.4" is already known.
Asciidoctor-PDF version "v1.5.0 Alpha 16" is already known.
AsciiBinder version "v0.1.10.1" is already known.
Traceback (most recent call last):
File "update_bot.py", line 265, in <module>
main()
File "update_bot.py", line 253, in main
schedule.run_pending()
File "/usr/local/lib/python2.7/dist-packages/schedule/__init__.py", line 452, in run_pending
default_scheduler.run_pending()
File "/usr/local/lib/python2.7/dist-packages/schedule/__init__.py", line 75, in run_pending
self._run_job(job)
File "/usr/local/lib/python2.7/dist-packages/schedule/__init__.py", line 129, in _run_job
ret = job.run()
File "/usr/local/lib/python2.7/dist-packages/schedule/__init__.py", line 377, in run
ret = self.job_func()
File "update_bot.py", line 35, in do_update
G870A(),
File "update_bot.py", line 126, in __init__
self.xml = self.get_data(self.srcstring, {'Accept': 'application/json'}).json()['resultBody']['contentTypeProperties']['currentsoftdetails']
KeyError: 'currentsoftdetails'
-
Refactor updates to functions
-
Update usage of package name to build strings
-
Update known versions to reflect package usage
-
Refactor to classes
-
Build update for Atom feed
-
xml.etree.ElementTree
-
Used GitHub API and JSON instead
-
Switch qbittorrent release stream to GitHub
-
Switch KeePassXC to GitHub release stream
-
Get and store known versions in gist