trakt username is given by trakt api, no user input needed
DELETE
.env_example
-PLEX_TOKEN=12345
-TRAKT_USERNAME=User
\ No newline at end of file

MODIFY
get_env_data.py
get_env_data.py
from os import path
import trakt
import trakt.core
+import trakt.users
trakt.core.CONFIG_PATH = path.join(path.dirname(path.abspath(__file__)), ".pytrakt.json")
env_file = path.join(path.dirname(path.abspath(__file__)), ".env")
txt.write("PLEX_TOKEN=-\n")
trakt.core.AUTH_METHOD=trakt.core.DEVICE_AUTH
-trakt_user = input("Please input your Trakt username: ")
+print("Trakt configuration:")
client_id, client_secret = trakt.core._get_client_info()
trakt.init(client_id=client_id, client_secret=client_secret, store=True)
+trakt_user = trakt.users.User('me')
with open(env_file, "a") as txt:
- txt.write("TRAKT_USERNAME=" + trakt_user + "\n")
+ txt.write("TRAKT_USERNAME=" + trakt_user.name + "\n")
print("You are now logged into Trakt. Your Trakt credentials have been added in .env and .pytrakt.json files.")
print("You can enjoy sync! \nCheck config.json to adjust settings.")
print("If you want to change Plex or Trakt account, just edit or remove .env and .pytrakt.json files.")
\ No newline at end of file

MODIFY
main.py
main.py
@@ -267,7 +267,7 @@ def main():
logging.info(start_msg)
with requests_cache.disabled():
try:
- trakt_user = trakt.users.User(getenv('TRAKT_USERNAME'))
+ trakt_user = trakt.users.User('me')
except trakt.errors.OAuthException as e:
m = "Trakt authentication error: {}".format(str(e))
logging.info(m)

trakt username is given by trakt api, no user input needed