From 07218e6cab5012d9abf9a188a0369585142006ef Mon Sep 17 00:00:00 2001 From: be7a Date: Fri, 23 Apr 2021 22:07:30 +0200 Subject: [PATCH] remove false help text and fix httpx auth --- PFERD/downloaders.py | 8 ++------ PFERD/pferd.py | 6 ++---- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/PFERD/downloaders.py b/PFERD/downloaders.py index f004450..ffa47fb 100644 --- a/PFERD/downloaders.py +++ b/PFERD/downloaders.py @@ -6,7 +6,6 @@ from dataclasses import dataclass, field from typing import Any, Dict, List, Optional import httpx -import httpx.auth from .organizer import Organizer from .tmp_dir import TmpDir @@ -42,12 +41,9 @@ class HttpDownloader: self._client = self._build_client() def _build_client(self) -> httpx.Client: - client = httpx.Client() if self._username and self._password: - client.auth = httpx.auth.HTTPBasicAuth( - self._username, self._password - ) - return client + return httpx.Client(auth=(self._username, self._password)) + return httpx.Client() def download_all(self, infos: List[HttpDownloadInfo]) -> None: """ diff --git a/PFERD/pferd.py b/PFERD/pferd.py index 339cc1b..40a74fd 100644 --- a/PFERD/pferd.py +++ b/PFERD/pferd.py @@ -156,8 +156,7 @@ class Pferd(Location): be downloaded. Can save bandwidth and reduce the number of httpx. (default: {download_modified_or_new}) clean {bool} -- Whether to clean up when the method finishes. - timeout {int} -- The download timeout for opencast videos. Sadly needed due to a - httpx bug. + timeout {int} -- The download timeout for opencast videos. file_conflict_resolver {FileConflictResolver} -- A function specifying how to deal with overwriting or deleting files. The default always asks the user. """ @@ -290,8 +289,7 @@ class Pferd(Location): be downloaded. Can save bandwidth and reduce the number of httpx. (default: {download_modified_or_new}) clean {bool} -- Whether to clean up when the method finishes. - timeout {int} -- The download timeout for opencast videos. Sadly needed due to a - httpx bug. + timeout {int} -- The download timeout for opencast videos. file_conflict_resolver {FileConflictResolver} -- A function specifying how to deal with overwriting or deleting files. The default always asks the user. """