diff options
| author | jwansek <eddie.atten.ea29@gmail.com> | 2021-03-03 22:39:05 +0000 | 
|---|---|---|
| committer | jwansek <eddie.atten.ea29@gmail.com> | 2021-03-03 22:39:05 +0000 | 
| commit | 64f4004d605cd0e576c3fc3fec95a7f118b4f20e (patch) | |
| tree | b3f0b28b9f0f8f75c8e83bf15f1b7092508e1b2e | |
| parent | 5d330852b8b390af41717e0fdb47a689cc18bd77 (diff) | |
| download | eda.gay-64f4004d605cd0e576c3fc3fec95a7f118b4f20e.tar.gz eda.gay-64f4004d605cd0e576c3fc3fec95a7f118b4f20e.zip | |
fixed dependencies
| -rw-r--r-- | requirements.txt | 4 | ||||
| -rw-r--r-- | services.py | 21 | 
2 files changed, 12 insertions, 13 deletions
| diff --git a/requirements.txt b/requirements.txt index fd89b0f..32044b1 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,6 +5,6 @@ PiHole_api  transmission-clutch  dataclasses  docker -pihole==0.1.2 +PiHole-api  Pillow==8.1.0 -qbittorrent==0.1.6 +python-qbittorrent==0.4.2 diff --git a/services.py b/services.py index 32edb5d..69c0eae 100644 --- a/services.py +++ b/services.py @@ -3,7 +3,7 @@ import qbittorrent  import datetime  import docker  import clutch -import pihole +import pihole as ph  import queue  import json  import time @@ -55,7 +55,6 @@ def timeout(func):  @timeout  def get_docker_stats(): -      client = docker.DockerClient(base_url = "tcp://%s:%s" % (app.CONFIG["docker"]["url"], app.CONFIG["docker"]["port"]))      return {          container.name: container.status @@ -99,17 +98,17 @@ def get_trans_stats():  @timeout  def get_pihole_stats(): -    ph = pihole.PiHole(app.CONFIG["pihole"]["url"]) +    pihole = ph.PiHole(app.CONFIG["pihole"]["url"])      return { -        "status": ph.status, -        "queries": ph.total_queries, -        "clients": ph.unique_clients, -        "percentage": ph.ads_percentage, -        "blocked": ph.blocked, -        "domains": ph.domain_count, -        "last_updated": str(datetime.datetime.fromtimestamp(ph.gravity_last_updated["absolute"])) +        "status": pihole.status, +        "queries": pihole.total_queries, +        "clients": pihole.unique_clients, +        "percentage": pihole.ads_percentage, +        "blocked": pihole.blocked, +        "domains": pihole.domain_count, +        "last_updated": str(datetime.datetime.fromtimestamp(pihole.gravity_last_updated["absolute"]))      }  if __name__ == "__main__": -    print(get_pihole_stats())
\ No newline at end of file +    print(get_qbit_stats())
\ No newline at end of file | 
