diff --git a/bin/hooks/usb-eject.py b/bin/hooks/usb-eject.py index 6bfd92a4..a012098b 100644 --- a/bin/hooks/usb-eject.py +++ b/bin/hooks/usb-eject.py @@ -34,7 +34,10 @@ MOUNT_BASE = b"/run/media/egon/" def main(): try: - label = sys.argv[1].split(":usb-eject:")[1].split(":")[0] + msg = sys.argv[1] + if msg.startswith("upload-queue-empty;"): + return + label = msg.split(":usb-eject:")[1].split(":")[0] mp = MOUNT_BASE + unquote(label) # print("ejecting [%s]... " % (mp,), end="") mp = os.path.abspath(os.path.realpath(mp)) diff --git a/bin/hooks/wget-i.py b/bin/hooks/wget-i.py index 6bb2b5da..86855025 100755 --- a/bin/hooks/wget-i.py +++ b/bin/hooks/wget-i.py @@ -62,6 +62,9 @@ def do_stuff(inf): log = inf["log"] url = inf["txt"] + if url.startswith("upload-queue-empty;"): + return + if "://" not in url: url = "https://" + url diff --git a/bin/hooks/wget.py b/bin/hooks/wget.py index 1f5a824b..ab42226a 100755 --- a/bin/hooks/wget.py +++ b/bin/hooks/wget.py @@ -47,6 +47,9 @@ while you're in the /inc folder (or any folder below there) def main(): inf = json.loads(sys.argv[1]) url = inf["txt"] + if url.startswith("upload-queue-empty;"): + return + if "://" not in url: url = "https://" + url