• Stars
    star
    120
  • Rank 295,983 (Top 6 %)
  • Language
    Go
  • License
    BSD 2-Clause "Sim...
  • Created over 10 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Server that acts like a lightweight/headless Chromecast that only includes YouTube (for the time being)

Plaincast

This is a small DIAL server that emulates Chromecast-like devices, and implements the YouTube app. It only renders the audio, not the video, so it is very lightweight and can run headless.

It can be used as media server, for example on the Raspberry Pi.

Installation

I'm going to assume you're running Linux for this installation guide, preferably Debian Jessie (or newer when their time comes). Debian before Jessie contains too old versions of certain packages.

First, make sure you have the needed dependencies installed:

  • golang 1.3 (1.1+ might also work, but 1.0 certainly doesn't)
  • libmpv-dev
  • youtube-dl (see also 'notes on youtube-dl' below)

These can be installed in one go under Debian Jessie:

$ sudo apt-get install golang libmpv-dev youtube-dl

If you haven't already set up a Go workspace, create one now. Some people like to set it to their home directory, but you can also set it to a separate directory. In any case, set the environment variable $GOROOT to this path:

$ mkdir golang
$ cd golang
$ export GOPATH="`pwd`"

Then get the required packages and compile:

$ go get -u github.com/aykevl/plaincast

To run the server, run the executable bin/plaincast relative to your Go workspace. Any Android phone with YouTube app (or possibly iPhone, but I haven't tested) on the same network should recognize the server and it should be possible to play the audio of videos on it. The Chrome extension doesn't yet work.

$ bin/plaincast

Notes on youtube-dl

youtube-dl is often too old to be used for downloading YouTube streams. You can try to run youtube-dl -U, but it may say that it won't update because it has been installed via a package manager. To fix this, uninstall youtube-dl, and install it via pip. The steps required depend on the version of Python in your $PATH variable. Check it with:

$ python --version

Install using pip for Python 2 (usually version 2.7.x), on Debian stretch and below:

$ sudo apt-get remove youtube-dl
$ sudo apt-get install python-pip
$ sudo pip2 install youtube-dl

Install using pip3 for Python 3 (version 3.x). Only required when you have configured the python binary to point to Python 3, or maybe on newer versions of Debian.

$ sudo apt-get remove youtube-dl
$ sudo apt-get install python3-pip
$ sudo pip3 install youtube-dl

Afterwards, you can update youtube-dl using:

$ sudo pip install --upgrade youtube-dl

Or for Python 3:

$ sudo pip3 install --upgrade youtube-dl

It is advisable to run this regularly as it has to keep up with YouTube updates. Certainly first try updating youtube-dl when plaincast stops working.

Known issues

  • So far, only DIAL is implemented, so the Chrome extension for Chromecast doesn't work yet (I suspect it uses mDNS, which is the successor of DIAL on Chromecast).

Thanks

I would like to thank the creators of leapcast. Leapcast is a Chromecast emulator, which was essential in the process of reverse-engineering the YouTube protocol and better understanding the DIAL protocol.

More Repositories

1

go-smartwatch

Go
67
star
2

mta-sts

Online tool for MTA-STS checking: https://aykevl.nl/apps/mta-sts/
Python
37
star
3

Sync2all

ABANDONED - Synchronizes Chrome and Firefox with Opera Link and Google Bookmarks
JavaScript
22
star
4

things

Collection of microcontroller projects
Go
19
star
5

ledsgo

LED animation library written in Go, inspired by FastLED
Go
18
star
6

pynus

NUS console implemented in Python using Bluez/DBus.
Python
14
star
7

fusion

Sensor fusion algorithms (gyroscope/accelerometer) implemented in pure Go.
Go
10
star
8

basmati

Battery charge limiter
Python
10
star
9

dtsync

Distributed tree synchronisation: synchronize directory trees without central hub
Go
8
star
10

go-ble

Bluetooth stack interface for TinyGo.
Go
6
star
11

reserved

List of reserved mailbox/user names, including functions to match them.
Python
6
star
12

ufloat8

Small library to compress a large integer range (ยฑ 20 bits) in a single byte
C
5
star
13

fixpoint

Fixed-point 3D calculations for devices without FPU.
Go
4
star
14

blake2s-micro

Very small (~500 bytes ROM) implementation of the BLAKE2s hash function.
C
4
star
15

south

Authenticated sessions using signed access tokens stored inside HTTP cookies.
Go
4
star
16

nrf-dfu

Device Firmware Update for nrf52* chips that lives in the MBR region of the SoftDevice.
C
3
star
17

esp32-minimal

Minimal sample project for the ESP32 (without using the ESP-IDF). It supports serial, timers, and GPIO output.
C
3
star
18

ledstrip-spark

Drive a LED strip with many features from a Digispark
Arduino
3
star
19

pwhash

Simple password hashing library for Go.
Go
3
star
20

tinygo-gccgo

C
3
star
21

cm-ota

CyanogenMOD OTA implementation
PHP
2
star
22

rust-ufloat8

Small library to compress a large integer range (ยฑ 20 bits) in a single byte - Rust implementation
Rust
2
star
23

unitsv

Simple TSV parser for Go
Go
1
star
24

webabx

Very old project, putting it online before I delete the server-side part of it.
JavaScript
1
star
25

domo-web

Web interface to my home automation devices
JavaScript
1
star
26

uirt2-arduino

UIRT2 infrared remote (IR) implementation for Arduino for use with LIRC
Arduino
1
star
27

firefox-input-theme

userContent.css for dark themes
CSS
1
star
28

python-zipseeker

Create a streamable and (somewhat) seekable .ZIP file for HTTP: calculating size and mtime beforehand
Python
1
star
29

wav-writer.js

A small library/function to convert an AudioBuffer to WAV data.
JavaScript
1
star
30

emculator

C
1
star
31

go-idx

iDeal and iDIN library to communicate with Dutch banks.
Go
1
star
32

smtp-reporter

Go
1
star
33

board

Experimental board abstraction for TinyGo
Go
1
star
34

domo

Two embedded devices (written with the Arduino enivironment) with various peripherals (wake-up light, amplifier, DHT22 sensor, etc.)
C++
1
star
35

gocount

Count the number of running non-runtime goroutines, for testing purposes.
Go
1
star