New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

ytgrid

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ytgrid

YTGrid is a powerful, scalable, and flexible YT automation tool that enables looped playback, remote control, and real-time tracking using a hybrid CLI + API architecture. It integrates FastAPI for REST API control, Selenium for browser automation, and Python multiprocessing/Celery for concurrent tasks.

  • 1.0.1
  • PyPI
  • Socket score

Maintainers
1

🎥 YTGrid - Hybrid CLI + API for Scalable YT Automation

License: MIT Python Version

YTGrid is a powerful, scalable, and flexible YT automation tool designed to enable looped playback, remote control, and real-time tracking using a hybrid CLI + API architecture. It provides:

  • A RESTful API built with FastAPI
  • Browser automation using Selenium (with headless Chrome)
  • Concurrent and asynchronous task execution via Celery (or Python multiprocessing)
  • Real-time session updates using Server-Sent Events (SSE)
  • A user-friendly CLI built with Typer

📌 Features

Hybrid Interface – Manage automation via CLI + API
Scalable Execution – Run multiple browser instances in parallel
Configurable Automation – Set playback speed, loop count, and more
Celery Integration – Supports both multiprocessing & Celery for task execution
Lightweight Installation – Available as a PyPI package


📦 Installation (PyPI)

YTGrid is available on PyPI. Install it using:

pip install ytgrid

Requirements:

  • Python 3.8+
  • Google Chrome
  • ChromeDriver (Automatically managed by webdriver-manager)
  • Redis (if using Celery)

🚀 CLI Usage

YTGrid provides a command-line interface (CLI) to manage automation.

Start a Session

ytgrid start --session-id test123 --url "https://www.youtube.com/watch?v=UXFBUZEpnrc" --speed 1.5 --loops 3

Check Active Sessions

ytgrid status

Stop a Session

ytgrid stop --session-id test123

Detailed Usage Instructions

ytgrid --help

🖥️ API Usage

YTGrid provides a FastAPI-based REST API.

1️⃣ Start a Session

curl -X POST "http://127.0.0.1:8000/sessions/start" \
     -H "Content-Type: application/json" \
     -d '{"url": "https://www.youtube.com/watch?v=OaOK76hiW8I", "speed": 1.5, "loop_count": 3}'

2️⃣ Check Active Sessions

curl -X GET "http://127.0.0.1:8000/sessions/status"

3️⃣ Stop a Session

curl -X POST "http://127.0.0.1:8000/sessions/stop" \
     -H "Content-Type: application/json" \
     -d '{"session_id": 1}'

🛠️ Configuration

YTGrid is configurable via environment variables.
Create a .env file in the project root:

YTGRID_HEADLESS_MODE=True
YTGRID_DEFAULT_SPEED=1.0
YTGRID_DEFAULT_LOOP_COUNT=1
YTGRID_MAX_SESSIONS=5
YTGRID_USE_TEMP_USER_DATA=True
YTGRID_BROWSER_TIMEOUT=20
YTGRID_USE_CELERY=False  # Set to True if using Celery
CELERY_BROKER_URL=redis://localhost:6379/0
CELERY_RESULT_BACKEND=redis://localhost:6379/0

🧪 Running Tests

Run unit tests using pytest:

pytest tests/

To run a specific test:

pytest tests/test_api.py

📜 License

This project is licensed under the MIT License.


🌍 Contributing

Contributions are welcome!
To contribute:

  1. Fork the repository
  2. Create a feature branch
git checkout -b feature/my-feature
  1. Commit your changes
  2. Push to your fork and create a PR

📖 Additional Resources


FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc