From: leo Date: Sun, 24 Oct 2021 15:40:14 +0000 (+0200) Subject: Fixed Sana icon and blacklist is now checked before sending a notification X-Git-Url: http://git.leonardobizzoni.com/?a=commitdiff_plain;h=b947d38743fb04429ee59377e85cda0ae763b3ba;p=holonotify Fixed Sana icon and blacklist is now checked before sending a notification --- diff --git a/holonotify.py b/holonotify.py index a2623af..cfb6dd6 100755 --- a/holonotify.py +++ b/holonotify.py @@ -16,7 +16,9 @@ ended = list() blacklist = list() def updateValues(): - global live, ended + global live, ended, blacklist + blacklist = utils.getBlacklist() + with urllib.request.urlopen("https://api.holotools.app/v1/live") as url: holoapi = json.loads(url.read().decode()) live = holoapi["live"] @@ -45,7 +47,6 @@ if __name__ == "__main__": running = True checkedPs = False psCount = 0 - blacklist = utils.getBlacklist() while running: main() diff --git a/utils.py b/utils.py index 150e23d..e76621b 100644 --- a/utils.py +++ b/utils.py @@ -9,6 +9,8 @@ def getBlacklist(): for x in f.read().splitlines(): if(x == "fubuki" or x == "shirakami"): blacklist.append("フブキ") + elif(x == "mel"): + blacklist.append("夜空メルチャンネル") elif (x == "akirose" or x == "aki" or x == "rosenthal"): blacklist.append("アキロゼ") else: @@ -118,7 +120,7 @@ def getIcon(name): return abspath + "amelia.jpg" elif ("irys" in name): return abspath + "irys.jpg" - elif ("tsukumoto" in name): + elif ("sana" in name): return abspath + "sana.jpg" elif ("fauna" in name): return abspath + "fauna.jpg"