Json字幕提取内容脚本 python
b站字幕提取脚本 自动换行
f = open('1.json', encoding='utf-8',errors='ignore')
content = f.read()
a = json.loads(content)
print(type(a))
# print(a)
txt = ''
for i in a:
print(i['content'])
txt += i['content']+'\n'
f2 = open("myfile.txt", "w",encoding='utf-8')
f2.write(txt)
f.close()
f2.close()