Skip to content

Commit

Permalink
[ytdl] "fix" cookie transfer between session and ytdl (mikf#1680)
Browse files Browse the repository at this point in the history
requests' CookieJar class is not quite compatible with the standard
http.cookiejar.CookieJar used by youtube_dl
  • Loading branch information
mikf committed Jul 12, 2021
1 parent 9a849cd commit 193401c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion gallery_dl/extractor/ytdl.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,13 @@ def items(self):
del username, password

ytdl = ytdl_module.YoutubeDL()
ytdl.cookiejar = self.session.cookies

# transfer cookies to ytdl
cookies = self.session.cookies
if cookies:
set_cookie = self.ytdl.cookiejar.set_cookie
for cookie in self.session.cookies:
set_cookie(cookie)

# extract youtube_dl info_dict
info_dict = ytdl._YoutubeDL__extract_info(
Expand Down

0 comments on commit 193401c

Please sign in to comment.