remove false help text and fix httpx auth

This commit is contained in:
be7a 2021-04-23 22:07:30 +02:00
parent 411d4b91d5
commit 07218e6cab
No known key found for this signature in database
GPG key ID: 6510870A77F49A99
2 changed files with 4 additions and 10 deletions

View file

@ -6,7 +6,6 @@ from dataclasses import dataclass, field
from typing import Any, Dict, List, Optional from typing import Any, Dict, List, Optional
import httpx import httpx
import httpx.auth
from .organizer import Organizer from .organizer import Organizer
from .tmp_dir import TmpDir from .tmp_dir import TmpDir
@ -42,12 +41,9 @@ class HttpDownloader:
self._client = self._build_client() self._client = self._build_client()
def _build_client(self) -> httpx.Client: def _build_client(self) -> httpx.Client:
client = httpx.Client()
if self._username and self._password: if self._username and self._password:
client.auth = httpx.auth.HTTPBasicAuth( return httpx.Client(auth=(self._username, self._password))
self._username, self._password return httpx.Client()
)
return client
def download_all(self, infos: List[HttpDownloadInfo]) -> None: def download_all(self, infos: List[HttpDownloadInfo]) -> None:
""" """

View file

@ -156,8 +156,7 @@ class Pferd(Location):
be downloaded. Can save bandwidth and reduce the number of httpx. be downloaded. Can save bandwidth and reduce the number of httpx.
(default: {download_modified_or_new}) (default: {download_modified_or_new})
clean {bool} -- Whether to clean up when the method finishes. clean {bool} -- Whether to clean up when the method finishes.
timeout {int} -- The download timeout for opencast videos. Sadly needed due to a timeout {int} -- The download timeout for opencast videos.
httpx bug.
file_conflict_resolver {FileConflictResolver} -- A function specifying how to deal file_conflict_resolver {FileConflictResolver} -- A function specifying how to deal
with overwriting or deleting files. The default always asks the user. 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. be downloaded. Can save bandwidth and reduce the number of httpx.
(default: {download_modified_or_new}) (default: {download_modified_or_new})
clean {bool} -- Whether to clean up when the method finishes. clean {bool} -- Whether to clean up when the method finishes.
timeout {int} -- The download timeout for opencast videos. Sadly needed due to a timeout {int} -- The download timeout for opencast videos.
httpx bug.
file_conflict_resolver {FileConflictResolver} -- A function specifying how to deal file_conflict_resolver {FileConflictResolver} -- A function specifying how to deal
with overwriting or deleting files. The default always asks the user. with overwriting or deleting files. The default always asks the user.
""" """