diff options
| author | 2023-03-13 02:07:49 -0400 | |
|---|---|---|
| committer | 2023-03-13 02:07:49 -0400 | |
| commit | 10987f08f8b6c510ba64f4b42d95ba67eec6e5b0 (patch) | |
| tree | 1af82cad9ac859a70cafc976a980280b939cfcc7 /gallery_dl/downloader | |
| parent | 919f8ba16a7b82ba1099bd25b2c61c7881a05aa2 (diff) | |
New upstream version 1.25.0.upstream/1.25.0
Diffstat (limited to 'gallery_dl/downloader')
| -rw-r--r-- | gallery_dl/downloader/http.py | 17 | ||||
| -rw-r--r-- | gallery_dl/downloader/ytdl.py | 2 |
2 files changed, 8 insertions, 11 deletions
diff --git a/gallery_dl/downloader/http.py b/gallery_dl/downloader/http.py index 6043443..e977320 100644 --- a/gallery_dl/downloader/http.py +++ b/gallery_dl/downloader/http.py @@ -100,13 +100,6 @@ class HttpDownloader(DownloaderBase): adjust_extension = kwdict.get( "_http_adjust_extension", self.adjust_extension) - codes = kwdict.get("_http_retry_codes") - if codes: - retry_codes = list(self.retry_codes) - retry_codes += codes - else: - retry_codes = self.retry_codes - if self.part and not metadata: pathfmt.part_enable(self.partdir) @@ -167,7 +160,10 @@ class HttpDownloader(DownloaderBase): break else: msg = "'{} {}' for '{}'".format(code, response.reason, url) - if code in retry_codes or 500 <= code < 600: + if code in self.retry_codes or 500 <= code < 600: + continue + retry = kwdict.get("_http_retry") + if retry and retry(response): continue self.log.warning(msg) return False @@ -296,11 +292,10 @@ class HttpDownloader(DownloaderBase): progress = self.progress bytes_downloaded = 0 - time_start = time.time() + time_start = time.monotonic() for data in content: - time_current = time.time() - time_elapsed = time_current - time_start + time_elapsed = time.monotonic() - time_start bytes_downloaded += len(data) write(data) diff --git a/gallery_dl/downloader/ytdl.py b/gallery_dl/downloader/ytdl.py index c44ea0a..adada75 100644 --- a/gallery_dl/downloader/ytdl.py +++ b/gallery_dl/downloader/ytdl.py @@ -64,6 +64,8 @@ class YoutubeDLDownloader(DownloaderBase): try: info_dict = ytdl_instance.extract_info(url[5:], download=False) except Exception: + pass + if not info_dict: return False if "entries" in info_dict: |
