npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

n8n-nodes-tiktok-uploader

v1.0.5

Published

N8n custom nodes for TikTok video upload with anti-detect browser support

Readme

N8N TikTok Nodes

Custom n8n nodes cho phép upload video lên TikTok.

Cài đặt

npm install n8n-tiktok
# hoặc
npm install ./path/to/tiktok-nodes

QUAN TRỌNG: X-Bogus Signature

TikTok sử dụng X-BogusX-Gnarly signatures để xác thực request. Các signatures này theo từng URL cụ thể và không thể tái sử dụng. Khi gọi API TikTok trực tiếp, bạn sẽ nhận được:

{"status_code":0,"status_msg":"url doesn't match"}

Giải pháp

Để sử dụng trong production, bạn cần:

  1. Sử dụng Puppeteer/Playwright - Browser headless tạo signatures hợp lệ động
  2. Sử dụng TikTok Creator API - API chính thức với OAuth authentication (cần duyệt)

Triển khai hiện tại trích xuất tất cả dữ liệu cần thiết từ session nhưng không thể bypass TikTok's signature validation.

Anti-Detect Browser Support

Node này hỗ trợ kết nối với các trình duyệt anti-detect để tránh bị TikTok phát hiện automation.

Kiến trúc 3 lớp

Automation (n8n node)
        ↓
Anti-detect browser profile
        ↓
TikTok Mobile/Web API

Các trình duyệt được hỗ trợ

| Trình duyệt | Giá trị | Port mặc định | |-------------|---------|---------------| | Multilogin | multilogin | 35000 | | AdsPower | adspower | 50300 | | GoLogin | gologin | 3030 | | GemLogin | gemlogin | 19918 | | Custom | custom | Tùy chỉnh |

Cấu hình Anti-Detect

  1. Cài đặt và chạy trình duyệt anti-detect (GemLogin, Multilogin, v.v.)
  2. Tạo profile browser cho TikTok
  3. Cấu hình credentials với:
    • Browser Type: Chọn loại trình duyệt (GemLogin, Multilogin, etc.)
    • Browser Profile ID: ID của profile trong trình duyệt anti-detect
    • Connection String: URL API endpoint (vd: http://127.0.0.1:19918)

Credentials

TikTok Session

Dán full TikTok session JSON được export từ browser developer tools.

Các trường được trích xuất:

  • Cookies (sessionid, uid_tt, csrf token, etc.)
  • Device ID
  • User ID
  • X-Bogus và X-Gnarly signatures (theo URL, sử dụng hạn chế)

Cấu hình Anti-Detect Browser

Trong phần credentials TikTok Session:

Browser Type: GemLogin (hoặc trình duyệt bạn dùng)
Browser Profile ID: [ID từ profile trong GemLogin]
Connection String: http://127.0.0.1:19918

TikTok API Key

Tự động trích xuất các thành phần API key từ session JSON.

Nodes

TikTok Video

Upload video lên TikTok với các tùy chọn:

  • Phương thức Upload

    • Puppeteer (Khuyên dùng): Sử dụng browser headless để upload
    • Direct API: Gọi API trực tiếp (có thể thất bại do X-Bogus)
  • Cài đặt bài đăng

    • Caption: Nội dung caption video
    • Visibility: Công khai/Bạn bè/Riêng tư
    • Allow Comments: Bật/Tắt bình luận
    • Schedule Time: Thời gian đăng (Unix Epoch timestamp)
  • Đầu vào Video

    • Binary: Chọn trường binary chứa video
    • File Path: Đường dẫn tới file video
  • Đầu vào Cover

    • None: Không có cover tùy chỉnh
    • Binary: Chọn trường binary chứa ảnh cover
    • File Path: Đường dẫn tới ảnh cover

Cách sử dụng

  1. Tạo credentials bằng cách dán TikTok Session JSON
  2. Thêm node TikTok Video vào workflow
  3. Cấu hình credentials với anti-detect browser (tùy chọn)
  4. Cài đặt post settings và video input
  5. Chạy workflow

Lấy TikTok Session

  1. Mở TikTok trong browser
  2. Mở Developer Tools (F12)
  3. Chuyển sang tab Network
  4. Thực hiện bất kỳ request nào tới tiktok.com
  5. Right-click → Copy → Copy as cURL
  6. Chuyển đổi sang JSON hoặc trích xuất cookies thủ công

Response

Node sẽ trả về:

{
  "success": true/false,
  "message": "...",
  "videoUrl": "https://www.tiktok.com/@user/video/...",
  "videoId": "...",
  "error": "..."
}

Khắc phục sự cố

Lỗi "Session expired"

  • Session TikTok đã hết hạn
  • Đăng nhập lại và lấy session mới

Lỗi "X-Bogus signature"

  • Sử dụng phương thức Puppeteer thay vì Direct API
  • Hoặc bật anti-detect browser để tránh bị phát hiện

Lỗi kết nối Anti-Detect

  • Kiểm tra trình duyệt anti-detect đang chạy
  • Kiểm tra port và connection string chính xác
  • Kiểm tra profile ID đúng

Yêu cầu

  • Node.js 18+
  • n8n
  • Puppeteer (đã bao gồm)
  • Trình duyệt anti-detect (tùy chọn): GemLogin, Multilogin, AdsPower, hoặc GoLogin