diff options
author | Luc Ritchie <luc.ritchie@gmail.com> | 2021-12-23 15:34:01 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-24 02:04:01 +0530 |
commit | 4f3fa23e5a074922de2f6f99acbae16acd920b34 (patch) | |
tree | d30992ad1c6ec45f7eaa0e466bca375179715800 /yt_dlp/utils.py | |
parent | b28bac93abe9d376b0b05c467006a5f7135b9aee (diff) | |
download | hypervideo-pre-4f3fa23e5a074922de2f6f99acbae16acd920b34.tar.lz hypervideo-pre-4f3fa23e5a074922de2f6f99acbae16acd920b34.tar.xz hypervideo-pre-4f3fa23e5a074922de2f6f99acbae16acd920b34.zip |
[utils] Fix parsing `YYYYMMDD` dates in Nov/Dec (#2094)
The date format `%Y%m%d%H%M` will successfully match against
one-digit month, day, hour, and minute strings, even though %m et al.
are documented as being zero-padded. So dates without time in
Nov/Dec may be wrongly parsed as dates in January with time.
This commit adds a format string of `%Y%m%d` to our supported date
format strings directly below (higher priority) its problematic relatives.
Closes #2076
Authored by: wlritchi
Diffstat (limited to 'yt_dlp/utils.py')
-rw-r--r-- | yt_dlp/utils.py | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/yt_dlp/utils.py b/yt_dlp/utils.py index fdcb350f2..29b1b9d45 100644 --- a/yt_dlp/utils.py +++ b/yt_dlp/utils.py @@ -210,6 +210,7 @@ DATE_FORMATS = ( '%Y/%m/%d %H:%M:%S', '%Y%m%d%H%M', '%Y%m%d%H%M%S', + '%Y%m%d', '%Y-%m-%d %H:%M', '%Y-%m-%d %H:%M:%S', '%Y-%m-%d %H:%M:%S.%f', |