Skip to content

Commit 3a96f29

Browse files
Decoding error resolved
1 parent b164cc5 commit 3a96f29

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

SubDomainizer.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,16 @@ def IntJsExtract(self, url, heads):
7171
req = requests.get(url, headers=heads)
7272
else:
7373
req = requests.get('http://' + url, headers=heads)
74+
7475
decoding = req.encoding
76+
77+
if decoding:
78+
decoding = decoding
79+
else:
80+
decoding = 'utf-8'
81+
7582
print(termcolor.colored("Searching for Inline Javascripts.....", color='yellow', attrs=['bold']))
83+
7684
try:
7785
html = req.content.decode(decoding)
7886
minhtml = htmlmin.minify(html, remove_empty_space=True)
@@ -92,7 +100,13 @@ def ExtJsExtract(self, url, heads):
92100
req = requests.get(url, headers=heads)
93101
else:
94102
req = requests.get('http://' + url, headers=heads)
103+
95104
decoding = req.encoding
105+
if decoding:
106+
decoding = decoding
107+
else:
108+
decoding = 'utf-8'
109+
96110
try:
97111
html = req.content.decode(decoding)
98112
soup = BeautifulSoup(html, features='html.parser')

0 commit comments

Comments
 (0)