From 1a8cc83735ed748afa78764af1e724afa646d8f9 Mon Sep 17 00:00:00 2001 From: pukkandan Date: Fri, 20 May 2022 20:55:21 +0530 Subject: [PATCH] Bugfix for 3a408f9d199127ca2626359e21a866a09ab236b3 --- yt_dlp/compat/functools.py | 2 ++ yt_dlp/downloader/common.py | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/yt_dlp/compat/functools.py b/yt_dlp/compat/functools.py index c3c4d8f48..ec003ea90 100644 --- a/yt_dlp/compat/functools.py +++ b/yt_dlp/compat/functools.py @@ -20,5 +20,7 @@ def __init__(self, func): self.func = func def __get__(self, instance, _): + if instance is None: + return self setattr(instance, self.func.__name__, self.func(instance)) return getattr(instance, self.func.__name__) diff --git a/yt_dlp/downloader/common.py b/yt_dlp/downloader/common.py index d74692130..93eb10f76 100644 --- a/yt_dlp/downloader/common.py +++ b/yt_dlp/downloader/common.py @@ -11,11 +11,11 @@ MultilinePrinter, QuietMultilinePrinter, ) -from ..compat import functools from ..utils import ( NUMBER_RE, LockingUnsupportedError, Namespace, + classproperty, decodeArgument, encodeFilename, error_to_compat_str, @@ -103,9 +103,9 @@ def to_screen(self, *args, **kargs): __to_screen = to_screen - @functools.cached_property - def FD_NAME(self): - return re.sub(r'(?