test
This commit is contained in:
parent
2d4a620626
commit
c58e6b9223
39
env_radarr
Normal file
39
env_radarr
Normal file
@ -0,0 +1,39 @@
|
||||
SONARR_DELETEDPATHS
|
||||
SONARR_DELETEDRELATIVEPATHS
|
||||
SONARR_DOWNLOAD_ID
|
||||
SONARR_EPISODEFILE_EPISODEAIRDATES
|
||||
SONARR_EPISODEFILE_EPISODEAIRDATESUTC
|
||||
SONARR_EPISODEFILE_EPISODECOUNT
|
||||
SONARR_EPISODEFILE_EPISODENUMBERS
|
||||
SONARR_EPISODEFILE_EPISODETITLES
|
||||
SONARR_EPISODEFILE_ID
|
||||
SONARR_EPISODEFILE_PATH
|
||||
SONARR_EPISODEFILE_QUALITY
|
||||
SONARR_EPISODEFILE_QUALITYVERSION
|
||||
SONARR_EPISODEFILE_RELATIVEPATH
|
||||
SONARR_EPISODEFILE_RELEASEGROUP
|
||||
SONARR_EPISODEFILE_SCENENAME
|
||||
SONARR_EPISODEFILE_SEASONNUMBER
|
||||
SONARR_EPISODEFILE_SOURCEFOLDER
|
||||
SONARR_EPISODEFILE_SOURCEPATH
|
||||
SONARR_EVENTTYPE
|
||||
SONARR_ISUPGRADE
|
||||
SONARR_RELEASE_EPISODEAIRDATES
|
||||
SONARR_RELEASE_EPISODEAIRDATESUTC
|
||||
SONARR_RELEASE_EPISODECOUNT
|
||||
SONARR_RELEASE_EPISODENUMBERS
|
||||
SONARR_RELEASE_EPISODETITLES
|
||||
SONARR_RELEASE_INDEXER
|
||||
SONARR_RELEASE_QUALITY
|
||||
SONARR_RELEASE_QUALITYVERSION
|
||||
SONARR_RELEASE_RELEASEGROUP
|
||||
SONARR_RELEASE_SEASONNUMBER
|
||||
SONARR_RELEASE_SIZE
|
||||
SONARR_RELEASE_TITLE
|
||||
SONARR_SERIES_ID
|
||||
SONARR_SERIES_IMDBID
|
||||
SONARR_SERIES_PATH
|
||||
SONARR_SERIES_TITLE
|
||||
SONARR_SERIES_TVDBID
|
||||
SONARR_SERIES_TVMAZEID
|
||||
SONARR_SERIES_TYPE
|
||||
24
env_sonarr
Normal file
24
env_sonarr
Normal file
@ -0,0 +1,24 @@
|
||||
RADARR_DOWNLOAD_CLIENT
|
||||
RADARR_DOWNLOAD_ID
|
||||
RADARR_EVENTTYPE
|
||||
RADARR_ISUPGRADE
|
||||
RADARR_MOVIE_ID
|
||||
RADARR_MOVIE_IMDBID
|
||||
RADARR_MOVIE_PATH
|
||||
RADARR_MOVIE_TITLE
|
||||
RADARR_MOVIE_TMDBID
|
||||
RADARR_MOVIEFILE_ID
|
||||
RADARR_MOVIEFILE_PATH
|
||||
RADARR_MOVIEFILE_QUALITY
|
||||
RADARR_MOVIEFILE_QUALITYVERSION
|
||||
RADARR_MOVIEFILE_RELATIVEPATH
|
||||
RADARR_MOVIEFILE_RELEASEGROUP
|
||||
RADARR_MOVIEFILE_SCENENAME
|
||||
RADARR_MOVIEFILE_SOURCEFOLDER
|
||||
RADARR_MOVIEFILE_SOURCEPATH
|
||||
RADARR_RELEASE_INDEXER
|
||||
RADARR_RELEASE_QUALITY
|
||||
RADARR_RELEASE_QUALITYVERSION
|
||||
RADARR_RELEASE_RELEASEGROUP
|
||||
RADARR_RELEASE_SIZE
|
||||
RADARR_RELEASE_TITLE
|
||||
@ -1,7 +1,7 @@
|
||||
#!/usr/bin/python3
|
||||
|
||||
import os
|
||||
from sys import argv
|
||||
# from sys import argv
|
||||
|
||||
"""
|
||||
# title = show title
|
||||
@ -44,34 +44,29 @@ def main():
|
||||
logwrite = open(log_file, 'a')
|
||||
|
||||
if "sonarr_eventtype" in os.environ:
|
||||
logwrite.write("Recieved Event from Sonarr")
|
||||
logwrite.write("Recieved Event from Sonarr\n")
|
||||
ENV_FILE = os.path.join(SCRIPT_DIR, "env_sonarr")
|
||||
elif "radarr_eventtype" in os.environ:
|
||||
logwrite.write("Recieved Event from Sonarr\n")
|
||||
ENV_FILE = os.path.join(SCRIPT_DIR, "env_radarr")
|
||||
|
||||
logwrite.write("argv %s\n" % argv)
|
||||
|
||||
logwrite.close()
|
||||
|
||||
# ENV_FILE = f"{SCRIPT_DIR}\\ARR_ENV.txt"
|
||||
|
||||
# envs = {}
|
||||
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]
|
||||
with open(ENV_FILE, 'r') as f:
|
||||
for line in f:
|
||||
env = line.rstrip()
|
||||
if env in os.environ:
|
||||
envs[env] = os.environ[env]
|
||||
logwrite.write("%s %s" % (env, envs[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.')
|
||||
# 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
|
||||
logwrite.close()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
Loading…
Reference in New Issue
Block a user