2
0
Эх сурвалжийг харах

아 아니다 이래야지

Surplus_Up (2DU) 7 жил өмнө
parent
commit
56cfe18951
1 өөрчлөгдсөн 2 нэмэгдсэн , 2 устгасан
  1. 2 2
      func.py

+ 2 - 2
func.py

@@ -128,11 +128,11 @@ def captcha_post(re_data, num = 1):
             sec_re = curs.fetchall()
             if sec_re and sec_re[0][0] != '':
                 data = urllib.request.urlopen('https://www.google.com/recaptcha/api/siteverify?secret=' + sec_re[0][0] + '&response=' + re_data)
-                data = data.read().decode(data.headers.get_content_charset())
-                data = json.loads(data)
                 if not data:
                     return 0
                 else:
+                    data = data.read().decode(data.headers.get_content_charset())
+                    data = json.loads(data)
                     json_data = data.json()
                     if data.status_code == 200 and json_data['success'] == True:
                         return 0