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
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:
"""

View file

@ -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.
"""