aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/utils.py
diff options
context:
space:
mode:
authorPhilipp Hagemeister <phihag@phihag.de>2013-12-09 19:39:41 +0100
committerPhilipp Hagemeister <phihag@phihag.de>2013-12-09 19:44:33 +0100
commitcaefb1de877e163fa3ece44757cb2fae6adf47e4 (patch)
tree3e4f28082cc7c00ee6f00919e8cda0ab21ed2bd1 /youtube_dl/utils.py
parent1e1f84dac9b4fe8cc32f3d5aefb5fceb5d65232a (diff)
[ndtv] Add extractor (Fixes #1924)
Diffstat (limited to 'youtube_dl/utils.py')
-rw-r--r--youtube_dl/utils.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/youtube_dl/utils.py b/youtube_dl/utils.py
index 64300d8e0..0dab9fcc5 100644
--- a/youtube_dl/utils.py
+++ b/youtube_dl/utils.py
@@ -1045,3 +1045,15 @@ def get_term_width():
except:
pass
return None
+
+
+def month_by_name(name):
+ """ Return the number of a month by (locale-independently) English name """
+
+ ENGLISH_NAMES = [
+ u'Januar', u'February', u'March', u'April', u'May', u'June',
+ u'July', u'August', u'September', u'October', u'November', u'December']
+ try:
+ return ENGLISH_NAMES.index(name) + 1
+ except ValueError:
+ return None