mirror of
https://github.com/Garmelon/PFERD.git
synced 2026-04-13 07:55:05 +02:00
sync_url: Add username and password args
This commit is contained in:
parent
9ea03bda3e
commit
dcea7b2254
1 changed files with 6 additions and 2 deletions
|
|
@ -19,6 +19,8 @@ def main() -> None:
|
||||||
parser = argparse.ArgumentParser()
|
parser = argparse.ArgumentParser()
|
||||||
parser.add_argument("--test-run", action="store_true")
|
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('-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('--no-videos', nargs='?', default=None, help="Don't download videos")
|
||||||
parser.add_argument('url', help="URL to the course page")
|
parser.add_argument('url', help="URL to the course page")
|
||||||
parser.add_argument('folder', nargs='?', default=None, help="Folder to put stuff into")
|
parser.add_argument('folder', nargs='?', default=None, help="Folder to put stuff into")
|
||||||
|
|
@ -28,7 +30,7 @@ def main() -> None:
|
||||||
|
|
||||||
cookie_jar = CookieJar(to_path(args.cookies) if args.cookies else None)
|
cookie_jar = CookieJar(to_path(args.cookies) if args.cookies else None)
|
||||||
session = cookie_jar.create_session()
|
session = cookie_jar.create_session()
|
||||||
authenticator = KitShibbolethAuthenticator()
|
authenticator = KitShibbolethAuthenticator(username=args.username, password=args.password)
|
||||||
crawler = IliasCrawler(url.scheme + '://' + url.netloc, session,
|
crawler = IliasCrawler(url.scheme + '://' + url.netloc, session,
|
||||||
authenticator, lambda x, y: True)
|
authenticator, lambda x, y: True)
|
||||||
|
|
||||||
|
|
@ -59,7 +61,9 @@ def main() -> None:
|
||||||
target=folder,
|
target=folder,
|
||||||
full_url=args.url,
|
full_url=args.url,
|
||||||
cookies=args.cookies,
|
cookies=args.cookies,
|
||||||
dir_filter=dir_filter
|
dir_filter=dir_filter,
|
||||||
|
username=args.username,
|
||||||
|
password=args.password
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue