INNER CODE UNIT · Python

get_login_info

wkaisertexas/tiktok-uploader · src/tiktok_uploader/cli.py:175

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")

        user, password = split_string

        return user, password

    with open(path, encoding="utf-8") as file:
        parsed_file = file.readlines()
        if header:
            parsed_file = parsed_file[1:]

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…