소스 검색

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: