test
This commit is contained in:
parent
79e5409034
commit
1cf0b631df
@ -1,6 +1,7 @@
|
||||
#!/usr/bin/python
|
||||
|
||||
from sys import argv
|
||||
import os
|
||||
# from sys import argv
|
||||
|
||||
|
||||
# title = show title
|
||||
@ -14,6 +15,37 @@ from sys import argv
|
||||
# response = requests.post(tdarr_url, json=payload, headers=headers)
|
||||
|
||||
|
||||
fp = open('/opt/testlog.log', 'a', 0)
|
||||
fp.write("Testing")
|
||||
fp.write("%s" % argv)
|
||||
# fp = open('/opt/testlog.log', 'a', 0)
|
||||
# fp.write("Testing")
|
||||
# fp.write("%s" % argv)
|
||||
|
||||
|
||||
def main():
|
||||
SCRIPT_PATH = os.path.realpath(__file__)
|
||||
SCRIPT_DIR = os.path.dirname(SCRIPT_PATH)
|
||||
ENV_FILE = f"{SCRIPT_DIR}\\ARR_ENV.txt"
|
||||
|
||||
envs = {}
|
||||
|
||||
# Checking all potentiall environment variables
|
||||
with open(ENV_FILE, 'r') as f:
|
||||
for line in f:
|
||||
env = line.rstrip()
|
||||
if env in os.environ:
|
||||
envs[env] = os.environ[env]
|
||||
|
||||
# No environment variables were found
|
||||
# Either the script was run manually as a test (ie Not ran by *arr)
|
||||
# or, something went wrong : )
|
||||
if len(envs) == 0:
|
||||
raise Exception('No *arr Environment variables were found.')
|
||||
|
||||
# envs is now a dictionary containing any *arr variables found
|
||||
# Call your own script here, or do what you want with the environment variables found
|
||||
# Information on what these variables could be can be found at:
|
||||
# https://github.com/Radarr/Radarr/wiki/Custom-Post-Processing-Scripts
|
||||
# https://github.com/Sonarr/Sonarr/wiki/Custom-Post-Processing-Scripts
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user