mirror of
https://github.com/Garmelon/PFERD.git
synced 2023-12-21 10:23:01 +01:00
Add example config that synchronizes the personal desktop
This commit is contained in:
parent
03a801eecc
commit
36c8785f15
35
example_config_personal_desktop.py
Normal file
35
example_config_personal_desktop.py
Normal file
@ -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()
|
Loading…
Reference in New Issue
Block a user