Skip to content

Latest commit

 

History

History
94 lines (53 loc) · 2.38 KB

README.md

File metadata and controls

94 lines (53 loc) · 2.38 KB

Streaming Player

Notice that here use package yt_dlp to get link of video on Youtube.

demo

This is an online player can be used on streaming.

Playlist

playlist

History

playlist-history

APIs

apis

Requirements

pip install -r requirements.txt

Usage

Quick Start

  1. Run the service.

    docker-compose up
  2. Go to http://localhost:7878/player/ and create the first user.

    Port is specified in docker-compose.yml file. Default is 7878.

  3. (Optional) Check Admin page.

    Go here http://localhost:7878/api/__hidden_admin .

    And you'll see the page below.

  4. (Optional) Check Swagger.

    Go here http://localhost:7878/api/__hidden_swagger/ .

  5. (Optional) Check player in frontend.

    See http://localhost:7878/player/

Interaction APIs

You can use the following APIs in streaming chat box to interact with your audience.

  • /player/nightbot/current Get current playing video.

  • /player/nightbot/current/poll Poll to stop current playing video.

  • /player/nightbot/order Order to play a video.

  • /player/nightbot/order/{user}/count Get the number of videos that user has ordered.

  • /player/nightbot/{song_pk_in_queue}/delete Delete a video with song's ID in queue.

  • /player/nightbot/{song_pk_in_queue}/insert Insert a video with song's ID in queue.

In Nightbot, you can add custom command with URL in command page.

Specify command !sr and give the message below.

$(urlfetch https://<YOUR_DOMAIN>/player/nightbot/order?user=$(user)&url=$(querystring))

Link