README
ΒΆ
Banned - banned.video Content Manager
A comprehensive command-line tool for downloading and managing content from https://banned.video. This tool provides an interactive Terminal User Interface (TUI) for browsing channels, fetching video metadata, and managing downloads with advanced features like recursive fetching and torrent creation.
π Features
- Interactive TUI: Browse channels and videos with a beautiful terminal interface
- Recursive Video Fetching: Automatically fetch all videos from channels with pagination support
- High Performance: Optimized for bulk operations (~103 videos/second)
- Database Management: SQLite database for local storage and caching
- Torrent Support: Create .torrent files from downloaded videos
- Smart Installation: Multiple installation methods with PATH management
- Self-Updating: Built-in update mechanism from source repositories
π¦ Installation
One-Line Install (Recommended)
Linux/macOS:
curl -sSL https://github.com/daniel-le97/banned-cli/releases/latest/download/install.sh | bash
Windows (PowerShell):
iwr -useb https://github.com/daniel-le97/banned-cli/releases/latest/download/install.ps1 | iex
Manual Download
Download the latest release for your platform from: GitHub Releases
From Go
go install github.com/daniel-le97/banned-cli@latest
From Source
git clone https://github.com/daniel-le97/banned-cli
cd banned-cli
go build -o banned .
π― Quick Start
Interactive Mode
# Launch interactive TUI (default when no arguments)
banned
# Or explicitly
banned --interactive
Initialize Database
banned db init
Fetch All Channels
banned fetch channels
Browse Channels Interactively
banned list-channels
π Commands Reference
Root Command
banned [--interactive]
- Launches interactive TUI when no subcommands provided
- Use
--interactiveflag to force interactive mode
Fetch Commands
banned fetch channels
Fetch all available channels from banned.video API and store in database.
banned fetch channels
banned fetch channel <channel-id>
Fetch specific channel details and videos with options for recursive fetching.
# Fetch first 50 videos (default)
banned fetch channel 12345
# Fetch ALL videos recursively (recommended for complete data)
banned fetch channel 12345 --all
# Fetch specific number of videos
banned fetch channel 12345 --limit 1000
# Examples
banned fetch channel 12345 --all # Fetch all videos
banned fetch channel 607 --limit 500 # Fetch up to 500 videos
banned fetch channel alex-jones --all # Works with channel slugs too
Performance Notes:
- Default: Fetches 50 videos per request
--all: Recursively fetches until no new videos (recommended)--limit N: Sets maximum videos to fetch- Optimized batching: 200-video API calls, 50-video DB batches
- Displays elapsed time and performance metrics
Sync Commands (Incremental Updates)
banned sync all
Perform a complete incremental sync of all channels and videos.
banned sync all
This will:
- Sync any new/updated channels
- For each channel, sync only new videos published since the last sync
- Show detailed progress and statistics
Benefits:
- Much faster than full fetches (only gets new data)
- Reduces API load and bandwidth usage
- Perfect for regular updates with pre-populated database
banned sync channels
Sync only new/updated channels.
banned sync channels
banned sync channel <channel-id>
Sync new videos for a specific channel based on timestamps.
# Sync only new videos for a channel
banned sync channel alex-jones
banned sync channel 5b885d33e6646a0015a6fa2d
How it works:
- Checks your database for the most recent video timestamp
- Fetches only videos published after that timestamp
- Automatically fetches file sizes for new videos in background
- Efficiently updates your local cache without re-downloading
Options:
# Skip file size fetching for faster sync (useful for large batches)
banned sync channel alex-jones --skip-file-sizes
banned sync all --skip-file-sizes
Database Commands
banned db init
Initialize the database and create all necessary tables.
banned db init
banned db status
Show database connection status and statistics.
banned db status
Displays:
- Database location and connection status
- Table counts (channels, videos, downloads)
- Storage usage and performance metrics
banned db settings
Display all current settings stored in the database.
banned db settings
Interactive Browsing
banned list-channels
Launch interactive TUI for browsing channels with search functionality.
banned list-channels
Features:
- Search channels by name (type to filter)
- Navigate with arrow keys or vim-style (j/k)
- Press Enter to fetch videos for selected channel
- Press 'q' to quit, '/' to search
Torrent Commands
banned torrent create [files...]
Create torrent files from video files.
# Single file
banned torrent create video.mp4
# Multiple files
banned torrent create video1.mp4 video2.mp4
# With custom tracker
banned torrent create video.mp4 --tracker "udp://custom.tracker.com:8080/announce"
# With custom piece size (default: 256KB)
banned torrent create video.mp4 --piece-length 512
banned torrent batch [directory]
Create torrents for all videos in a directory recursively.
# Current directory
banned torrent batch
# Specific directory
banned torrent batch /path/to/videos
# With custom tracker for all torrents
banned torrent batch /path/to/videos --tracker "udp://my.tracker.com:80/announce"
Application Management
banned app install
Install the application to PATH with multiple methods.
# Interactive installation (choose method)
banned app install
# Force symlink method
banned app install --symlink
# Force shell profile method
banned app install --profile
banned app update
Update the application to the latest version.
# Update from default source
banned app update
# Update from specific repository
banned app update --source github.com/yourusername/cli-aj@latest
# Update from custom Git URL
banned app update --source "https://github.com/yourusername/cli-aj.git"
Download Commands
banned download
Download video content (implementation varies based on requirements).
banned download [options]
ποΈ Database Schema
The application uses SQLite with the following tables:
- channels: Channel metadata (id, name, slug, description, etc.)
- videos: Video metadata (id, title, channel_id, duration, etc.)
- downloads: Download tracking and status
- settings: Application configuration and preferences
βοΈ Configuration
Database Location
- Linux/macOS:
~/.local/share/banned/banned.db - Windows:
%APPDATA%\banned\banned.db - Current Directory:
./banned.db(fallback)
Default Settings
- Download Directory:
~/Downloads/banned/ - API Endpoint:
https://api.banned.video/graphql - User Agent:
banned/1.0 - Torrent Piece Length: 256KB
- Default Trackers: Multiple public BitTorrent trackers
π§ Advanced Usage
Batch Operations
# Fetch all channels, then recursively fetch all videos
banned fetch channels
banned fetch channel --all $(banned db status | grep -o '[0-9]* channels' | cut -d' ' -f1)
# Create torrents for all downloaded videos
banned torrent batch ~/Downloads/banned/
Performance Optimization
# For large channels, use --all flag for optimal API usage
banned fetch channel large-channel-id --all
# Monitor performance with timing
time banned fetch channel alex-jones --all
Scripting Integration
#!/bin/bash
# Automated content sync script
banned db init
banned fetch channels
for channel in $(banned list-channels --json | jq -r '.[] | .id'); do
banned fetch channel $channel --all
done
π Troubleshooting
Common Issues
Database Locked Warnings
SQLITE_BUSY warnings during high-throughput operations
Solution: These warnings are normal under heavy load and are handled gracefully with retry logic.
Go Environment Issues
# Check Go installation
go version
# Verify GOPATH/GOBIN
echo $GOPATH
echo $GOBIN
Performance Concerns
- 15K videos in ~2.4 minutes is normal performance
- Use
--allflag for optimal API rate limit usage - Database operations are optimized with batched transactions
Debug Mode
# Enable verbose logging (if implemented)
banned --verbose fetch channel 12345 --all
# Check database status for issues
banned db status
π€ Development
Building from Source
git clone https://github.com/yourusername/cli-aj
cd cli-aj
go mod download
go build -o banned .
Dependencies
- Cobra CLI: Command-line interface framework
- Bubble Tea: Terminal UI framework
- SQLite: Database storage
- GraphQL: API client for banned.video
Project Structure
βββ cmd/ # Command implementations
β βββ root.go # Root command and CLI setup
β βββ fetch.go # Data fetching commands
β βββ db.go # Database operations
β βββ tui.go # Interactive terminal UI
β βββ ...
βββ main.go # Application entry point
βββ go.mod # Go module definition
βββ README.md # This file
π License
This project is licensed under the MIT License - see the LICENSE file for details.
π Links
- banned.video: https://banned.video
- API Documentation: https://api.banned.video/graphql
- Issues: Report bugs and feature requests
- Contributing: Pull requests welcome
Note: This tool is for educational and archival purposes. Please respect the terms of service of banned.video and applicable copyright laws.