English version 🇺🇸🇬🇧🇮🇳
🔧 Requirements • 🚀 How to Use • 🌐 HTTPS Callback via ngrok • 📤 Publishing Features
- Python 3.7+
- A TikTok Developer Account
- A public HTTPS callback URL (required for TikTok OAuth)
You can use ngrok to generate a secure public HTTPS URL to your local Flask server.
- Create a free ngrok account
- Download ngrok and unzip the executable
- Authenticate ngrok with your account token:
ngrok config add-authtoken YOUR_NGROK_AUTH_TOKEN- Start a tunnel on port 8080 (used by Flask):
ngrok http 8080- Copy the HTTPS URL generated by ngrok. It will look like:
https://abcd1234.ngrok-free.app/callback
- Use this full URL in two places:
- On the TikTok Developer Portal
- Paste it into the
.envfile:
REDIRECT_URI=https://abcd1234.ngrok-free.app/callback
Go to https://developers.tiktok.com and:
- Log in with your TikTok account
- Go to Developer Portal → Manage App → Create App
- Change your app to SANDBOX
- Go to Products → Add Products → Create App
- Enable Login Kit and Content Posting
- Go to Basic information and select Web under Platforms
- Enter any link in "Configure for Web/Desktop"
- Go to Products → Login Kit and paste your ngrok link in Redirect URI
- Copy your Client Key and Client Secret
- Fill in the rest of the required fields with placeholder data
- Paste both keys in your
.envfile:
CLIENT_KEY=your_key
CLIENT_SECRET=your_secret
Woohoo! All set, let's run it 🚀
pip install -r requirements.txtAdd these optional settings to your .env file:
# Optional publishing settings
DEFAULT_VIDEO_TITLE=My amazing video!
DEFAULT_PRIVACY_LEVEL=SELF_ONLY
AUTO_PUBLISH=false
Privacy levels:
SELF_ONLY= Only meMUTUAL_FOLLOW_FRIENDS= FriendsPUBLIC= Public
The project now supports automatic video publishing with these features:
- Manual Publishing: Choose whether to publish after upload
- Custom Titles: Set video titles during publishing
- Privacy Control: Choose privacy level (Private, Friends, Public)
- Auto Publishing: Configure automatic publishing in
.env - Default Settings: Set default title and privacy in
.env
🔧 Requisitos • 🚀 Como Usar • 🌐 Callback HTTPS com ngrok • 📤 Funcionalidades de Publicação
- Python 3.7+
- Conta de desenvolvedor TikTok
- Uma URL HTTPS pública para callback (necessária para o OAuth)
Você pode usar o ngrok para gerar um link HTTPS público seguro para seu servidor Flask local.
- Crie uma conta gratuita no ngrok
- Baixe o ngrok e descompacte o executável
- Autentique o ngrok com seu token:
ngrok config add-authtoken SEU_TOKEN_DO_NGROK- Inicie um túnel na porta 8080 (usada pelo Flask):
ngrok http 8080- Copie a URL HTTPS gerada. Vai parecer com isso:
https://abcd1234.ngrok-free.app/callback
- Use essa URL completa em dois lugares:
- No portal de desenvolvedor do TikTok
- No arquivo
.env:
REDIRECT_URI=https://abcd1234.ngrok-free.app/callback
Acesse https://developers.tiktok.com e:
- Faça login com sua conta TikTok
- Vá em Developer Portal → Manage App → Create App
- Altere o app para SANDBOX
- Vá em Products → Add Products → Create App
- Ative Login Kit e Content Posting
- Em Basic information, selecione Web como plataforma
- Insira qualquer link em "Configure for Web/Desktop"
- Vá em Products → Login Kit e cole o link do ngrok em Redirect URI
- Copie seu Client Key e Client Secret
- Preencha o resto dos campos obrigatórios com dados fictícios
- E cole no
.env:
CLIENT_KEY=sua_key
CLIENT_SECRET=seu_secret
Oba! Tudo pronto, bora rodar 🚀
pip install -r requirements.txtAdicione estas configurações opcionais ao seu arquivo .env:
# Configurações opcionais para publicação
DEFAULT_VIDEO_TITLE=Meu vídeo incrível!
DEFAULT_PRIVACY_LEVEL=SELF_ONLY
AUTO_PUBLISH=false
Níveis de privacidade:
SELF_ONLY= Só euMUTUAL_FOLLOW_FRIENDS= AmigosPUBLIC= Público
O projeto agora suporta publicação automática de vídeos com estas funcionalidades:
- Publicação Manual: Escolha se quer publicar após o upload
- Títulos Personalizados: Defina títulos dos vídeos durante a publicação
- Controle de Privacidade: Escolha nível de privacidade (Privado, Amigos, Público)
- Publicação Automática: Configure publicação automática no
.env - Configurações Padrão: Defina título e privacidade padrão no
.env
python main.pyO programa irá:
- 🔐 Abrir o navegador para autenticação OAuth
- 📤 Fazer upload do vídeo
- ❓ Perguntar se deseja publicar
- 📝 Permitir configurar título e privacidade
- 🚀 Publicar o vídeo (se escolhido)
- Configure seu
.envcom as credenciais - Inicie o ngrok:
ngrok http 8080 - Execute:
python main.py - Autorize no navegador
- Escolha se quer publicar
- Configure título e privacidade
- ✅ Vídeo publicado!
