Skip to content
This repository was archived by the owner on Sep 1, 2022. It is now read-only.

Commit 6f269e6

Browse files
committed
bug fixed 😳 , headers added
1 parent ed614df commit 6f269e6

File tree

2 files changed

+9
-11
lines changed

2 files changed

+9
-11
lines changed

T1tl3.py

+9-11
Original file line numberDiff line numberDiff line change
@@ -31,22 +31,20 @@ def checkTitle(argv):
3131
for line in f:
3232
try:
3333
line2 = line.strip()
34-
url = 'https://'+line2
34+
url = 'http://'+line2
3535
try:
36-
result = requests.get(url)
37-
soup = bs(result.content, 'lxml').encode("utf-8")
38-
title = soup.select_one('title').text
36+
headers = {'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36'}
37+
result = requests.get(url, headers=headers).content
38+
soup = bs(result, 'html.parser')
39+
title = soup.find('title')
3940
print ('')
40-
print (' [+] URL Title: ' + title)
41+
print (' [+] URL Title: ' + str(title.text))
4142
print (' [+] URL: ' + url)
4243
print (' [+] URL Status: ' + result.status_code)
4344
except:
44-
print ('')
45-
print (' [x] No title found')
46-
print (' [x] URL: ' + url)
47-
print (' [x] URL Status: ' + result.status_code)
45+
pass
4846
except:
49-
print (' [x] Error')
47+
pass
5048

5149
if (len(sys.argv)) == 2:
5250
try:
@@ -60,4 +58,4 @@ def checkTitle(argv):
6058
print (' [x] Can\'t find your ' + sys.argv[1] + ' file.')
6159
else:
6260
usage()
63-
sys.exit(0)
61+
sys.exit(0)

ss.png

20.6 KB
Loading

0 commit comments

Comments
 (0)