jellyseer-exporter/src/jellyseer_exporter/jellyseer.py

11 lines
393 B
Python

import requests
class JellyseerAPI:
def __init__(self, host: str, **config):
self.host = host
self.config = config
def api(self, method: str, path: str, params: dict = None):
url = f"https://{self.host}/{path}"
return requests.request(method, url, headers={"X-Api-Key": self.config["api_key"]}, params=params, verify=self.config["verify_ssl"]).json()