Skip to content

About

No description, website, or topics provided.

Resources

Stars

3 stars

Watchers

0 watching

Forks

Repository files navigation

Crossposting

A local web application for managing and cross-posting short-form video content (TikTok, YouTube Shorts, Instagram Reels) across multiple social media platforms from a single interface.

Features

  • Multi-Platform Posting: Upload videos to TikTok, YouTube Shorts, and Instagram Reels simultaneously
  • Multi-Account Support: Connect and manage multiple accounts per platform
  • Unified Interface: Single dashboard for creating posts with platform-specific options
  • Upload History: Track all your uploads and their status
  • OAuth Authentication: Secure YouTube authentication via Google OAuth 2.0
  • Session Management: Persistent sessions for TikTok and Instagram

Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    Next.js Web App (3000)                   β”‚
β”‚                   React UI + API Routes                     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                              β”‚
          β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
          β–Ό                   β–Ό                   β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ TikTok Service  β”‚ β”‚ YouTube Service β”‚ β”‚Instagram Serviceβ”‚
β”‚   (Port 8000)   β”‚ β”‚   (Port 8002)   β”‚ β”‚   (Port 8001)   β”‚
β”‚     FastAPI     β”‚ β”‚     FastAPI     β”‚ β”‚     FastAPI     β”‚
β”‚ Selenium/Chrome β”‚ β”‚ YouTube API v3  β”‚ β”‚   Instagrapi    β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Quick Start with Docker

Prerequisites

1. Clone the Repository

git clone https://github.com/yourusername/crossposting.git
cd crossposting

2. Set Up YouTube Credentials

Copy your Google OAuth client_secret.json file to the YouTube service directory:

cp /path/to/your/client_secret.json services/youtube-uploader/client_secret.json

See YouTube Setup for instructions on obtaining these credentials.

3. Start All Services

docker compose up --build

This will start:

4. Access the App

Open http://localhost:3000 in your browser.

Manual Setup (Without Docker)

Prerequisites

  • Node.js 20+
  • Python 3.11+
  • Google Chrome (for TikTok service)

1. Install Next.js Dependencies

npm install

2. Set Up Python Services

Each service needs its own virtual environment:

# TikTok Uploader
cd services/tiktok-uploader
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
pip install -r requirements.txt
deactivate
cd ../..

# YouTube Uploader
cd services/youtube-uploader
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
deactivate
cd ../..

# Instagram Uploader
cd services/instagram-uploader
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
deactivate
cd ../..

3. Start All Services

Open 4 terminal windows:

Terminal 1 - Next.js App:

npm run dev

Terminal 2 - TikTok Service:

cd services/tiktok-uploader
source venv/bin/activate
python main.py

Terminal 3 - YouTube Service:

cd services/youtube-uploader
source venv/bin/activate
python main.py

Terminal 4 - Instagram Service:

cd services/instagram-uploader
source venv/bin/activate
python main.py

Platform Setup

YouTube Setup

YouTube requires Google OAuth 2.0 credentials:

  1. Go to the Google Cloud Console
  2. Create a new project or select an existing one
  3. Enable the YouTube Data API v3:
    • Navigate to "APIs & Services" > "Library"
    • Search for "YouTube Data API v3" and enable it
  4. Create OAuth 2.0 credentials:
    • Go to "APIs & Services" > "Credentials"
    • Click "Create Credentials" > "OAuth client ID"
    • Choose "Desktop app" as the application type
    • Download the credentials JSON file
  5. Rename the file to client_secret.json and place it in services/youtube-uploader/
  6. Add your Google account as a test user:
    • Go to "OAuth consent screen"
    • Under "Test users", add the email address you'll use to authenticate

TikTok Setup

TikTok uses session-based authentication via browser cookies:

  1. Log in to TikTok in your browser
  2. Press F12 to open Developer Tools
  3. Go to Application tab β†’ Cookies β†’ https://www.tiktok.com
  4. Find and copy the sessionid value
  5. In the app, go to "Accounts" and click "Connect TikTok Account"
  6. Paste the sessionid when prompted

Instagram Setup

Instagram uses username/password authentication:

  1. In the app, go to "Accounts" and click "Connect Instagram Account"
  2. Enter your Instagram username and password
  3. If 2FA is enabled, you'll be prompted for the verification code

Note: Using Instagram's private API may violate their Terms of Service. Use at your own risk.

