YouTube App built with Cobalt with extended functionalities.
This project is built on top of youtube-webos.
Cobalt only support a subset of HTML tags,
youtube-webos had to be reworked to only use div tag.
Same as the default youtube application:
- Speed management
Same as youtube-webos:
- Advertisements blocking
- SponsorBlock integration
- Autostart
Note: Configuration screen can be opened by pressing 🟩 GREEN button on the remote.
- Official YouTube app needs to be uninstalled before installation.
- Use webOS Homebrew Channel - app is published in official webosbrew repo
- Use Device Manager app - see Releases for a
prebuilt
.ipkbinary file - Use official webOS/webOS OSE SDK:
ares-install youtube...ipk(for webOS SDK configuration see below)
Configuration screen can be opened by pressing 🟩 GREEN button on the remote.
In order to autostart an application the following command needs to be executed via SSH or Telnet:
luna-send-pub -n 1 'luna://com.webos.service.eim/addDevice' '{"appId":"youtube.leanback.v4","pigImage":"","mvpdIcon":""}'This will make "YouTube AdFree" display as an eligible input application (next to HDMI/Live TV, etc...), and, if it was the last selected input, it will be automatically launched when turning on the TV.
This will also greatly increase startup performance, since it will be runnning constantly in the background, at the cost of increased idle memory usage. (so far, relatively unnoticable in normal usage)
In order to disable autostart run this:
luna-send -n 1 'luna://com.webos.service.eim/deleteDevice' '{"appId":"youtube.leanback.v4"}'- Install docker:
Follow instructions on https://docs.docker.com/engine/install/
Make sure to install all docker components like docker-buildx-plugin and docker-compose-plugin.
- Install tools
sudo apt install jq git patch sed binutils squashfs-tools rename findutils xz-utils- Clone the repository
git clone https://github.com/GuillaumeSmaha/youtube-webos-cobalt.git- Enter the folder and you can patch your YouTube ipk
cd youtube-webos-cobalt
make PACKAGE=./your-tv-youtube.ipkCustomize package name:
PACKAGE_NAME can be defined to change the package name
make PACKAGE=./your-tv-youtube.ipk PACKAGE_NAME=youtube-free.leanback.v4If you don't trusted, pre-compiled version stored in cobalt-bin, you can build them yourself.
The building process is:
- Clone cobalt repository
- Apply the patch defined in
cobalt-patchesdirectory to inject AdBlock javascript after the document is loaded. - Build libcobalt.so using docker-compose method.
This process is handled by the following commands:
- Clone the repo, enter the folder and call the build command, this will generate libcobalt.so file for the given versions.
make cobalt-bin/<COBALT_VERSION>-<SB_API_VERSION>/libcobalt.so cobalt-bin/<COBALT_VERSION>-<SB_API_VERSION>.xz
For example: for Cobalt 23.lts.4 and SB Api version 12:
git clone https://github.com/FriedChickenButt/youtube-webos.git
cd youtube-webos-cobalt
make cobalt-bin/23.lts.4-12/libcobalt.so cobalt-bin/23.lts.4-12.xzIf you already built the package, update the repo and got an error like node-gyp not found:
Try to clean docker image used to build.
docker image rm cobalt-build-evergreen cobalt-build-linux cobalt-build-base cobalt-baseTry to clean old Cobalt builds:
rm -fr cobalt/out/
make cobalt-cleanThis is partially based on: https://webostv.developer.lge.com/develop/app-test/using-devmode-app/
- Install Developer Mode app from Content Store
- Enable developer mode, enable keyserver
- Download TV's private key:
http://TV_IP:9991/webos_rsa - Configure the device using
ares-setup-device(-amay need to be replaced with-mif device namedwebosis already configured)PASSPHRASEis the 6-character passphrase printed on screen in developer mode app
ares-setup-device -a webos -i "username=prisoner" -i "privatekey=/path/to/downloaded/webos_rsa" -i "passphrase=PASSPHRASE" -i "host=TV_IP" -i "port=9922"- Enable sshd in Homebrew Channel app
- Generate ssh key on developer machine (
ssh-keygen) - Copy the public key (
id_rsa.pub) to/home/root/.ssh/authorized_keyson TV - Configure the device using
ares-setup-device(-amay need to be replaced with-mif device namedwebosis already configured)
ares-setup-device -a webos -i "username=root" -i "privatekey=/path/to/id_rsa" -i "passphrase=SSH_KEY_PASSPHRASE" -i "host=TV_IP" -i "port=22"Note: @webosose/ares-cli doesn't need to be installed globally - you can use a package installed locally after cd youtube-webos && npm install in this repo by just prefixing above commands with local path, like so: node_modules/.bin/ares-setup-device ...
cd youtube-webos
npm run deploy
- The app will be available in the TV's app list or launch it using ares-cli.
cd youtube-webos
npm run launchTo jump immediately into some specific video use:
cd youtube-webos
npm run launch -- -p '{"contentTarget":"v=F8PGWLvn1mQ"}'

