From 4891480197f26d9bce96d5c6583d67f356bfdf48 Mon Sep 17 00:00:00 2001 From: dirkf Date: Tue, 9 May 2023 16:50:35 +0100 Subject: [PATCH] Update youtube_dl/extractor/tvp.py Add `txt_or_none()` shim --- youtube_dl/extractor/tvp.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/youtube_dl/extractor/tvp.py b/youtube_dl/extractor/tvp.py index 1ad585e37..62b8b4a77 100644 --- a/youtube_dl/extractor/tvp.py +++ b/youtube_dl/extractor/tvp.py @@ -35,6 +35,9 @@ if not hasattr(InfoExtractor, '_match_valid_url'): RegexNotFoundError, ) + def txt_or_none(v, default=None): + return default if v is None else (compat_str(v).strip() or default) + BaseIE = InfoExtractor class InfoExtractor(BaseIE):