mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2025-12-06 06:45:00 +01:00
[cookies] Move YoutubeDLCookieJar to cookies module (#7091)
Authored by: coletdjnz
This commit is contained in:
parent
08916a49c7
commit
b87e01c123
6 changed files with 157 additions and 137 deletions
|
|
@ -2404,7 +2404,7 @@ class YoutubeDL:
|
|||
if 'Youtubedl-No-Compression' in res: # deprecated
|
||||
res.pop('Youtubedl-No-Compression', None)
|
||||
res['Accept-Encoding'] = 'identity'
|
||||
cookies = self._calc_cookies(info_dict['url'])
|
||||
cookies = self.cookiejar.get_cookie_header(info_dict['url'])
|
||||
if cookies:
|
||||
res['Cookie'] = cookies
|
||||
|
||||
|
|
@ -2416,9 +2416,8 @@ class YoutubeDL:
|
|||
return res
|
||||
|
||||
def _calc_cookies(self, url):
|
||||
pr = sanitized_Request(url)
|
||||
self.cookiejar.add_cookie_header(pr)
|
||||
return pr.get_header('Cookie')
|
||||
self.deprecation_warning('"YoutubeDL._calc_cookies" is deprecated and may be removed in a future version')
|
||||
return self.cookiejar.get_cookie_header(url)
|
||||
|
||||
def _sort_thumbnails(self, thumbnails):
|
||||
thumbnails.sort(key=lambda t: (
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue