diff options
author | Parker <contact@pkrm.dev> | 2024-07-20 00:22:01 -0500 |
---|---|---|
committer | Parker <contact@pkrm.dev> | 2024-07-20 00:22:01 -0500 |
commit | bbf348c1dcbb25b8f0ecc048ed9831fd21380593 (patch) | |
tree | eb51f8e150943a76e51ba8ca2bd8e1fc73f5386c /code/func | |
parent | bb77e85dedebf2a6e3656d4416b29f2d8cf9e2e5 (diff) |
Add ability to have simple passwords
Diffstat (limited to 'code/func')
-rw-r--r-- | code/func/jellyfin.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/code/func/jellyfin.py b/code/func/jellyfin.py index 19f1e9a..f31ec04 100644 --- a/code/func/jellyfin.py +++ b/code/func/jellyfin.py @@ -5,7 +5,7 @@ import string import sqlite3 from wonderwords import RandomWord -from global_variables import JELLYFIN_URL, JELLYFIN_HEADERS, ACCOUNT_TIME +from global_variables import JELLYFIN_URL, JELLYFIN_HEADERS, ACCOUNT_TIME, SIMPLE_PASSWORDS """ Create a new Jellyfin account for the user and return the username and password @@ -14,7 +14,10 @@ Create a new Jellyfin account for the user and return the username and password def create_jellyfin_account(user_id): username = RandomWord().word(word_min_length=5, word_max_length=5) - password = "".join(random.choices(string.ascii_lowercase + string.digits, k=15)) + if SIMPLE_PASSWORDS: + password = RandomWord().word(word_min_length=5, word_max_length=10) + else: + password = "".join(random.choices(string.ascii_lowercase + string.digits, k=15)) deletion_time = datetime.datetime.now() + datetime.timedelta(hours=ACCOUNT_TIME) # Create the new Jellyfin account |