aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/utils.py
diff options
context:
space:
mode:
authorPhilipp Hagemeister <phihag@phihag.de>2013-12-17 12:33:55 +0100
committerPhilipp Hagemeister <phihag@phihag.de>2013-12-17 12:33:55 +0100
commit42393ce234c651aaae244e1546e1803101765acc (patch)
tree1e00c3e847b1beb1be0441061ad11d22bbc12705 /youtube_dl/utils.py
parentd6c7a367e88096bb17e323954002c084477fe908 (diff)
Add support for direct links to a video (#1973)
Diffstat (limited to 'youtube_dl/utils.py')
-rw-r--r--youtube_dl/utils.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/youtube_dl/utils.py b/youtube_dl/utils.py
index 2d12e2df9..d5069dcca 100644
--- a/youtube_dl/utils.py
+++ b/youtube_dl/utils.py
@@ -761,12 +761,17 @@ def unified_strdate(date_str):
'%Y-%m-%dT%H:%M:%S.%fZ',
'%Y-%m-%dT%H:%M:%S.%f0Z',
'%Y-%m-%dT%H:%M:%S',
+ '%Y-%m-%dT%H:%M:%S',
]
for expression in format_expressions:
try:
upload_date = datetime.datetime.strptime(date_str, expression).strftime('%Y%m%d')
except:
pass
+ if upload_date is None:
+ timetuple = email.utils.parsedate_tz(date_str)
+ if timetuple:
+ upload_date = datetime.datetime(*timetuple[:6]).strftime('%Y%m%d')
return upload_date
def determine_ext(url, default_ext=u'unknown_video'):