diff options
author | Sergey M․ <dstftw@gmail.com> | 2015-04-04 19:14:01 +0600 |
---|---|---|
committer | Sergey M․ <dstftw@gmail.com> | 2015-04-04 19:14:01 +0600 |
commit | 3fde134791fa920c98a99610c2200a6b3572cca0 (patch) | |
tree | 21d7a70a9c8e6d23a30438177bf4fe320a1480db /youtube_dl/utils.py | |
parent | 536b94e56fdf0fd2dd1c6d6d92112866949505c4 (diff) | |
parent | 7c39a65543b809b681434246b84710349f5837aa (diff) |
Merge branch 'Roman2K-pornovoisines'
Diffstat (limited to 'youtube_dl/utils.py')
-rw-r--r-- | youtube_dl/utils.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/youtube_dl/utils.py b/youtube_dl/utils.py index e1761265c..52f0dd09a 100644 --- a/youtube_dl/utils.py +++ b/youtube_dl/utils.py @@ -730,7 +730,8 @@ def unified_strdate(date_str, day_first=True): # Replace commas date_str = date_str.replace(',', ' ') # %z (UTC offset) is only supported in python>=3.2 - date_str = re.sub(r' ?(\+|-)[0-9]{2}:?[0-9]{2}$', '', date_str) + if not re.match(r'^[0-9]{1,2}-[0-9]{1,2}-[0-9]{4}$', date_str): + date_str = re.sub(r' ?(\+|-)[0-9]{2}:?[0-9]{2}$', '', date_str) # Remove AM/PM + timezone date_str = re.sub(r'(?i)\s*(?:AM|PM)(?:\s+[A-Z]+)?', '', date_str) @@ -759,6 +760,7 @@ def unified_strdate(date_str, day_first=True): ] if day_first: format_expressions.extend([ + '%d-%m-%Y', '%d.%m.%Y', '%d/%m/%Y', '%d/%m/%y', @@ -766,6 +768,7 @@ def unified_strdate(date_str, day_first=True): ]) else: format_expressions.extend([ + '%m-%d-%Y', '%m.%d.%Y', '%m/%d/%Y', '%m/%d/%y', |