Fix \n issue
This commit is contained in:
parent
6889f26328
commit
eb96cd2053
@ -151,7 +151,7 @@ def ReadCommentsBilibili(f, fontsize):
|
|||||||
p = str(comment.getAttribute('p')).split(',')
|
p = str(comment.getAttribute('p')).split(',')
|
||||||
assert len(p) >= 5
|
assert len(p) >= 5
|
||||||
assert p[1] in ('1', '4', '5')
|
assert p[1] in ('1', '4', '5')
|
||||||
c = str(comment.childNodes[0].wholeText).replace('/n', '\\n')
|
c = str(comment.childNodes[0].wholeText).replace('/n', '\n')
|
||||||
size = int(p[2])*fontsize/25.0
|
size = int(p[2])*fontsize/25.0
|
||||||
yield (float(p[0]), int(p[4]), i, c, {'1': 0, '4': 2, '5': 1}[p[1]], int(p[3]), size, (c.count('\n')+1)*size, CalculateLength(c)*size)
|
yield (float(p[0]), int(p[4]), i, c, {'1': 0, '4': 2, '5': 1}[p[1]], int(p[3]), size, (c.count('\n')+1)*size, CalculateLength(c)*size)
|
||||||
except (AssertionError, AttributeError, IndexError, TypeError, ValueError):
|
except (AssertionError, AttributeError, IndexError, TypeError, ValueError):
|
||||||
|
Loading…
Reference in New Issue
Block a user