From 303174111cb8ad5fbd775527f2a86cc1bd9c79b4 Mon Sep 17 00:00:00 2001 From: Yizzle Yang Date: Tue, 17 May 2016 17:16:04 -0400 Subject: [PATCH] commit from Sky! adapt to new ACFun json format tweak the ReadCommentsAcfun part to the current acfun danmaku json format --- danmaku2ass.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/danmaku2ass.py b/danmaku2ass.py index 4d02050..29c51a4 100755 --- a/danmaku2ass.py +++ b/danmaku2ass.py @@ -151,9 +151,11 @@ def ReadCommentsNiconico(f, fontsize): def ReadCommentsAcfun(f, fontsize): - comment_element = json.load(f) + #comment_element = json.load(f) # after load acfun comment json file as python list, flatten the list - comment_element = [c for sublist in comment_element for c in sublist] + #comment_element = [c for sublist in comment_element for c in sublist] + comment_elements = json.load(f) + comment_element = comment_elements[2] for i, comment in enumerate(comment_element): try: p = str(comment['c']).split(',')