Kaynağa Gözat

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 yıl önce
ebeveyn
işleme
3efc1947d0
1 değiştirilmiş dosya ile 2 ekleme ve 2 silme
  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)
                         response = s.get(url=captchasolutionURL,headers=headers,verify=False,proxies=proxies)
 
 
                         # Try the categorization request again
                         # 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)
                         responseJSON = json.loads(response.text)
 
 
@@ -349,7 +349,7 @@ def solveCaptcha(url,session):
 
 
         # Perform basic OCR without additional image enhancement
         # Perform basic OCR without additional image enhancement
         text = pytesseract.image_to_string(Image.open(jpeg))
         text = pytesseract.image_to_string(Image.open(jpeg))
-        text = text.replace(" ", "")
+        text = text.replace(" ", "").rstrip()
         
         
         # Remove CAPTCHA file
         # Remove CAPTCHA file
         try:
         try: