Skip to content

An automated Docker-based tool for downloading rPlay live streams with multi-stream monitoring and custom naming.

License

Notifications You must be signed in to change notification settings

Zhen-Bo/rplay-live-dl

Repository files navigation

RPLAY-LIVE-DL

❯ An automated Docker-based tool for downloading rPlay live streams with multi-stream monitoring and custom naming.

license last-commit repo-top-language repo-language-count

Built with the tools and technologies:

Docker Python Poetry Pydantic ffmpeg



πŸ“‘ Table of Contents


πŸ“ Description

rplay-live-dl is a easily deployable solution for recording Rplay live stream content. The system regularly checks streaming status based on a user-configured list of content creators and automatically initiates recording when streams begin. All recorded content is organized by creator name for efficient management and retrieval.


✨ Features

  • Automated live stream monitoring and downloading system built with Python
  • Docker container deployment support for consistent runtime environment
  • Customizable monitoring intervals
  • Simultaneous monitoring of multiple streamers
  • Automated file management with creator-based organization
  • Environment variable configuration for deployment flexibility

❗ Known Issues

  • πŸ’© doc
  • πŸ’© & completely untested code
  • Logger will πŸ’© around in logs folder
  • Can't handle M3U8 404 Error (EX: useBonusCoinTicket, useSecretKey...)

πŸ“˜ Usage Guide

System Requirements

Production Requirements:

  • Docker environment
  • Valid Rplay platform account
  • Sufficient storage space
  • Stable network connection

Development Requirements:

  • Python environment
  • Package manager (pip or poetry)
  • FFmpeg installed

Obtaining Credentials

AUTH_TOKEN

  1. Log into Rplay.live
  2. Open browser DevTools (F12)
  3. Execute: localStorage.getItem('_AUTHORIZATION_')
  4. Copy the returned token auth_token

USER_OID

  1. Visit https://rplay.live/myinfo/
  2. Copy your User Number user_oid

Creator ID

  1. Visit creator's profile
  2. Open DevTools > Network
  3. Refresh page and search for "CreatorOid"
  4. Copy the creator's ID creator_oid

Configuration

  1. Environment Setup (.env):

    INTERVAL=check interval in seconds
    USER_OID=your user number
    AUTH_TOKEN=JWT authentication token
    
  2. Creator Configuration (config.yaml):

    creators:
        - name: "Creator Nickname 1"
          id: "Creator ID 1"
        - name: "Creator Nickname 2"
          id: "Creator ID 2"

Deployment

Using Docker Compose (recommended):

# Start recording
docker-compose up -d

# View logs
docker-compose logs -f

# Stop recording
docker-compose down

# Update application
docker-compose pull
docker-compose up -d

Using Docker directly:

docker run -d \
  -v $(pwd)/.env:/app/.env \
  -v $(pwd)/config.yaml:/app/config.yaml \
  -v $(pwd)/archive:/app/archive \
  -v $(pwd)/logs:/app/logs \
  rplay-live-dl

Directory Structure

rplay-live-dl/
β”œβ”€β”€ archive/              # Recorded streams
β”‚   └── [Creator Name]/   # Organized by creator
β”œβ”€β”€ config.yaml           # Creator configuration
β”œβ”€β”€ .env                  # Environment variables
└── logs/                 # Application logs

Troubleshooting

Common Issues

  1. Stream Not Recording

    • Verify AUTH_TOKEN is valid
    • Check creatorOid is correct
    • Ensure sufficient disk space
  2. M3U8 404 Error

    • Check if stream uses bonus coins/secret keys...etc
  3. Container Crashes

    • Check logs: docker-compose logs
    • Verify environment configuration
    • Ensure network connectivity

πŸ”§ Project Structure

└── rplay-live-dl/
    β”œβ”€β”€ core/
    β”‚   β”œβ”€β”€ config.py
    β”‚   β”œβ”€β”€ downloader.py
    β”‚   β”œβ”€β”€ env.py
    β”‚   β”œβ”€β”€ live_stream_monitor.py
    β”‚   β”œβ”€β”€ logger.py
    β”‚   └── rplay.py
    β”œβ”€β”€ models/
    β”‚   β”œβ”€β”€ config.py
    β”‚   β”œβ”€β”€ env.py
    β”‚   └── rplay.py
    β”œβ”€β”€ images/
    β”‚   β”œβ”€β”€ auth_toke.png
    β”‚   β”œβ”€β”€ user_oid.png
    β”‚   └── creator_oid.png
    β”œβ”€β”€ LICENSE
    β”œβ”€β”€ config.yaml.example
    β”œβ”€β”€ .env.example
    β”œβ”€β”€ docker-compose.yaml
    β”œβ”€β”€ dockerfile
    β”œβ”€β”€ main.py
    β”œβ”€β”€ poetry.lock
    β”œβ”€β”€ pyproject.toml
    β”œβ”€β”€ requirements.txt
    β”œβ”€β”€ .gitignore
    └── README.md

πŸ‘₯ Contributing

Contributing Guidelines
  1. Fork the Repository: Start by forking the project repository to your github account.
  2. Clone Locally: Clone the forked repository to your local machine using a git client.
    git clone https://github.com/Zhen-Bo/rplay-live-dl
  3. Create a New Branch: Always work on a new branch, giving it a descriptive name.
    git checkout -b new-feature-x
  4. Make Your Changes: Develop and test your changes locally.
  5. Commit Your Changes: Commit with a clear message describing your updates.
    git commit -m 'Implemented new feature x.'
  6. Push to github: Push the changes to your forked repository.
    git push origin new-feature-x
  7. Submit a Pull Request: Create a PR against the original project repository. Clearly describe the changes and their motivations.
  8. Review: Once your PR is reviewed and approved, it will be merged into the main branch. Congratulations on your contribution!

Notice! Please ensure your PR:

  1. Follows the existing code style (black + flake8 + isort).
  2. Use conventional commit messages format
  3. Updates documentation.
  4. Describes the changes made.

Contributor Graph


πŸ“œ License

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


About

An automated Docker-based tool for downloading rPlay live streams with multi-stream monitoring and custom naming.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published