mirror of
https://github.com/StuffAnThings/qbit_manage.git
synced 2025-10-25 13:37:08 +08:00
Updated payload for notifiarr
This commit is contained in:
parent
d8ab1f25c4
commit
467a615e8b
3 changed files with 7 additions and 2 deletions
|
|
@ -130,7 +130,10 @@ orphaned:
|
||||||
|
|
||||||
#Notifiarr integration with webhooks
|
#Notifiarr integration with webhooks
|
||||||
notifiarr:
|
notifiarr:
|
||||||
|
#Mandatory to fill out API Key
|
||||||
apikey: ####################################
|
apikey: ####################################
|
||||||
|
#Your qBittorrent instance, can be set to any unique value
|
||||||
|
instance:
|
||||||
test: true
|
test: true
|
||||||
develop: true
|
develop: true
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -83,7 +83,8 @@ class Config:
|
||||||
self.NotifiarrFactory = Notifiarr(self, {
|
self.NotifiarrFactory = Notifiarr(self, {
|
||||||
"apikey": self.util.check_for_attribute(self.data, "apikey", parent="notifiarr", throw=True),
|
"apikey": self.util.check_for_attribute(self.data, "apikey", parent="notifiarr", throw=True),
|
||||||
"develop": self.util.check_for_attribute(self.data, "develop", parent="notifiarr", var_type="bool", default=False, do_print=False, save=False),
|
"develop": self.util.check_for_attribute(self.data, "develop", parent="notifiarr", var_type="bool", default=False, do_print=False, save=False),
|
||||||
"test": self.util.check_for_attribute(self.data, "test", parent="notifiarr", var_type="bool", default=False, do_print=False, save=False)
|
"test": self.util.check_for_attribute(self.data, "test", parent="notifiarr", var_type="bool", default=False, do_print=False, save=False),
|
||||||
|
"instance": self.util.check_for_attribute(self.data, "instance", parent="notifiarr", default=False, do_print=False, save=False)
|
||||||
})
|
})
|
||||||
except Failed as e:
|
except Failed as e:
|
||||||
logger.error(e)
|
logger.error(e)
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@ class Notifiarr:
|
||||||
self.apikey = params["apikey"]
|
self.apikey = params["apikey"]
|
||||||
self.develop = params["develop"]
|
self.develop = params["develop"]
|
||||||
self.test = params["test"]
|
self.test = params["test"]
|
||||||
|
self.instance = params["instance"]
|
||||||
url, _ = self.get_url("user/validate/")
|
url, _ = self.get_url("user/validate/")
|
||||||
response = self.config.get(url)
|
response = self.config.get(url)
|
||||||
response_json = response.json()
|
response_json = response.json()
|
||||||
|
|
@ -28,5 +29,5 @@ class Notifiarr:
|
||||||
if self.config.trace_mode:
|
if self.config.trace_mode:
|
||||||
logger.debug(url.replace(self.apikey, "APIKEY"))
|
logger.debug(url.replace(self.apikey, "APIKEY"))
|
||||||
test_payload = (f"qbitManage-{self.apikey[:5]}")
|
test_payload = (f"qbitManage-{self.apikey[:5]}")
|
||||||
params = {"event": test_payload, "qbit_client":self.config.data["qbt"]["host"] if self.test else "notify"}
|
params = {"event": test_payload, "qbit_client":self.config.data["qbt"]["host"], "instance":self.instance if self.test else "notify"}
|
||||||
return url, params
|
return url, params
|
||||||
Loading…
Add table
Reference in a new issue