Refresh token gist https://gist.github.com/ZipFile/c9ebedb224406f4f11845ab700124362
Hi i'm Tsukinatsune
A lightweight Python utility to bypass reCAPTCHA using Playwright. By automating a real browser instance, this script captures the PHPSESSID cookie directly, bypassing the need for complex reverse engineering of Pixiv's authentication API.
Anti-Spam Strategy: If you encounter persistent reCAPTCHAs, rotate through multiple proxy servers. This distributes requests across different IPs, making your traffic appear organic rather than automated.
This tool was developed and tested on Windows 11. You will need Python installed.
Install the necessary automation and networking libraries:
# Install Playwright and Requests
python -m pip install playwright requests
# Install the Chromium browser engine
python -m playwright install chromium
To get the script running, you need to provide your Pixiv credentials within the automation script. Locate the following lines and update the placeholders:
- Email/Username:
page.fill(email_selector, 'your_email@example.com')- Password:
page.fill('input[placeholder="Password"]', 'your_secure_password')Instead of fighting Pixiv's encryption, we use a "thick client" approach:
- Automated Login: Playwright opens a Chromium instance and navigates to the login page.
- Human Simulation: It fills in the credentials and handles the interaction flow.
- Cookie Extraction: Once logged in, the script extracts the
PHPSESSID. - API Ready: You can now use this session ID with the
requestslibrary to fetch data from Pixiv's private API endpoints.
Happy Coding with the Pixiv API! 🚀
สำหรับ Bypass reCAPTCHA บน Pixiv วิธีการใช้ Playwright เพื่อดึง PHPSESSID เป็นแนวทางลดความปวดหัวจากการไปไล่แก้ Reverse Engineering ตัว API โดยตรง และทำให้ระบบมองว่าเราเป็น User จริงๆ ที่ใช้งานผ่าน Browser ครับ
นี่คือคำแนะนำภาษาไทย
เครื่องมือนี้พัฒนาและทดสอบบน Windows 11 จำเป็นต้องติดตั้ง Python ไว้ในเครื่องให้เรียบร้อย
ติดตั้ง Library ที่จำเป็นสำหรับการจำลอง Browser และการจัดการ Network:
# ติดตั้ง Playwright และ Requests
python -m pip install playwright requests
# ติดตั้ง Chromium browser engine
python -m playwright install chromium
เพื่อให้สคริปต์ทำงานได้ ต้องระบุข้อมูลบัญชี Pixiv ลงในสคริปต์ โดยแก้ไขในส่วนของ Placeholder ดังนี้:
- Email/Username:
page.fill(email_selector, 'your_email@example.com')- Password:
page.fill('input[placeholder="Password"]', 'your_secure_password')แทนที่จะพยายามถอดรหัส Encryption ของ Pixiv เราใช้แนวทางแบบ "Thick Client" แทน:
- Automated Login: Playwright จะเปิดหน้าต่าง Chromium และนำทางไปยังหน้า Login
- Human Simulation: ระบบจะกรอกข้อมูลและเลียนแบบพฤติกรรมการใช้งานของมนุษย์
- Cookie Extraction: เมื่อ Login สำเร็จ สคริปต์จะดึงค่า
PHPSESSIDออกมา - API Ready: นำ Session ID นี้ไปใช้ร่วมกับ Library
requestsเพื่อดึงข้อมูลจาก Private API ของ Pixiv ได้ทันที
ขอให้สนุกใช้งาน Pixiv API! 🚀
