INNER CODE UNIT · Python
validate_uploader_args
wkaisertexas/tiktok-uploader · src/tiktok_uploader/cli.py:108
def validate_uploader_args(args: Namespace) -> None:
"""
Preforms validation on each input given
"""
# Makes sure the video file exists
if not exists(args.video):
raise FileNotFoundError(f"Could not find the video file at {args.video}")
# Makes sure the optional cover image file exists
if args.cover and not exists(args.cover):
raise FileNotFoundError(f"Could not find the cover image file at {args.cover}")
# User can not pass in both cookies and username / password
if args.cookies and (args.username or args.password):
raise ValueError("You can not pass in both cookies and username / password")