Spaces:
Running
Running
Update hcaptcha_solver.py
Browse files- hcaptcha_solver.py +3 -2
hcaptcha_solver.py
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
import asyncio
|
2 |
import base64
|
3 |
import random
|
4 |
-
import
|
5 |
import nopecha
|
6 |
import requests
|
7 |
from hcaptcha_challenger.agents import Malenia
|
@@ -101,7 +101,8 @@ async def on_response(response, page):
|
|
101 |
else:
|
102 |
print("content type:", content_type)
|
103 |
content = await response.body()
|
104 |
-
|
|
|
105 |
# 打印响应内容
|
106 |
print(data)
|
107 |
examples_urls = data.get("requester_question_example")
|
|
|
1 |
import asyncio
|
2 |
import base64
|
3 |
import random
|
4 |
+
import chardet
|
5 |
import nopecha
|
6 |
import requests
|
7 |
from hcaptcha_challenger.agents import Malenia
|
|
|
101 |
else:
|
102 |
print("content type:", content_type)
|
103 |
content = await response.body()
|
104 |
+
detected_encoding = chardet.detect(content)['encoding']
|
105 |
+
data = content.decode(detected_encoding)
|
106 |
# 打印响应内容
|
107 |
print(data)
|
108 |
examples_urls = data.get("requester_question_example")
|