diff options
author | pukkandan <pukkandan.ytdlp@gmail.com> | 2024-02-25 05:46:34 +0530 |
---|---|---|
committer | pukkandan <pukkandan.ytdlp@gmail.com> | 2024-04-01 05:32:15 +0530 |
commit | c305a25c1b16bcf7a5ec499c3b786ed1e2c748da (patch) | |
tree | c511474fa3a4f6f37d25e49f64a7cd4a4a3f6250 /yt_dlp/extractor/youtube.py | |
parent | e3a3ed8a981d9395c4859b6ef56cd02bc3148db2 (diff) |
[cleanup] Standardize `import datetime as dt` (#8978)
Diffstat (limited to 'yt_dlp/extractor/youtube.py')
-rw-r--r-- | yt_dlp/extractor/youtube.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/yt_dlp/extractor/youtube.py b/yt_dlp/extractor/youtube.py index 1f1db1ad3..e553fff9f 100644 --- a/yt_dlp/extractor/youtube.py +++ b/yt_dlp/extractor/youtube.py @@ -2,7 +2,7 @@ import base64 import calendar import collections import copy -import datetime +import datetime as dt import enum import hashlib import itertools @@ -924,10 +924,10 @@ class YoutubeBaseInfoExtractor(InfoExtractor): def _parse_time_text(self, text): if not text: return - dt = self.extract_relative_time(text) + dt_ = self.extract_relative_time(text) timestamp = None - if isinstance(dt, datetime.datetime): - timestamp = calendar.timegm(dt.timetuple()) + if isinstance(dt_, dt.datetime): + timestamp = calendar.timegm(dt_.timetuple()) if timestamp is None: timestamp = ( @@ -4568,7 +4568,7 @@ class YoutubeIE(YoutubeBaseInfoExtractor): if upload_date and live_status not in ('is_live', 'post_live', 'is_upcoming'): # Newly uploaded videos' HLS formats are potentially problematic and need to be checked - upload_datetime = datetime_from_str(upload_date).replace(tzinfo=datetime.timezone.utc) + upload_datetime = datetime_from_str(upload_date).replace(tzinfo=dt.timezone.utc) if upload_datetime >= datetime_from_str('today-2days'): for fmt in info['formats']: if fmt.get('protocol') == 'm3u8_native': |