From b9acd95b15b15bb57a59748de37409920c9c5654 Mon Sep 17 00:00:00 2001 From: alexvong1995 Date: Wed, 28 Jan 2015 22:08:53 +0800 Subject: [PATCH] Add support for NicoFox generated xml file Add another if-else statement in ProbeCommentFormat(f) to distinguish NicoFox and MioMio. Feel free to change the probing method to improve readibility --- danmaku2ass.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/danmaku2ass.py b/danmaku2ass.py index 87739e5..2b799d2 100755 --- a/danmaku2ass.py +++ b/danmaku2ass.py @@ -79,7 +79,11 @@ def ProbeCommentFormat(f): elif tmp == 'xml version="1.0" encoding="Utf-8"?>\n<': return 'Bilibili' # Komica, with the same file format as Bilibili elif tmp == 'xml version="1.0" encoding="UTF-8"?>\n<': - return 'MioMio' + tmp = f.read(20) + if tmp == '!-- BoonSutazioData=': + return 'Niconico' # Niconico videos downloaded with NicoFox + else: + return 'MioMio' elif tmp == 'p': return 'Niconico' # Himawari Douga, with the same file format as Niconico Douga