From 0563194b82c09d9206aa7a7c81b3a35e3a231a64 Mon Sep 17 00:00:00 2001 From: Star Brilliant Date: Sun, 3 Nov 2013 02:21:54 +0800 Subject: [PATCH] Fix timestamp problem --- danmaku2ass.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/danmaku2ass.py b/danmaku2ass.py index e50f098..9507a8a 100755 --- a/danmaku2ass.py +++ b/danmaku2ass.py @@ -190,7 +190,7 @@ def ReadCommentsMioMio(f, fontsize): c = str(message.childNodes[0].wholeText) pos = 0 size = int(message.getAttribute('fontsize'))*fontsize/25.0 - yield (float(comment.getElementsByTagName('playTime')[0].childNodes[0].wholeText), int(calendar.timegm(time.strptime(comment.getElementsByTagName('times')[0].childNodes[0].wholeText, '%Y-%m-%d %H:%M:%S')))+28800, i, c, {'1': 0, '4': 2, '5': 1}[message.getAttribute('mode')], int(message.getAttribute('color')), size, (c.count('\n')+1)*size, CalculateLength(c)*size) + yield (float(comment.getElementsByTagName('playTime')[0].childNodes[0].wholeText), int(calendar.timegm(time.strptime(comment.getElementsByTagName('times')[0].childNodes[0].wholeText, '%Y-%m-%d %H:%M:%S')))-28800, i, c, {'1': 0, '4': 2, '5': 1}[message.getAttribute('mode')], int(message.getAttribute('color')), size, (c.count('\n')+1)*size, CalculateLength(c)*size) i += 1 except (AssertionError, AttributeError, IndexError, TypeError, ValueError): logging.warning(_('Invalid comment: %s') % comment.toxml())