1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2025-10-31 14:45:14 +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

@@ -2,7 +2,6 @@ import base64
import calendar
import copy
import datetime
import functools
import hashlib
import itertools
import json
@@ -16,6 +15,7 @@ import time
import traceback
from .common import InfoExtractor, SearchInfoExtractor
from ..compat import functools
from ..compat import (
compat_chr,
compat_HTTPError,
@@ -534,7 +534,7 @@ class YoutubeBaseInfoExtractor(InfoExtractor):
args, [('VISITOR_DATA', ('INNERTUBE_CONTEXT', 'client', 'visitorData'), ('responseContext', 'visitorData'))],
expected_type=str)
@property
@functools.cached_property
def is_authenticated(self):
return bool(self._generate_sapisidhash_header())
@@ -4402,7 +4402,7 @@ class YoutubeTabBaseInfoExtractor(YoutubeBaseInfoExtractor):
check_get_keys='contents', fatal=False, ytcfg=ytcfg,
note='Downloading API JSON with unavailable videos')
@property
@functools.cached_property
def skip_webpage(self):
return 'webpage' in self._configuration_arg('skip', ie_key=YoutubeTabIE.ie_key())