1
0
Fork 0
mirror of https://github.com/ytdl-org/youtube-dl.git synced 2024-11-18 16:26:23 +00:00

Update youtube_dl/extractor/tvp.py

Add `txt_or_none()` shim
This commit is contained in:
dirkf 2023-05-09 16:50:35 +01:00 committed by GitHub
parent 6e827118cb
commit 4891480197
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -35,6 +35,9 @@ if not hasattr(InfoExtractor, '_match_valid_url'):
RegexNotFoundError, RegexNotFoundError,
) )
def txt_or_none(v, default=None):
return default if v is None else (compat_str(v).strip() or default)
BaseIE = InfoExtractor BaseIE = InfoExtractor
class InfoExtractor(BaseIE): class InfoExtractor(BaseIE):