瀏覽代碼

Small issues resolved (#36)

* Fixed POST request

The POST request on line 142 had a variable "url", but this is undefined. Changed it to include the correct URL.

* Better Captcha Read

Added in rstrip to remove blank and newline characters at end of captcha. Sometimes the OCR would return new lines after the text, and this would never solve.
Chris S 2 年之前
父節點
當前提交
3efc1947d0
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      domainhunter.py

+ 2 - 2
domainhunter.py

@@ -139,7 +139,7 @@ def checkBluecoat(domain):
                         response = s.get(url=captchasolutionURL,headers=headers,verify=False,proxies=proxies)
 
                         # Try the categorization request again
-                        response = s.post(url,headers=headers,json=postData,verify=False,proxies=proxies)
+                        response = s.post('https://sitereview.bluecoat.com/resource/lookup',headers=headers,json=postData,verify=False,proxies=proxies)
 
                         responseJSON = json.loads(response.text)
 
@@ -349,7 +349,7 @@ def solveCaptcha(url,session):
 
         # Perform basic OCR without additional image enhancement
         text = pytesseract.image_to_string(Image.open(jpeg))
-        text = text.replace(" ", "")
+        text = text.replace(" ", "").rstrip()
         
         # Remove CAPTCHA file
         try: