evil0 = 'window.location.href'
evil1 = 'function'
root = os.path.dirname(os.path.abspath(__file__))
print(root)
for root, dirs, files in os.walk(root):
for file in files:
if 'ht' not in file.split('.')[-1] :#and 'js' not in file.split(' '):
continue
#print(file)
with open(os.path.join(root, file), 'r+', encoding="utf-8") as f:
cont = f.read()
#print(cont)
f.seek(0)
f.truncate()
while evil0 in cont or evil1 in cont:
cont = cont.replace(evil0, '').replace(evil1, '')
print("Evil founded")
f.write(cont)