mirror of
https://github.com/Garmelon/PFERD.git
synced 2023-12-21 10:23:01 +01:00
Somewhat elaborate example_config
This commit is contained in:
parent
980f69b5af
commit
ca8fcf7a1d
@ -1,13 +1,33 @@
|
|||||||
|
"""
|
||||||
|
A small sample config for PFERD.
|
||||||
|
"""
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
from PFERD import Pferd, enable_logging
|
from PFERD import Pferd, enable_logging
|
||||||
|
from PFERD.ilias.download_strategies import (download_everything,
|
||||||
|
download_modified_or_new)
|
||||||
|
|
||||||
|
|
||||||
def main() -> None:
|
def main() -> None:
|
||||||
enable_logging()
|
enable_logging()
|
||||||
pferd = Pferd(Path(__file__).parent)
|
pferd = Pferd(Path(__file__).parent)
|
||||||
|
|
||||||
pferd.ilias_kit(Path("DB"), "1101554", cookies=Path("ilias_cookies.txt"))
|
# Synchronize "databases" and only download files with a more recent timestamp than
|
||||||
|
# the local copy, if any exists.
|
||||||
|
pferd.ilias_kit(
|
||||||
|
Path("DB"),
|
||||||
|
"1101554",
|
||||||
|
cookies=Path("ilias_cookies.txt"),
|
||||||
|
download_strategy=download_modified_or_new
|
||||||
|
)
|
||||||
|
|
||||||
|
# Synchronize "databases" and redownload every file (default).
|
||||||
|
pferd.ilias_kit(
|
||||||
|
Path("DB"),
|
||||||
|
"1101554",
|
||||||
|
cookies=Path("ilias_cookies.txt"),
|
||||||
|
download_strategy=download_everything
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
Loading…
Reference in New Issue
Block a user