aboutsummaryrefslogtreecommitdiff
path: root/yt_dlp/YoutubeDL.py
diff options
context:
space:
mode:
authorSimon Sawicki <contact@grub4k.xyz>2023-09-17 12:56:50 +0200
committerGitHub <noreply@github.com>2023-09-17 12:56:50 +0200
commit836e06d246512f286f30c1371b2c54b72c9ecd93 (patch)
tree1f492da9a5f245b7e96d5a1a45aeb643dd0d1a8d /yt_dlp/YoutubeDL.py
parent94389b225d9bcf29aa7ba8afaf1bbd7c62204eae (diff)
[core] Fix support for upcoming Python 3.12 (#8130)
This also adds the following test runners: - `3.12-dev` on `ubuntu-latest` - `3.12-dev` on `windows-latest` - `pypy-3.10` on `ubuntu-latest` Authored by: Grub4K
Diffstat (limited to 'yt_dlp/YoutubeDL.py')
-rw-r--r--yt_dlp/YoutubeDL.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/yt_dlp/YoutubeDL.py b/yt_dlp/YoutubeDL.py
index 666d89b46..1feed3052 100644
--- a/yt_dlp/YoutubeDL.py
+++ b/yt_dlp/YoutubeDL.py
@@ -2591,7 +2591,7 @@ class YoutubeDL:
# Working around out-of-range timestamp values (e.g. negative ones on Windows,
# see http://bugs.python.org/issue1646728)
with contextlib.suppress(ValueError, OverflowError, OSError):
- upload_date = datetime.datetime.utcfromtimestamp(info_dict[ts_key])
+ upload_date = datetime.datetime.fromtimestamp(info_dict[ts_key], datetime.timezone.utc)
info_dict[date_key] = upload_date.strftime('%Y%m%d')
live_keys = ('is_live', 'was_live')