diff options
Diffstat (limited to 'gallery_dl/downloader')
| -rw-r--r-- | gallery_dl/downloader/http.py | 3 | ||||
| -rw-r--r-- | gallery_dl/downloader/ytdl.py | 22 |
2 files changed, 20 insertions, 5 deletions
diff --git a/gallery_dl/downloader/http.py b/gallery_dl/downloader/http.py index 4595483..111fd9b 100644 --- a/gallery_dl/downloader/http.py +++ b/gallery_dl/downloader/http.py @@ -432,6 +432,9 @@ class HttpDownloader(DownloaderBase): if not SIGNATURE_CHECKS[pathfmt.extension](file_header): for ext, check in SIGNATURE_CHECKS.items(): if check(file_header): + self.log.debug( + "Adjusting filename extension of '%s' to '%s'", + pathfmt.filename, ext) pathfmt.set_extension(ext) pathfmt.build_path() return True diff --git a/gallery_dl/downloader/ytdl.py b/gallery_dl/downloader/ytdl.py index 9659782..9ef8816 100644 --- a/gallery_dl/downloader/ytdl.py +++ b/gallery_dl/downloader/ytdl.py @@ -27,6 +27,7 @@ class YoutubeDLDownloader(DownloaderBase): "socket_timeout": self.config("timeout", extractor._timeout), "nocheckcertificate": not self.config("verify", extractor._verify), "proxy": self.proxies.get("http") if self.proxies else None, + "ignoreerrors": True, } self.ytdl_instance = None @@ -168,15 +169,26 @@ class YoutubeDLDownloader(DownloaderBase): return True def _download_playlist(self, ytdl_instance, pathfmt, info_dict): - pathfmt.set_extension("%(playlist_index)s.%(ext)s") - pathfmt.build_path() - self._set_outtmpl(ytdl_instance, pathfmt.realpath) + pathfmt.kwdict["extension"] = pathfmt.prefix + filename = pathfmt.build_filename(pathfmt.kwdict) + pathfmt.kwdict["extension"] = pathfmt.extension + path = pathfmt.realdirectory + filename + path = path.replace("%", "%%") + "%(playlist_index)s.%(ext)s" + self._set_outtmpl(ytdl_instance, path) + status = False for entry in info_dict["entries"]: + if not entry: + continue if self.rate_dyn is not None: ytdl_instance.params["ratelimit"] = self.rate_dyn() - ytdl_instance.process_info(entry) - return True + try: + ytdl_instance.process_info(entry) + status = True + except Exception as exc: + self.log.debug("", exc_info=exc) + self.log.error("%s: %s", exc.__class__.__name__, exc) + return status def _extract_info(self, ytdl, url): return ytdl.extract_info(url, download=False) |
