From b9b34b70d2d53f83c541ad3e3a55f269e0c76f4e Mon Sep 17 00:00:00 2001 From: phan-ctrl <54398886+phan-ctrl@users.noreply.github.com> Date: Thu, 22 Aug 2019 17:19:55 +0700 Subject: [PATCH] [safari] Fix authentication Fix issue #22161 --- youtube_dl/extractor/safari.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/youtube_dl/extractor/safari.py b/youtube_dl/extractor/safari.py index 8d4806794..8c97d1aa2 100644 --- a/youtube_dl/extractor/safari.py +++ b/youtube_dl/extractor/safari.py @@ -71,6 +71,10 @@ class SafariBaseIE(InfoExtractor): # oreilly serves two same groot_sessionid cookies in Set-Cookie header # and expects first one to be actually set self._apply_first_set_cookie_header(urlh, 'groot_sessionid') + # Fix issue #22161 + # We need 2 more cookies to be able to login to oreilly + self._apply_first_set_cookie_header(urlh, 'orm-jwt') + self._apply_first_set_cookie_header(urlh, 'orm-rt') _, urlh = self._download_webpage_handle( auth.get('redirect_uri') or next_uri, None, 'Completing login',)