Usage

Creating a Post

  1. Go to the home page (Dashboard)
  2. Upload your video file (MP4, MOV, or WebM, max 500MB)
  3. Add a caption and hashtags
  4. Select which platforms and accounts to post to
  5. Click "Post" to upload to all selected platforms

Managing Accounts

  1. Go to the "Accounts" page
  2. Click "Connect Account" for each platform
  3. Follow the authentication flow for each platform
  4. Connected accounts will appear in the platform section

Viewing History

  1. Go to the "History" page
  2. View all past uploads with their status
  3. Filter by platform or status

Development

Project Structure

crossposting/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ app/                 # Next.js App Router pages
β”‚   β”‚   β”œβ”€β”€ api/upload/      # API routes (proxy to Python services)
β”‚   β”‚   β”œβ”€β”€ accounts/        # Account management page
β”‚   β”‚   └── history/         # Upload history page
β”‚   β”œβ”€β”€ components/          # React components
β”‚   β”‚   β”œβ”€β”€ dashboard/       # Post creation UI
β”‚   β”‚   β”œβ”€β”€ accounts/        # Account management UI
β”‚   β”‚   β”œβ”€β”€ history/         # History display UI
β”‚   β”‚   └── ui/              # Radix UI components
β”‚   β”œβ”€β”€ lib/
β”‚   β”‚   β”œβ”€β”€ services/        # Platform service clients
β”‚   β”‚   └── constants.ts     # Platform configurations
β”‚   └── types/               # TypeScript interfaces
β”œβ”€β”€ services/
β”‚   β”œβ”€β”€ tiktok-uploader/     # FastAPI service (port 8000)
β”‚   β”œβ”€β”€ youtube-uploader/    # FastAPI service (port 8002)
β”‚   └── instagram-uploader/  # FastAPI service (port 8001)
β”œβ”€β”€ docker-compose.yml       # Docker orchestration
└── Dockerfile               # Next.js Docker build

Commands

# Development
npm run dev          # Start Next.js dev server
npm run build        # Production build
npm run lint         # Run ESLint

# Docker
docker compose up    # Start all services
docker compose down  # Stop all services
docker compose build # Rebuild images

Environment Variables

The Next.js app uses these environment variables (with defaults for local development):

Variable Default Description
TIKTOK_SERVICE_URL http://localhost:8000 TikTok service URL
YOUTUBE_SERVICE_URL http://localhost:8002 YouTube service URL
INSTAGRAM_SERVICE_URL http://localhost:8001 Instagram service URL

Contributing

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/my-feature
  3. Make your changes
  4. Run linting: npm run lint
  5. Commit your changes: git commit -m 'Add my feature'
  6. Push to the branch: git push origin feature/my-feature
  7. Open a Pull Request

Code Style

  • TypeScript with strict mode enabled
  • ESLint with Next.js recommended rules
  • Use @/* path alias for imports from src/
  • Follow existing component patterns

Troubleshooting

TikTok Upload Fails

  • Session expired: TikTok sessions expire periodically. Re-export your sessionid cookie and update it in the app.
  • Chrome not found: Ensure Google Chrome is installed. In Docker, Chrome is included in the image.
  • Detection/Captcha: TikTok may detect automation. Try using a fresh Chrome profile.

YouTube Upload Fails

  • Token expired: The app automatically refreshes tokens, but if issues persist, disconnect and reconnect your YouTube account.
  • Quota exceeded: YouTube API has daily quotas. Wait 24 hours or check your quota in Google Cloud Console.
  • Video too short: YouTube Shorts must be between 15-60 seconds.

Instagram Upload Fails

  • Challenge required: Instagram may require verification. Log in via the official app to clear challenges.
  • Rate limited: Wait a few hours before trying again.
  • 2FA issues: Make sure you're entering the correct verification code.

Docker Issues

  • Port already in use: Stop other services using ports 3000, 8000, 8001, or 8002.
  • Permission denied: On Linux, you may need to run Docker commands with sudo or add your user to the docker group.
  • Build fails: Try docker compose build --no-cache to rebuild from scratch.

License

MIT License - see LICENSE for details.

Disclaimer

This tool uses unofficial APIs for TikTok and Instagram. Using these services may violate their Terms of Service. Use at your own risk. The developers are not responsible for any account bans or other consequences.

About

No description, website, or topics provided.

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages