commit from Sky! adapt to new ACFun json format

tweak the ReadCommentsAcfun part to the current acfun danmaku json format
This commit is contained in:
Yizzle Yang 2016-05-17 17:16:04 -04:00
parent 08458c5edf
commit 303174111c

View File

@ -151,9 +151,11 @@ def ReadCommentsNiconico(f, fontsize):
def ReadCommentsAcfun(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 # 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): for i, comment in enumerate(comment_element):
try: try:
p = str(comment['c']).split(',') p = str(comment['c']).split(',')