Skip to content

longtimeno-c/Stream150Server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Stream150Server

A real-time streaming platform that supports live chat from both Twitch and YouTube, featuring chat overlay, polls, and highlights.

Features

  • Multi-platform chat integration (Twitch & YouTube)
  • Interactive polls
  • Stream highlights
  • HLS streaming support
  • WebSocket-based real-time updates

Prerequisites

  • Node.js (v14 or higher)
  • Python 3.8 or higher
  • FFmpeg
  • PM2 (for process management)

Installation

  1. Clone the repository:

  2. Install Node.js dependencies:

npm install
  1. Set up Python virtual environment:
python -m venv myenv
source myenv/bin/activate  # On Linux/Mac
# or
myenv\Scripts\activate  # On Windows
  1. Install Python dependencies:
pip install python-dotenv twitchio aiohttp websocket-client
  1. Create a .env file in the root directory with your credentials:
# Twitch Configuration
TWITCH_CHANNEL=your_twitch_channel
TWITCH_TOKEN=your_twitch_oauth_token

# YouTube Configuration
YOUTUBE_API_KEY=your_youtube_api_key
YOUTUBE_CHANNEL_ID=your_youtube_channel_id

# Stream Configuration
STREAM_KEY=your_stream_key

# Admin Configuration
ADMIN_USERNAME=your_admin_username  # Username with admin privileges for managing highlights

Configuration

Environment Variables

The following environment variables must be set in your .env file:

Twitch Configuration

YouTube Configuration

  • YOUTUBE_API_KEY: Your YouTube API key (get from Google Developer Console)
  • YOUTUBE_CHANNEL_ID: Your YouTube channel ID

Stream Configuration

  • STREAM_KEY: Your stream key (defaults to 'StreamtoME' if not set)

Admin Configuration

  • ADMIN_USERNAME: Username with administrative privileges for managing highlights and other admin-only features

Stream Key

The stream key is configured through the STREAM_KEY environment variable in your .env file. If not set, it defaults to StreamtoME. This key is used for RTMP authentication and HLS stream paths.

Running the Server

  1. Start the Node.js server:
npm i
npm start
# or
node server.js
  1. Start the chat overlay service:
# Activate virtual environment
source myenv/bin/activate  # On Linux/Mac
# or
myenv\Scripts\activate  # On Windows

# Run with PM2 (recommended for production)
pm2 start myenv/bin/python --name "chat-overlay" -- chat_overlay.py

# Or run directly
python chat_overlay.py

Stream URLs

  • RTMP URL: rtmp://localhost:1935/live
  • HLS URL: http://localhost:8000/live/StreamtoME/index.m3u8
  • Web Interface: http://localhost:3001

Development

Project Structure

Stream150Server/
├── public/           # Static files and frontend
├── server/          # Server-side modules
├── data/           # Data storage
├── media/          # Media files
├── server.js       # Main server file
├── chat_overlay.py # Chat integration service
└── .env            # Environment variables

Adding New Features

  1. Create a new branch:
git checkout -b feature/your-feature-name
  1. Make your changes and commit:
git add .
git commit -m "Add your feature"
  1. Push to remote:
git push origin feature/your-feature-name

Troubleshooting

Common Issues

  1. Chat Overlay Not Working

    • Check if the .env file is properly configured
    • Verify Twitch and YouTube credentials
    • Check WebSocket connection in browser console
  2. Stream Not Starting

    • Verify FFmpeg is installed
    • Check RTMP server logs
    • Ensure correct stream key is being used
  3. Poll System Issues

    • Check server logs for WebSocket errors
    • Verify database connection
  4. Admin Access Issues

    • Verify ADMIN_USERNAME is correctly set in .env
    • Check that you're logged in with the correct username
    • Clear browser cache if changes don't take effect

Contributing

  1. Fork the repository
  2. Create your feature branch
  3. Commit your changes
  4. Push to the branch
  5. Create a new Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

Stream150 Live Streaming Platform

Resources

License

Stars

Watchers

Forks