TikTok Video Uploader
Python toolkit for uploading videos to TikTok through a real browser session and browser-authenticated state.
This project uses Playwright and interacts with TikTok through the web UI. It is not an official TikTok API client.
Features
- Upload a single video or multiple videos in one run
- Set a description and optional visibility (
everyone,friends,only_you) - Authenticate with a cookies file, session ID, cookies list/string, or username/password
- Use it from the CLI or import it as a Python library
- Works with Chromium, Chrome, Firefox, WebKit, and Edge via Playwright
Requirements
- Python 3.12+
- Playwright browser binaries installed
- A valid TikTok account with usable cookies or a session
Installation
python -m pip install -e .
python -m playwright install
For local development:
python -m pip install -e '.[dev]'
Quick start
Supported options
| Option | CLI form | Python form | Purpose |
|---|---|---|---|
| video | -v, --video |
filename |
Path to the video file |
| description | -d, --description |
description |
Caption / text for the post |
| visibility | --visibility |
visibility |
Optional visibility: everyone, friends, only_you |
| proxy | --proxy |
proxy |
Proxy in user:pass@host:port or host:port format |
| cookies | -c, --cookies |
cookies |
Path to a cookies file |
| sessionid | -s, --sessionid |
sessionid |
TikTok session ID |
| username | -u, --username |
username |
TikTok login name or email |
| password | -p, --password |
password |
TikTok password |
| browser | --browser |
browser |
Browser engine: chromium, chrome, firefox, webkit, edge |
| attach | -a, --attach |
headless=False |
Open browser window instead of headless mode |
| verbose | -V, --verbose |
logging config | Extra debug output |
Command structure
tiktok-uploader -v <video_path> -d "<description>" -c <cookies.txt> [--visibility <everyone|friends|only_you>] [--proxy <proxy>] [--browser <browser>] [--attach] [-V]
Examples:
tiktok-uploader -v video.mp4 -d "Hello from TikTok uploader #python" -c cookies.txt
tiktok-uploader -v video.mp4 -d "Only for friends" -c cookies.txt --visibility friends --attach
tiktok-uploader -v video.mp4 -d "Upload via browser session" -s <sessionid> --browser chromium -V
Python library
from tiktok_video_uploader import TikTokUploader
uploader = TikTokUploader(cookies='cookies.txt', headless=False)
result = uploader.upload_video(
filename='video.mp4',
description='My first upload from Python #python #tiktok',
visibility='friends',
)
print('Upload success:', result)
Batch upload
from tiktok_video_uploader import TikTokUploader
from tiktok_video_uploader.types import VideoDict
videos: list[VideoDict] = [
{'path': 'video1.mp4', 'description': 'First upload #python'},
{'path': 'video2.mp4', 'description': 'Second upload #automation', 'visibility': 'friends'},
]
uploader = TikTokUploader(cookies='cookies.txt', headless=False)
failed = uploader.upload_videos(videos)
print(f'Failed uploads: {failed}')
CLI help
python -m tiktok_video_uploader --help
Or after installing the package:
tiktok-uploader --help
Authentication
The library supports:
- cookies file (
--cookies/cookies=) - session ID (
--sessionid/sessionid=) - cookies list or cookies string
- username + password
Using a real browser session and cookies is the most reliable option because TikTok login and upload flow depend on browser state.
Notes
- This project does not use an official TikTok public API.
- It relies on browser automation and user-authenticated browser state.
- TikTok selectors can change, so uploads may require periodic updates.
- Use only with your own account and in line with TikTok rules and platform policies.
- Legacy toggles like old “AI”, “allow-comment”, or “allow-reuse” flags are intentionally not part of the current interface.
Example scripts
Scripts are available in the examples folder:
- examples/basic_upload.py
- examples/multiple_videos_at_once.py
- examples/private_upload.py
- examples/series_upload.py
License
This project is licensed under the MIT License. See LICENSE for details.
Repository
Metadata
Release files for tiktok-video-uploader 1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| tiktok_video_uploader-1.1.tar.gz | 22.5 kB | Without provenance | Details for tiktok_video_uploader-1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| tiktok_video_uploader-1.1-py3-none-any.whl | Python 3 | none | any | Details for tiktok_video_uploader-1.1-py3-none-any.whl |
Total release size: 45.4 kB
Release files / tiktok_video_uploader-1.1.tar.gz
| Download URL | tiktok_video_uploader-1.1.tar.gz |
|---|---|
| Size | 22.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
de50656049f2e7fe9c56f5dfe7cc181b04eb42a348dc68bbe4f3945c0ea95134
|
|
BLAKE2b-256 checksum How to use checksums |
379438733c292224ff997f696eae03e335390e4ae7770632210ce64c50397e98
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Release files / tiktok_video_uploader-1.1-py3-none-any.whl
| Download URL | tiktok_video_uploader-1.1-py3-none-any.whl |
|---|---|
| Size | 22.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
89889baa00d4a502d6d50aa49652392485b1547e461b54cd61f51b85f1b15169
|
|
BLAKE2b-256 checksum How to use checksums |
9fefdbce9ae30ec47dbbab09a0d324d0414257fc7abe55b2d314ea4d7914ebde
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Security for tiktok-video-uploader 1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.