diff --git a/docs/source/whats_new.rst b/docs/source/whats_new.rst index 1be4bcfe1..3f64aa209 100644 --- a/docs/source/whats_new.rst +++ b/docs/source/whats_new.rst @@ -61,6 +61,7 @@ Bugs - Fix :func:`moabb.paradigms.base.BaseParadigm` using attributes before defining them (PR :gh:`408`, issue :gh:`425` by `Pierre Guetschel`_) - Fix :func:`moabb.paradigms.FakeImageryParadigm`, :func:`moabb.paradigms.FakeP300Paradigm` and :func:`moabb.paradigms.FakeSSVEPParadigm` ``is_valid`` methods to only accept the correct datasets (PR :gh:`408` by `Pierre Guetschel`_) - Fix ``dataset_list`` construction, which could be empty due to bad import order (PR :gh:`449` by `Thomas Moreau`_). +- Fixing dataset downloader from servers with non-http (PR :gh:`433` by `Sara Sedlar`_) API changes ~~~~~~~~~~~ diff --git a/moabb/datasets/download.py b/moabb/datasets/download.py index f1b166b3f..4684a89fe 100644 --- a/moabb/datasets/download.py +++ b/moabb/datasets/download.py @@ -12,7 +12,8 @@ from mne import get_config, set_config from mne.datasets.utils import _get_path from mne.utils import _url_to_local_path, verbose -from pooch import HTTPDownloader, file_hash, retrieve +from pooch import file_hash, retrieve +from pooch.downloaders import choose_downloader from requests.exceptions import HTTPError @@ -139,7 +140,9 @@ def data_dl(url, sign, path=None, force_update=False, verbose=None): table = {ord(c): "-" for c in ':*?"<>|'} destination = Path(str(path) + destination.split(str(path))[1].translate(table)) - downloader = HTTPDownloader(verify=False) + downloader = choose_downloader(url, progressbar=True) + if type(downloader).__name__ in ["HTTPDownloader", "DOIDownloader"]: + downloader.kwargs.setdefault("verify", False) # Fetch the file if not destination.is_file() or force_update: