diff options
author | pukkandan <pukkandan.ytdlp@gmail.com> | 2023-05-24 23:30:43 +0530 |
---|---|---|
committer | pukkandan <pukkandan.ytdlp@gmail.com> | 2023-05-24 23:30:43 +0530 |
commit | 4823ec9f461512daa1b8ab362893bb86a6320b26 (patch) | |
tree | ed455a74f6d817197aab2674cdbdf39563418978 /yt_dlp/utils/_utils.py | |
parent | 46f1370e9af6f8af8762f67e27e5acb8f0c48a47 (diff) | |
download | hypervideo-pre-4823ec9f461512daa1b8ab362893bb86a6320b26.tar.lz hypervideo-pre-4823ec9f461512daa1b8ab362893bb86a6320b26.tar.xz hypervideo-pre-4823ec9f461512daa1b8ab362893bb86a6320b26.zip |
Update to ytdl-commit-d1c6c5
[YouTube] [core] Improve platform debug log, based on yt-dlp
https://github.com/ytdl-org/youtube-dl/commit/d1c6c5c4d618fa950813c0c71aede34a5ac851e9
Except:
* 6ed34338285f722d0da312ce0af3a15a077a3e2a [jsinterp] Add short-cut evaluation for common expression
* There was no performance improvement when tested with https://github.com/ytdl-org/youtube-dl/issues/30641
* e8de54bce50f6f77a4d7e8e80675f7003d5bf630 [core] Handle `/../` sequences in HTTP URLs
* We plan to implement this differently
Diffstat (limited to 'yt_dlp/utils/_utils.py')
-rw-r--r-- | yt_dlp/utils/_utils.py | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/yt_dlp/utils/_utils.py b/yt_dlp/utils/_utils.py index afcb2a164..238b0fe69 100644 --- a/yt_dlp/utils/_utils.py +++ b/yt_dlp/utils/_utils.py @@ -130,8 +130,13 @@ USER_AGENTS = { } -NO_DEFAULT = object() -IDENTITY = lambda x: x +class NO_DEFAULT: + pass + + +def IDENTITY(x): + return x + ENGLISH_MONTH_NAMES = [ 'January', 'February', 'March', 'April', 'May', 'June', @@ -3223,6 +3228,9 @@ def is_iterable_like(x, allowed_types=collections.abc.Iterable, blocked_types=NO def variadic(x, allowed_types=NO_DEFAULT): + if not isinstance(allowed_types, (tuple, type)): + deprecation_warning('allowed_types should be a tuple or a type') + allowed_types = tuple(allowed_types) return x if is_iterable_like(x, blocked_types=allowed_types) else (x, ) |