1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2025-09-03 00:25:08 +00:00

[compat] Add functools.cached_property

This commit is contained in:
pukkandan
2022-05-20 20:55:21 +05:30
parent 666c36d58d
commit 2762dbb17e
5 changed files with 21 additions and 7 deletions

View File

@ -11,6 +11,7 @@ import sys
import time
import xml.etree.ElementTree
from ..compat import functools, re
from ..compat import (
compat_cookiejar_Cookie,
compat_cookies_SimpleCookie,
@ -25,7 +26,6 @@ from ..compat import (
compat_urllib_parse_urlencode,
compat_urllib_request,
compat_urlparse,
re,
)
from ..downloader import FileDownloader
from ..downloader.f4m import get_base_url, remove_encrypted_media
@ -3748,7 +3748,7 @@ class InfoExtractor:
def _get_automatic_captions(self, *args, **kwargs):
raise NotImplementedError('This method must be implemented by subclasses')
@property
@functools.cached_property
def _cookies_passed(self):
"""Whether cookies have been passed to YoutubeDL"""
return self.get_param('cookiefile') is not None or self.get_param('cookiesfrombrowser') is not None