Skip to content

Commit e071e8d

Browse files
committed
chore: enable local dev via env variables
Allows specifying trakt client ID and secret via environment variables.
1 parent 9ff1520 commit e071e8d

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

resources/lib/traktapi.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# -*- coding: utf-8 -*-
22
#
33
import logging
4+
import os
45
import time
56
from json import dumps, loads
67

@@ -44,9 +45,16 @@ def __init__(self, force=False):
4445
Trakt.http.proxies = {"http": proxyURL, "https": proxyURL}
4546

4647
# Configure
48+
client_id = os.environ.get("TRAKT_CLIENT_ID")
49+
client_secret = os.environ.get("TRAKT_CLIENT_SECRET")
50+
51+
if not client_id or not client_secret:
52+
client_id = deobfuscate(self.__client_id)
53+
client_secret = deobfuscate(self.__client_secret)
54+
4755
Trakt.configuration.defaults.client(
48-
id=deobfuscate(self.__client_id),
49-
secret=deobfuscate(self.__client_secret),
56+
id=client_id,
57+
secret=client_secret,
5058
)
5159

5260
# Bind event

0 commit comments

Comments
 (0)