m13253/danmaku2ass

转换比较大的弹幕文件时出错?

chenxuuu opened this issue · 1 comments

刚才把多个弹幕文件合并成了一个大约包含13万条弹幕的文件,转换时报错:
F:\哔哩哔哩视频和弹幕备份\danmaku2ass-master>python danmaku2ass.py -o 2.ass -s 640x480 -fn "MS PGothic" -fs 20 -a 0.8 -dm 5 -ds 5 all.xml Traceback (most recent call last): File "danmaku2ass.py", line 859, in <module> main() File "danmaku2ass.py", line 855, in main Danmaku2ASS(args.file, args.output, width, height, args.protect, args.font, args.fontsize, args.alpha, args.duration_marquee, args.duration_still, args.reduce) File "danmaku2ass.py", line 779, in Danmaku2ASS comments = ReadComments(input_files, font_size) File "danmaku2ass.py", line 807, in ReadComments comments.extend(CommentProcessor(FilterBadChars(f), font_size)) File "danmaku2ass.py", line 173, in ReadCommentsBilibili dom = xml.dom.minidom.parse(f) File "C:\Users\chenxuuu\AppData\Local\Programs\Python\Python35-32\lib\xml\dom\minidom.py", line 1958, in parse return expatbuilder.parse(file) File "C:\Users\chenxuuu\AppData\Local\Programs\Python\Python35-32\lib\xml\dom\expatbuilder.py", line 913, in parse result = builder.parseFile(file) File "C:\Users\chenxuuu\AppData\Local\Programs\Python\Python35-32\lib\xml\dom\expatbuilder.py", line 207, in parseFile parser.Parse(buffer, 0) xml.parsers.expat.ExpatError: XML or text declaration not at start of entity: line 43690, column 0

弹幕文件:http://pan.baidu.com/s/1o8zWf4A

弹幕文件可能损坏了。
稍等我去检查一下 XML。
不推荐合并弹幕文件到同一个 XML 再调用,而是在调用 danmaku2ass 的时候连续指定多个 XML 输入文件。