projects
/
youtube-dl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Redtube changed player config, new place to get thumb URL
[youtube-dl]
/
youtube_dl
/
utils.py
diff --git
a/youtube_dl/utils.py
b/youtube_dl/utils.py
index b97e62ae9307f7e2380db7ec9c723e8ae8517708..64a9618ca62493f893af16b31b3fbd331bbdc1e7 100644
(file)
--- a/
youtube_dl/utils.py
+++ b/
youtube_dl/utils.py
@@
-775,7
+775,7
@@
class YoutubeDLHandler(compat_urllib_request.HTTPHandler):
https_response = http_response
https_response = http_response
-def parse_iso8601(date_str):
+def parse_iso8601(date_str
, delimiter='T'
):
""" Return a UNIX timestamp from the given date """
if date_str is None:
""" Return a UNIX timestamp from the given date """
if date_str is None:
@@
-795,8
+795,8
@@
def parse_iso8601(date_str):
timezone = datetime.timedelta(
hours=sign * int(m.group('hours')),
minutes=sign * int(m.group('minutes')))
timezone = datetime.timedelta(
hours=sign * int(m.group('hours')),
minutes=sign * int(m.group('minutes')))
-
- dt = datetime.datetime.strptime(date_str,
'%Y-%m-%dT%H:%M:%S'
) - timezone
+ date_format = '%Y-%m-%d{0}%H:%M:%S'.format(delimiter)
+ dt = datetime.datetime.strptime(date_str,
date_format
) - timezone
return calendar.timegm(dt.timetuple())
return calendar.timegm(dt.timetuple())
@@
-816,6
+816,9
@@
def unified_strdate(date_str):
'%d %b %Y',
'%B %d %Y',
'%b %d %Y',
'%d %b %Y',
'%B %d %Y',
'%b %d %Y',
+ '%b %dst %Y %I:%M%p',
+ '%b %dnd %Y %I:%M%p',
+ '%b %dth %Y %I:%M%p',
'%Y-%m-%d',
'%d.%m.%Y',
'%d/%m/%Y',
'%Y-%m-%d',
'%d.%m.%Y',
'%d/%m/%Y',
@@
-1425,7
+1428,7
@@
US_RATINGS = {
def strip_jsonp(code):
def strip_jsonp(code):
- return re.sub(r'(?s)^[a-zA-Z
_]+\s*\(\s*(.*)\);
\s*?\s*$', r'\1', code)
+ return re.sub(r'(?s)^[a-zA-Z
0-9_]+\s*\(\s*(.*)\);?
\s*?\s*$', r'\1', code)
def qualities(quality_ids):
def qualities(quality_ids):