-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmain.py
21 lines (19 loc) · 961 Bytes
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# This is a sample Python script.
# Press Shift+F10 to execute it or replace it with your code.
# Press Double Shift to search everywhere for classes, files, tool windows, actions, and settings.
from HTMLObfuscator import HTMLObfuscator
import optparse
# Press the green button in the gutter to run the script.
if __name__ == '__main__':
parser = optparse.OptionParser()
parser.add_option('-i', help='arguments', dest='html_input_file_path', action='store')
parser.add_option('-o', help='arguments', dest='html_output_file_path', action='store')
(opts, args) = parser.parse_args()
html_input_file_path = opts.html_input_file_path
html_output_file_path = opts.html_output_file_path
html_obfuscator = HTMLObfuscator()
with open(html_input_file_path, "r") as f:
html = f.read()
html_obf = html_obfuscator.obfuscate_html(html)
with open(html_output_file_path, "w", encoding="utf-8") as f:
f.write(html_obf)