From 36c8785f1536c8d381abc58113f307ab3607bb69 Mon Sep 17 00:00:00 2001 From: I-Al-Istannen Date: Fri, 15 May 2020 11:02:13 +0200 Subject: [PATCH] Add example config that synchronizes the personal desktop --- example_config_personal_desktop.py | 35 ++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 example_config_personal_desktop.py diff --git a/example_config_personal_desktop.py b/example_config_personal_desktop.py new file mode 100644 index 0000000..dc5e68e --- /dev/null +++ b/example_config_personal_desktop.py @@ -0,0 +1,35 @@ +""" +This is a small config that just crawls the ILIAS Personal Desktop. +It does not filter or rename anything, it just gobbles up everything it can find. + +Note that this still includes a test-run switch, so you can see what it *would* download. +You can enable that with the "--test-run" command line switch, +i. e. "python3 example_config_minimal.py --test-run". +""" + +import argparse +from pathlib import Path + +from PFERD import Pferd + + +def main() -> None: + # Parse command line arguments + parser = argparse.ArgumentParser() + parser.add_argument("--test-run", action="store_true") + args = parser.parse_args() + + # Create the Pferd helper instance + pferd = Pferd(Path(__file__).parent, test_run=args.test_run) + pferd.enable_logging() + + # Synchronize the personal desktop into the "ILIAS" directory. + # It saves the cookies, so you only need to log in again when the ILIAS cookies expire. + pferd.ilias_kit_personal_desktop( + "ILIAS", + cookies="ilias_cookies.txt", + ) + + +if __name__ == "__main__": + main()