Skip to content

Commit

Permalink
fix(trakt/username): restrict to alphanumeric usernames
Browse files Browse the repository at this point in the history
addresses a bug that needs further investigation returning 405 when non-alphanumeric usernames are provided to trakt's api

#7
  • Loading branch information
zakkarry committed Jan 12, 2024
1 parent d568bc9 commit efcbeb3
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions retraktarr/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,19 @@ def __init__(self, config_file):
else:
try:
self.conf.read(config_file)
# checks for alphanumeric usernames
if (
bool(
re.compile(r"^[a-zA-Z0-9]+$").match(
self.conf.get("Trakt", "username")
)
)
is False
):
print(
"Error occurred while reading the configuration file:\nOnly alphanumeric usernames are supported currently."
)
sys.exit(1)
except configparser.Error as error:
print(f"Error occurred while reading the configuration file: {error}")
sys.exit(1)
Expand Down

0 comments on commit efcbeb3

Please sign in to comment.