INNER CODE UNIT · Python
validate_auth_args
wkaisertexas/tiktok-uploader · src/tiktok_uploader/cli.py:166
def validate_auth_args(args: Namespace) -> None:
"""
Preforms validation on each input given
"""
# username and password or input files are mutually exclusive
if args.username and args.password and args.input:
raise ValueError("You can not pass in both username / password and input file")
def get_login_info(path: str, header: bool = True) -> list[tuple[str, str]]:
"""
Parses the input file into a list of usernames and passwords
"""
def extract_username_and_pass(input_str: str) -> tuple[str, str]:
split_string = input_str.strip().split(",")
if len(split_string) != 2:
raise ValueError(f"{input_str} not valid")