Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import apprise
- import threading
- import schedule
- def SendNotification(serviceString, message):
- sleep(1.5)
- apobj = apprise.Apprise()
- apobj.add(serviceString)
- apobj.notify(body=message['body'], title=message['title'])
- sleep(5)
- def Get_Missing_List():
- pass
- def Download():
- global appriseServiceString
- if Done:
- SendNotification(appriseServiceString, {"body": f"body_text_here", "title": "title_here"})
- pass
- def Tasks():
- schedule.every(30).minutes.do(Get_Missing_List)
- schedule.every(59).minutes.do(Download)
- while True:
- schedule.run_pending()
- sleep(10)
- def Main():
- Tasker_thread = threading.Thread(target=Tasks, daemon=False)
- Tasker_thread.start()
- appriseServiceString = 'gotifys://ip_address_or_domain/token?priority=high' #or use env var in docker-compose then appriseServiceString = os.environ['APPRISE_SERVICE_STRING']
- Main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement