-
Notifications
You must be signed in to change notification settings - Fork 5
/
findee.py
34 lines (33 loc) · 1.54 KB
/
findee.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# coding = utf-8
import requests
import os, sys
nextLine = "\n"
try:
whichFile = sys.argv[2]
except:
whichFile = ""
if len(whichFile) == 0:
print("没有输入文件名,默认采用domain.txt\n no input filename,use default file domain.txt")
whichFile = "domain.txt"
lastKey = sys.argv[1]
file = open(lastKey + "_result.txt", "a")
with open(whichFile) as f:
print(sys.argv[1])
for i in f.readlines():
findDoman = str(i).strip()
keyWord = "未注册"
url = "https://www.quyu.net/domainchecker.php"
payload = "------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data;" \
" name=\"token\"\r\n\r\nf1c27e743b116b1fe26081ea11d1d2a1bf80c6fe\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\n" \
"Content-Disposition: form-data; name=\"domain\"\r\n\r\n%s\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW" \
"\r\nContent-Disposition: form-data; name=\"tlds[]\"\r\n\r\n.%s\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW--" \
% (findDoman, lastKey)
headers = {
'content-type': "multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW",
'cache-control': "no-cache",
'postman-token': "05d6797c-313c-d1e0-d39f-8ae53bc6dbd5"
}
response = requests.request("POST", url, data=payload, headers=headers)
print(findDoman + "_______________"+lastKey + str(response.text.find(keyWord)))
file.writelines(findDoman + lastKey + str(response.text.find(keyWord)))
file.write("\n")