From b2a7af2e3eeeac2e6b003de29cce3b9109e39be4 Mon Sep 17 00:00:00 2001 From: I-Al-Istannen Date: Tue, 21 Apr 2020 13:31:50 +0200 Subject: [PATCH] Store modification_date in IliasDownloadInfo, remove parameters --- PFERD/ilias/downloader.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/PFERD/ilias/downloader.py b/PFERD/ilias/downloader.py index 42e62b5..b3b98d1 100644 --- a/PFERD/ilias/downloader.py +++ b/PFERD/ilias/downloader.py @@ -1,5 +1,6 @@ """Contains a downloader for ILIAS.""" +import datetime from dataclasses import dataclass, field from pathlib import Path from typing import Any, Dict, List @@ -25,7 +26,8 @@ class IliasDownloadInfo: path: Path url: str - parameters: Dict[str, Any] = field(default_factory=dict) + modification_date: datetime.datetime + # parameters: Dict[str, Any] = field(default_factory=dict) class IliasDownloader: @@ -61,7 +63,7 @@ class IliasDownloader: self._organizer.accept_file(tmp_file, info.path) def _try_download(self, info: IliasDownloadInfo, target: Path) -> bool: - with self._session.get(info.url, params=info.parameters, stream=True) as response: + with self._session.get(info.url, stream=True) as response: content_type = response.headers["content-type"] if content_type.startswith("text/html"):