mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2025-08-18 02:18:29 +00:00
[devalue] fromisoformat
is no good pre-3.11
Authored by: bashonly
This commit is contained in:
parent
fb332f6908
commit
9de99f569d
@ -6,6 +6,8 @@
|
||||
import math
|
||||
import re
|
||||
|
||||
from .._utils import parse_iso8601
|
||||
|
||||
TYPE_CHECKING = False
|
||||
if TYPE_CHECKING:
|
||||
import collections.abc
|
||||
@ -87,7 +89,7 @@ def parse_iter(parsed: typing.Any, /, *, revivers: dict[str, collections.abc.Cal
|
||||
|
||||
elif value[0] == 'Date':
|
||||
try:
|
||||
result = dt.datetime.fromisoformat(value[1])
|
||||
result = dt.datetime.fromtimestamp(parse_iso8601(value[1]), tz=dt.timezone.utc)
|
||||
except Exception:
|
||||
yield ValueError(f'invalid date: {value[1]!r}')
|
||||
result = None
|
||||
|
Loading…
Reference in New Issue
Block a user