Shopee Captcha
ภาพรวม
Shopee Captcha เป็นระบบแคปช่าที่ Shopee ใช้เพื่อปกป้องผู้ใช้และระบบจากพฤติกรรมผิดปกติ เช่น บอท สแปม หรือการเข้าสู่ระบบอัตโนมัติ
Achicaptcha รองรับการแก้ Shopee captcha อัตโนมัติสำหรับแพลตฟอร์มต่างๆ (เบราว์เซอร์, อีมูเลเตอร์, โทรศัพท์) ดูคู่มือด้านล่างเพื่อรวม API
🛍️
สำหรับ Shopee text captcha โปรดดูที่ Text Captcha หากคุณพบปัญหาใดๆ โปรดติดต่อ admin (opens in a new tab) เพื่อขอความช่วยเหลือ


1. สร้างงาน
คำขอ
POST https://api.achicaptcha.com/createTask
พารามิเตอร์
| พารามิเตอร์ | ชนิดข้อมูล | จำเป็น? | คำอธิบาย |
|---|---|---|---|
clientKey | string | ใช่ | คีย์ API |
task.type | string | ใช่ | ShopeeCaptchaTask |
task.image | string | ใช่ | รูปภาพ mask Base64|รูปภาพพื้นหลัง Base64 |
task.subType | int | ใช่ | ประเภทแคปช่า: 0: Slider captcha |
ตัวอย่างคำขอ
POST /createTask HTTP/1.1
Host: api.achicaptcha.com
Content-Type: application/json
{
"clientKey": "YOUR_API_KEY",
"task": {
"type": "ShopeeCaptchaTask",
"image": "/9j/4AAQSkZJRgABAQEASABIAAD...|/9j/4DSJFHKSDJDS...",
"subType": 0
}
}การตอบกลับ
เมื่อสำเร็จ เซิร์ฟเวอร์จะส่งคืน errorId = 0 และ taskId
{
"errorId": 0,
"taskId": "f2fc70d6-c76b-4fba-9480-205ac1fe9fb9"
}2. รับผลลัพธ์
คำขอ
POST https://api.achicaptcha.com/getTaskResult
พารามิเตอร์
| พารามิเตอร์ | ชนิดข้อมูล | จำเป็น? | คำอธิบาย |
|---|---|---|---|
clientKey | string | ใช่ | คีย์ API, ติดต่อ admin |
taskId | string | ใช่ | TaskId จากขั้นตอน (1) |
ตัวอย่างคำขอ
POST /getTaskResult HTTP/1.1
Host: api.achicaptcha.com
Content-Type: application/json
{
"clientKey": "Your API_KEY",
"taskId": "f2fc70d6-c76b-4fba-9480-205ac1fe9fb9"
}การตอบกลับ
{
"errorId": 0,
"status": "ready",
"solution": "x1,y1,x2,y2"
}ความหมายของการตอบกลับ
errorId = 0และstatus = ready: แก้ไขสำเร็จ อ่านผลลัพธ์ในsolutionerrorId = 1และstatus = processing: กำลังแก้แคปช่า รอ 1-2 วินาทีแล้วลองอีกครั้งerrorIdอื่นที่ไม่ใช่ 0 และ 1: ข้อผิดพลาดของระบบ ระบุรหัสข้อผิดพลาดและคำอธิบายsolution: สำหรับ slider captcha: ส่งคืนพิกัดแกน x ที่จะลาก
ตัวอย่างการรวมระบบ
import requests
import time
def solve_shopee_captcha(mask_image, bg_image, sub_type, api_key='YOUR_API_KEY'):
# Step 1: Create task
create_task_url = 'https://api.achicaptcha.com/createTask'
create_task_payload = {
'clientKey': api_key,
'task': {
'type': 'ShopeeCaptchaTask',
'image': mask_image + '|' + bg_image,
'subType': sub_type
}
}
response = requests.post(create_task_url, json=create_task_payload)
result = response.json()
if result['errorId'] != 0:
raise Exception(result['errorDescription'])
task_id = result['taskId']
# Step 2: Get result
get_result_url = 'https://api.achicaptcha.com/getTaskResult'
while True:
time.sleep(2) # Wait 2 seconds
get_result_payload = {
'clientKey': api_key,
'taskId': task_id
}
response = requests.post(get_result_url, json=get_result_payload)
result = response.json()
if result['errorId'] == 0 and result['status'] == 'ready':
return result['solution']
if result['errorId'] != 0 and result['errorId'] != 1:
raise Exception(result['errorDescription'])
# If status == 'processing', continue loop
# Usage
mask_image = '/9j/4AAQSkZJRgABAQEASABIAAD...' # Base64 mask image
bg_image = '/9j/4DSJFHKSDJDS...' # Base64 background image
sub_type = 0 # 0: Slider captcha
solution = solve_shopee_captcha(mask_image, bg_image, sub_type, 'YOUR_API_KEY')
print('Shopee captcha solution:', solution)รหัสข้อผิดพลาดทั่วไป
รหัสข้อผิดพลาดเมื่อสร้างงาน
| รหัสข้อผิดพลาด | คำอธิบาย | หมายเหตุ |
|---|---|---|
| 0 | success | สร้างงานสำเร็จ |
| 2 | missing required fields | ขาดฟิลด์ที่จำเป็น ตรวจสอบพารามิเตอร์ (image, subType) |
| 3 | task not supported | ไม่รองรับประเภทงาน |
| 4 | task creation failed | การสร้างงานล้มเหลว ลองใหม่อีกครั้งในภายหลัง |
| 5 | client key does not exist | ไม่มีคีย์ API ตรวจสอบคีย์ API ของคุณ |
| 6 | insufficient account balance | ยอดเงินในบัญชีไม่เพียงพอ เติมเครดิต |
รหัสข้อผิดพลาดเมื่อรับผลลัพธ์
| รหัสข้อผิดพลาด | คำอธิบาย | หมายเหตุ |
|---|---|---|
| 0 | success | สำเร็จ อ่านผลลัพธ์ในฟิลด์ solution |
| 1 | processing | กำลังประมวลผล รอ 1-2 วินาทีแล้วส่งคำขออีกครั้ง |
| 5 | client key does not exist | ไม่มีคีย์ API ตรวจสอบคีย์ API ของคุณ |
| 7 | task failed, please create a new task | งานล้มเหลว โปรดสร้างงานใหม่ |
| 8 | task ID does not exist | ไม่มี ID งานหรือหมดอายุแล้ว |
แนวทางปฏิบัติที่ดีที่สุด
เพื่อให้ได้ผลลัพธ์ที่ดีที่สุดเมื่อใช้ Achicaptcha API สำหรับ Shopee Captcha ให้ปฏิบัติตามหลักการเหล่านี้:
1. เตรียมรูปภาพ Base64
- แปลงรูปภาพ mask และพื้นหลังเป็นรูปแบบ Base64
- ตรวจสอบให้แน่ใจว่าคุณภาพของรูปภาพชัดเจนเพื่อเพิ่มความแม่นยำ
- เชื่อมต่อสองรูปภาพด้วยตัวอักษร
|(pipe)
2. ช่วงเวลาการตรวจสอบ
- รออย่างน้อย 1-2 วินาทีระหว่างการตรวจสอบผลลัพธ์
- อย่าสแปม API ด้วยคำขอที่ต่อเนื่องกันมากเกินไป
- ตั้งค่าการหมดเวลาเพื่อหลีกเลี่ยงลูปไม่สิ้นสุด (แนะนำ 120 วินาที)
3. การจัดการข้อผิดพลาด
- ตรวจสอบ
errorIdเพื่อตรวจจับข้อผิดพลาด errorId = 0และstatus = ready: สำเร็จerrorId = 1: กำลังประมวลผล ตรวจสอบต่อไปerrorIdอื่นที่ไม่ใช่ 0 และ 1: ข้อผิดพลาดของระบบ ต้องจัดการ
4. ตรรกะการลองใหม่
- ใช้การลองใหม่สำหรับข้อผิดพลาดชั่วคราว
- ใช้ exponential backoff เมื่อลองใหม่
- จำกัดจำนวนการลองใหม่สูงสุด
5. ความปลอดภัยของคีย์ API
- อย่าฮาร์ดโค้ดคีย์ API ในโค้ด
- ใช้ตัวแปรสภาพแวดล้อม
- อย่าเปิดเผยคีย์ API ทางฝั่งไคลเอนต์
ลิงก์ที่มีประโยชน์: