Skip to content

Commit

Permalink
Add ability to specify password in arg
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Luu <[email protected]>
  • Loading branch information
RyanLua committed Jan 13, 2025
1 parent a6b8b76 commit 3312e50
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
7 changes: 5 additions & 2 deletions src/instawebhooks/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,13 @@
else:
logger.setLevel(logging.INFO)

if args.login:
if args.login or args.interactive_login:
logger.info("Logging into Instagram...")
try:
Instaloader().interactive_login(args.login)
if args.login:
Instaloader().login(*args.login)
if args.interactive_login:
Instaloader().interactive_login(args.interactive_login)
except LoginException as login_exc:
logger.critical("instaloader: error: %s", login_exc)
raise SystemExit(
Expand Down
10 changes: 9 additions & 1 deletion src/instawebhooks/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,17 @@ def closure_check_regex(arg_value: str):
parser.add_argument(
"-l",
"--login",
metavar=("USERNAME", "PASSWORD"),
type=str,
help="login to instagram with username and password",
nargs=2,
)
parser.add_argument(
"-t",
"--interactive-login",
metavar="USERNAME",
type=str,
help="login to instagram with username",
help="login to instagram with username and ask for password on terminal",
)
parser.add_argument(
"-p",
Expand Down

0 comments on commit 3312e50

Please sign in to comment.