youcube

A server which provides a WebSocket API for YouCube clients


Keywords
youtube, youcube, computercraft, minecraft, music-streaming, python3, server, video-streaming
License
GPL-3.0
Install
pip install youcube==0.0.0

Documentation

YouCube

Project license Mentioned in Awesome ComputerCraft

Spellcheck Workflow Status API documentation

YouCube streams media from services like YouTube to ComputerCraft: Tweaked.
Project Status: Proof of concept

Installation

Client

CC: Tweaked Version: 1.100+ or CC: Tweaked Version: 1.80pr1.3+ + Computronics Version: 0.1.0+

Lua Lint Workflow Status

preview

YouCube.mp4

The client can be installed by running the following command:

pastebin run swsmNAf7

or

wget run https://raw.githubusercontent.com/Commandcracker/YouCube/main/installer.lua

Starting the Client

youcube

Libraries

All libraries that are used by the client.

Library
argparse
numberformatter
semver
youcubeapi
string_pack

UnicornPKG (Experimental)

YouCube can be installed with unicornpkg.
Just run hoof install youcube to install it.

LevelOS / lStore

lStore Package

On LevelOS YouCube can be installed by running lStore get YouCube <path> or lStore get bpBYV1aG <path> or by Using the StoreUI.

preview

Settings

Settings that can be set with the CC: Tweaked settings module

name default Description
youcube.server First server that should be used
youcube.keys.skip 32 (d) Key code to skip song
youcube.keys.back 30 (a) Key code to head to previous song
youcube.max_back 32 Maximum ammount of songs that can be gone back to

Events

List of events that are queued by youcube

Name Arguments Description
youcube:vid_eof data Called, when Video playback has ended
youcube:audio_eof data Called, when Audio playback has ended
youcube:fill_buffers Internal event (called when buffers are filled)
youcube:status data Status of the serversided media download
youcube:playback_ended Called, when all playback has ended
youcube:vid_playing data Called, when Video playback has started
youcube:audio_playing data Called, when Audio playback has started
youcube:playing Called, when playback has started

Server

Python Version: 3.7+ Python Lint Workflow Status

preview

YouCube has a some public servers, which you can use if you don't want to host your own server.
The client has the public servers set by default, so you can just run the client, and you're good to go.
Moor Information about the servers can be seen on the doc.

Requirements

You can install the required packages with pip by running:

pip install -r server/requirements.txt

Starting the Server

python server/youcube.py

Environment variables

Environment variables you can use to configure the server.

Variable Default Description
HOST 0.0.0.0 The host where the web server runs on.
PORT 5000 The port where the web server should run on
TRUSTED_PROXIES Trusted proxies (separated by comma,)
FFMPEG_PATH ffmpeg Path to the FFmpeg executable
SANJUUNI_PATH sanjuuni Path to the Sanjuuni executable
NO_COLOR False Disable colored output
LOGLEVEL DEBUG Python Log level of the main logger

Docker Compose

version: "2.0"
services:
  youcube:
    image: ghcr.io/commandcracker/youcube:main
    restart: always
    hostname: youcube
    ports:
      - 5000:5000