forked from NussNougate/arr-mastodon
Changed env Varriables
This commit is contained in:
parent
0cb2307967
commit
ad0ef39a47
@ -3,6 +3,7 @@
|
|||||||
# https://wiki.servarr.com/en/sonarr/custom-scripts
|
# https://wiki.servarr.com/en/sonarr/custom-scripts
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
from os import environ
|
||||||
import configparser
|
import configparser
|
||||||
import requests
|
import requests
|
||||||
|
|
||||||
@ -33,15 +34,17 @@ if os.getenv('radarr_eventtype'):
|
|||||||
if os.getenv('sonarr_eventtype'):
|
if os.getenv('sonarr_eventtype'):
|
||||||
if os.getenv('sonarr_eventtype') == 'Download':
|
if os.getenv('sonarr_eventtype') == 'Download':
|
||||||
body = "New content added to Jellyfin: \n"
|
body = "New content added to Jellyfin: \n"
|
||||||
body += 'Series: ' + os.getenv('sonarr_series_title') + '\n'
|
|
||||||
body += 'Season: ' + os.getenv('sonarr_episodefile_seasonnumber') + '\n'
|
series_title = environ.get('Sonarr_Series_Title')
|
||||||
if os.getenv('sonarr_release_absoluteepisodenumbers'):
|
season_number = environ.get('Sonarr_EpisodeFile_SeasonNumber')
|
||||||
body += 'Season: ' + os.getenv('sonarr_release_absoluteepisodenumbers') + '\n'
|
episode_number = environ.get('Sonarr_EpisodeFile_EpisodeNumbers')
|
||||||
elif os.getenv('sonarr_release_episodenumbers'):
|
episode_title = environ.get('Sonarr_EpisodeFile_EpisodeTitles')
|
||||||
body += 'Episode: ' + os.getenv('sonarr_release_episodenumbers') + '\n'
|
release_quality = environ.get('Sonarr_EpisodeFile_Quality')
|
||||||
|
body += "%s - S%sE%s - %s [%s]\n" % (series_title, season_number, episode_number, episode_title, release_quality)
|
||||||
|
|
||||||
|
|
||||||
toot(server_url, body, server_token)
|
toot(server_url, body, server_token)
|
||||||
|
|
||||||
|
|
||||||
if os.getenv('sonarr_eventtype') == 'Test':
|
if os.getenv('sonarr_eventtype') == 'Test':
|
||||||
toot(server_url, "Test message", server_token)
|
toot(server_url, "Test message", server_token)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user