From 1e0343bba667ca47e7470e5d2d5aca84d832bf9a Mon Sep 17 00:00:00 2001 From: Lucas <24826124+Luro02@users.noreply.github.com> Date: Tue, 3 Nov 2020 13:38:33 +0100 Subject: [PATCH] sync_url: Add username and password args --- sync_url.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sync_url.py b/sync_url.py index 6629a18..e4c4c9a 100755 --- a/sync_url.py +++ b/sync_url.py @@ -40,6 +40,8 @@ def main() -> None: parser = argparse.ArgumentParser() parser.add_argument("--test-run", action="store_true") parser.add_argument('-c', '--cookies', nargs='?', default=None, help="File to store cookies in") + parser.add_argument('-u', '--username', nargs='?', default=None, help="Username for Ilias") + parser.add_argument('-p', '--password', nargs='?', default=None, help="Password for Ilias") parser.add_argument('--no-videos', nargs='?', default=None, help="Don't download videos") parser.add_argument('--local-first', action="store_true", help="Don't prompt for confirmation, keep existing files") @@ -55,7 +57,7 @@ def main() -> None: cookie_jar = CookieJar(to_path(args.cookies) if args.cookies else None) session = cookie_jar.create_session() - authenticator = KitShibbolethAuthenticator() + authenticator = KitShibbolethAuthenticator(username=args.username, password=args.password) crawler = IliasCrawler(url.scheme + '://' + url.netloc, session, authenticator, lambda x, y: True) @@ -98,6 +100,8 @@ def main() -> None: full_url=args.url, cookies=args.cookies, dir_filter=dir_filter, + username=args.username, + password=args.password, transform=sanitize_windows_path, file_conflict_resolver=file_confilict_resolver )