Files
odiseectf/yt/fixcomments.py
2018-11-20 21:06:11 +01:00

17 lines
481 B
Python

import json
with open('comments-AKLrKMz-avE.json', 'r') as infile:
j = json.load(infile)
with open('commets.txt', 'w') as outfile:
for item in j:
try:
if (item["commentText"]):
temp = item["commentText"]
woordjes = temp.replace("\n", " ").replace("\r", " ").split(" ")
for w in woordjes:
outfile.write(w+"\n")
except KeyError:
print("wss een comment reply")