aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/utils.py
diff options
context:
space:
mode:
authorPhilipp Hagemeister <phihag@phihag.de>2013-07-08 01:13:55 +0200
committerPhilipp Hagemeister <phihag@phihag.de>2013-07-08 01:13:55 +0200
commit73e79f2a1be3179edd8eebf4b7b6d56fe953a4a8 (patch)
tree75465caca8e9f3e4c4a7febf71025e4fba70f2cd /youtube_dl/utils.py
parent9d7b44b4cc77fab01f0fbb8d28ec22fe1c3f3c76 (diff)
downloadyoutube-dl-73e79f2a1be3179edd8eebf4b7b6d56fe953a4a8.tar.xz
[3sat] Add support (Fixes #1001)
Diffstat (limited to 'youtube_dl/utils.py')
-rw-r--r--youtube_dl/utils.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/youtube_dl/utils.py b/youtube_dl/utils.py
index 9137a4f70..b9bff5fde 100644
--- a/youtube_dl/utils.py
+++ b/youtube_dl/utils.py
@@ -623,7 +623,7 @@ def unified_strdate(date_str):
date_str = date_str.replace(',',' ')
# %z (UTC offset) is only supported in python>=3.2
date_str = re.sub(r' (\+|-)[\d]*$', '', date_str)
- format_expressions = ['%d %B %Y', '%B %d %Y', '%b %d %Y', '%Y-%m-%d', '%d/%m/%Y', '%Y/%m/%d %H:%M:%S']
+ format_expressions = ['%d %B %Y', '%B %d %Y', '%b %d %Y', '%Y-%m-%d', '%d/%m/%Y', '%Y/%m/%d %H:%M:%S', '%d.%m.%Y %H:%M']
for expression in format_expressions:
try:
upload_date = datetime.datetime.strptime(date_str, expression).strftime('%Y%m%d')
@@ -631,6 +631,13 @@ def unified_strdate(date_str):
pass
return upload_date
+def determine_ext(url):
+ guess = url.partition(u'?')[0].rpartition(u'.')[2]
+ if re.match(r'^[A-Za-z0-9]+$', guess):
+ return guess
+ else:
+ return u'unknown_video'
+
def date_from_str(date_str):
"""
Return a datetime object from a string in the format YYYYMMDD or