From f1b0c2bf5cf263a6f6abc6e42baedd45990b6435 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Wed, 26 Jun 2019 19:32:07 +0200 Subject: [PATCH] [downloader:ytdl] forward cookies to youtube-dl to be able to download private videos from Twitter, Instagram, etc. --- gallery_dl/downloader/ytdl.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gallery_dl/downloader/ytdl.py b/gallery_dl/downloader/ytdl.py index 8a69298e..7866f301 100644 --- a/gallery_dl/downloader/ytdl.py +++ b/gallery_dl/downloader/ytdl.py @@ -37,6 +37,9 @@ class YoutubeDLDownloader(DownloaderBase): self.ytdl = YoutubeDL(options) def download(self, url, pathfmt): + for cookie in self.session.cookies: + self.ytdl.cookiejar.set_cookie(cookie) + try: info_dict = self.ytdl.extract_info(url[5:], download=False) except Exception: