Skip to content

Commit

Permalink
Add keyring support
Browse files Browse the repository at this point in the history
  • Loading branch information
rappdw committed Jan 30, 2022
1 parent bd2058a commit a831218
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 5 additions & 1 deletion fscrawler/crawler.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import time
import argparse
import getpass
import keyring

from collections import defaultdict
from pathlib import Path
Expand Down Expand Up @@ -129,7 +130,10 @@ def main():
sys.exit("Invalid FamilySearch ID: " + fid)

args.username = args.username if args.username else input("Enter FamilySearch username: ")
args.password = args.password if args.password else getpass.getpass("Enter FamilySearch password: ")
if not args.password:
args.password = keyring.get_password("fs-crawler", args.username)
if not args.password:
args.password = getpass.getpass("Enter FamilySearch password: ")

out_dir = Path(args.outdir)
basename = args.basename
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
platforms=["Windows", "Linux", "Mac OS-X"],
install_requires=[
'httpx',
'keyring',
'tqdm',
'iteration_utilities'
],
Expand Down

0 comments on commit a831218

Please sign in to comment.