Notice that here use package yt_dlp to get link of video on Youtube.
This is an online player can be used on streaming.
pip install -r requirements.txt
-
Run the service.
docker-compose up
-
Go to http://localhost:7878/player/ and create the first user.
Port is specified in
docker-compose.yml
file. Default is7878
. -
(Optional) Check Admin page.
Go here http://localhost:7878/api/__hidden_admin .
-
(Optional) Check Swagger.
-
(Optional) Check player in frontend.
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))