diff options
| author | dirkf <fieldhouse@gmx.net> | 2023-04-23 22:58:35 +0100 | 
|---|---|---|
| committer | dirkf <fieldhouse@gmx.net> | 2023-04-23 22:58:35 +0100 | 
| commit | 64d6dd64c8b7a35a87655d27fc83f2e98ef6ce13 (patch) | |
| tree | 032609a4726680751d5e90040c093a319fa11d46 /youtube_dl/utils.py | |
| parent | 211cbfd5d46025a8e4d8f9f3d424aaada4698974 (diff) | |
[YouTube] Support Releases tab
Diffstat (limited to 'youtube_dl/utils.py')
| -rw-r--r-- | youtube_dl/utils.py | 9 | 
1 files changed, 7 insertions, 2 deletions
| diff --git a/youtube_dl/utils.py b/youtube_dl/utils.py index d80ceb007..65ddb3b0f 100644 --- a/youtube_dl/utils.py +++ b/youtube_dl/utils.py @@ -3753,6 +3753,11 @@ def strip_or_none(v, default=None):      return v.strip() if isinstance(v, compat_str) else default +def txt_or_none(v, default=None): +    """ Combine str/strip_or_none, disallow blank value (for traverse_obj) """ +    return default if v is None else (compat_str(v).strip() or default) + +  def url_or_none(url):      if not url or not isinstance(url, compat_str):          return None @@ -4096,8 +4101,8 @@ def escape_url(url):      ).geturl() -def parse_qs(url): -    return compat_parse_qs(compat_urllib_parse.urlparse(url).query) +def parse_qs(url, **kwargs): +    return compat_parse_qs(compat_urllib_parse.urlparse(url).query, **kwargs)  def read_batch_urls(batch_fd): | 
