tiktok-automation-suite
คู่มือและการสร้างสคริปต์สำหรับจัดการ TikTok (โพสต์ออโต้, ดึงข้อมูล) ผ่าน Python
- License 许可
- MIT
- 最近更新
- 2026-10-10
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- tiktok-automation-suite
- author
- Tonthong
- license
- MIT
- version
- 1.0.0
- metadata
- { "hermes": { "tags": [ "tiktok", "automation", "api", "scraping", "social-media" ], "related_skills": [ "content-marketing-2026-2027", "ai-fluency-framework", "facebook-automation-suite" ] } }
- description
- คู่มือและการสร้างสคริปต์สำหรับจัดการ TikTok (โพสต์ออโต้, ดึงข้อมูล) ผ่าน Python
03 SKILL.md 正文
TikTok Automation Suite
สกิลนี้รวบรวมเทคนิคและการใช้งานไลบรารี Python ยอดนิยมในการจัดการ TikTok สำหรับโปรเจคหาเงินอัตโนมัติ (Zero-Touch) โดยแบ่งออกเป็นไลบรารีต่างๆ ตามวัตถุประสงค์การใช้งาน
1. ไลบรารีที่แนะนำให้เลือกใช้
| ชื่อไลบรารี (GitHub) | จุดเด่น & การนำไปใช้งาน (Use Case) | ประเภท / ความน่าเชื่อถือ |
|---|---|---|
Douyin_TikTok_Download_API (Evil0ctal) |
ดีที่สุดสำหรับการดึงวิดีโอ & Scrape ข้อมูล: โหลดวิดีโอแบบไม่มีลายน้ำ, ดึงคอมเมนต์, โปรไฟล์ ทำมาเป็น REST API และ Docker | ⭐️ สูงมาก (Unofficial)<br>อัพเดทบ่อย มีคนใช้เยอะ |
TikTok-Api (davidteather) |
ดึงข้อมูลเทรนด์ & ฟีด: ใช้ดูเทรนด์, แฮชแท็ก, และฟีดผู้ใช้ (อาจต้องตั้งค่า Playwright) | ⭐️ ปานกลาง-สูง (Unofficial) |
TikTokLive (isaackogan) |
ดีที่สุดสำหรับงานไลฟ์สด: ดึงข้อมูล Real-time เช่น คอมเมนต์, ของขวัญ | ⭐️ สูง (Unofficial)<br>เสถียรมาก |
tiktok-business-api-sdk |
Official SDK สำหรับโฆษณา: สร้างแคมเปญ, ดึง Report (ใช้กับข้อมูลทั่วไปไม่ได้) | ⭐️ สูงมาก (Official) |
2. วิธีการติดตั้ง (ตัวอย่าง Douyin_TikTok_Download_API แบบ Client)
เนื่องจาก TikTok มีการป้องกันสูง แนะนำให้ใช้ตัวเลือกที่เป็น API สำเร็จรูป หรือรัน Docker
# ตัวอย่างการ clone repo ของ Douyin_TikTok_Download_API เพื่อรันเป็น Local API (แนะนำรันด้วย Docker)
git clone https://github.com/Evil0ctal/Douyin_TikTok_Download_API.git
cd Douyin_TikTok_Download_API
# รัน docker-compose ตามคู่มือใน repo
3. รูปแบบการใช้งานเบื้องต้น (Recipes)
Recipe 3.1: ดึงข้อมูลวิดีโอแบบไม่มีลายน้ำ (สมมติว่ารัน API ของ Evil0ctal ไว้ที่ localhost:8000)
import requests
def get_tiktok_video_info(tiktok_url: str):
api_url = f"http://localhost:8000/api/hybrid/video_data?url={tiktok_url}"
try:
response = requests.get(api_url)
data = response.json()
if data.get('code') == 200:
video_info = data['data']
print(f"🎬 Title: {video_info.get('desc')}")
print(f"🔗 No Watermark URL: {video_info.get('video_data', {}).get('nwm_video_url_HQ')}")
return video_info
else:
print("❌ Failed to fetch data")
return None
except Exception as e:
print(f"❌ Error: {e}")
Recipe 3.2: ค้นหาคลิปที่กำลังเป็นเทรนด์ (ใช้ TikTok-Api)
หมายเหตุ: จำต้องมีการตั้งค่า Playwright และจัดการเรื่อง Captcha
# pip install TikTokApi playwright
# python -m playwright install
from TikTokApi import TikTokApi
import asyncio
async def fetch_trending_videos(count=5):
async with TikTokApi() as api:
await api.create_sessions(ms_tokens=["YOUR_MS_TOKEN_HERE"], num_sessions=1, sleep_after=3)
try:
async for video in api.trending.videos(count=count):
print(f"🔥 เทรนด์: {video.desc} | ยอดดู: {video.stats['playCount']}")
except Exception as e:
print(f"❌ Error fetching trending: {e}")
# asyncio.run(fetch_trending_videos())
4. แผนประยุกต์ใช้เพื่อ "หาเงิน"
- [Research]: ใช้
TikTok-Apiค้นหาคลิปที่กำลังเป็นไวรัลในหมวดหมู่ที่เราสนใจ เพื่อดูแนวทาง - [Asset Download]: หากต้องการใช้วิดีโอบางส่วน (ระวังลิขสิทธิ์) ใช้
Douyin_TikTok_Download_APIโหลดแบบไม่มีลายน้ำ - [Live Interaction]: หากเปิดเซิร์ฟเวอร์ไลฟ์สดแบบอัตโนมัติ ใช้
TikTokLiveจับคอมเมนต์คนดู แล้วใช้ AI โต้ตอบด้วยเสียง (TTS)
5. ข้อควรระวัง (Pitfalls)
- Bot Protection (Captcha): TikTok มีระบบป้องกันการดูดข้อมูลที่ดุเดือดมาก การใช้ Scraper ตรงๆ มักจะติด Captcha หรือโดนแบน IP ชั่วคราว แนะนำให้ใช้ Residential Proxies
- ไม่มี Official Data API ทั่วไป: ถ้าไม่ใช่การยิงแอด (Business) คุณต้องพึ่งพา Unofficial Tools ซึ่งต้องคอยอัพเดทโค้ดตามบ่อยๆ
- ลิขสิทธิ์ (Copyright): การดูดวิดีโอคนอื่นมาลงซ้ำ (Re-upload) โดยไม่ตัดต่อหรือดัดแปลงอย่างมีนัยสำคัญ จะโดนแบนช่องได้ง่ายมาก ควรใช้เพื่อเป็น Data/Reference หรือนำมาดัดแปลง (Reaction/Commentary) เท่านั้น
04 同仓库更多 Skills
writing-plans
Write implementation plans: bite-sized tasks, paths, code.
subagent-driven-development
Execute plans via delegate_task subagents (2-stage review).
react-composition-2026
Teaches modern React composition patterns for 2025/2026. Use when designing component APIs, building shared UI libraries, or refactoring prop-heavy components.
react-2026
Provides a comprehensive guide to the modern React 2026 stack. Use when starting a new React project or modernizing an existing one with current frameworks, build tools, routing, state management, or AI integration.
plan
Plan mode: write markdown plan to .hermes/plans/, no exec.
hermes-s6-container-supervision
Modify, debug, or extend the s6-overlay supervision tree inside the Hermes Agent Docker image — adding new services, debugging profile gateways, understanding the Architecture B main-program pattern.