Skip to content

Commit

Permalink
Fix: set nzbget version from env
Browse files Browse the repository at this point in the history
  • Loading branch information
dnzbk committed Mar 11, 2024
1 parent b4e3f38 commit 4cbe49d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions NotifyPlex.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,12 @@
POSTPROCESS_ERROR = 94
POSTPROCESS_NONE = 95

def get_auth_token(username, password):
def get_auth_token(username, password, nzbget_version):
auth_url = 'https://my.plexapp.com/users/sign_in.xml'
auth_params = {'user[login]': username, 'user[password]': password}
headers = {
'X-Plex-Platform': 'NZBGet',
'X-Plex-Platform-Version': '21.0',
'X-Plex-Platform-Version': nzbget_version,
'X-Plex-Provides': 'controller',
'X-Plex-Product': 'NotifyPlex',
'X-Plex-Version': '2.1.3',
Expand Down Expand Up @@ -230,7 +230,7 @@ def refresh_sections(plex_sections, auth_token):

plex_username = os.environ['NZBPO_PLEXUSER']
plex_password = os.environ['NZBPO_PLEXPASSWORD']
plex_auth_token = get_auth_token(plex_username, plex_password)
plex_auth_token = get_auth_token(plex_username, plex_password, NZBGetVersion)

if plex_auth_token is not None:
print('[INFO] Authorization to Plex.tv successful.')
Expand Down

0 comments on commit 4cbe49d

Please sign in to comment.