aboutsummaryrefslogtreecommitdiffstats
path: root/yt_dlp/YoutubeDL.py
diff options
context:
space:
mode:
authorpukkandan <pukkandan.ytdlp@gmail.com>2022-04-12 05:31:54 +0530
committerpukkandan <pukkandan.ytdlp@gmail.com>2022-04-12 05:32:52 +0530
commite5a998f3684e7c56f9cf1c07c4e176e891d96509 (patch)
tree2db9c362fc168889debe84903a5e4dbabdb742cf /yt_dlp/YoutubeDL.py
parentf82711587cee043cb2496fe180b5cc0e07c06eda (diff)
downloadhypervideo-pre-e5a998f3684e7c56f9cf1c07c4e176e891d96509.tar.lz
hypervideo-pre-e5a998f3684e7c56f9cf1c07c4e176e891d96509.tar.xz
hypervideo-pre-e5a998f3684e7c56f9cf1c07c4e176e891d96509.zip
[cleanup] Misc cleanup (#2173)
Authored by: fstirlitz, pukkandan
Diffstat (limited to 'yt_dlp/YoutubeDL.py')
-rw-r--r--yt_dlp/YoutubeDL.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/yt_dlp/YoutubeDL.py b/yt_dlp/YoutubeDL.py
index a8bb7f45c..eaf2d9216 100644
--- a/yt_dlp/YoutubeDL.py
+++ b/yt_dlp/YoutubeDL.py
@@ -888,6 +888,7 @@ class YoutubeDL:
SUPPRESS = 'light black'
def _format_text(self, handle, allow_colors, text, f, fallback=None, *, test_encoding=False):
+ text = str(text)
if test_encoding:
original_text = text
# handle.encoding can be None. See https://github.com/yt-dlp/yt-dlp/issues/2711
@@ -895,7 +896,7 @@ class YoutubeDL:
text = text.encode(encoding, 'ignore').decode(encoding)
if fallback is not None and text != original_text:
text = fallback
- if isinstance(f, self.Styles):
+ if isinstance(f, Enum):
f = f.value
return format_text(text, f) if allow_colors else text if fallback is None else fallback
@@ -1708,6 +1709,7 @@ class YoutubeDL:
entries.append(entry)
try:
if entry is not None:
+ # TODO: Add auto-generated fields
self._match_entry(entry, incomplete=True, silent=True)
except (ExistingVideoReached, RejectedVideoReached):
broken = True