Friday, February 21, 2025

How to set up Kodi with YouTube addon on Raspberry OS Debian 12

 In this post, we review how to run Kodi with Kodi Youtube Addon on Raspberry Pi 5. 

There are two versions of Kodi available on Raspberry Pi OS for Debain 12. `kodi` package installs v20.0 and `kodi21` installs version 21. Make sure to use v21 as it has resolved some bugs that causes glitches in video playback,

# Install Kodi21 

apt-get install kodi21 kodi21-inputstream-adaptive

# Download Kodi Youtube Plugin Repository 

cd /home/pi/Downloads

wget https://ftp.fau.de/osmc/osmc/download/dev/anxdpanic/repositories/repository.yt.testing_unofficial-2.0.7.zip

# Open Kodi -> Settings -> Addon -> Install from Zip File -> Home Folder -> Downloads -> Select the above zip file that you downloaded

#  Go Back (Settings -> Addon) -> Options (at bottom left) -> Check for Updates 

# Go Back (Settings -> Addon) -> Install from Repository -> Youtube Test Repo (Unofficial) -> Video add-ons -> Youtube -> Install

# add a Youtube API v3 API has described here. Just note that Publishing status in Audience should be Production. In Data Access section you need to enable Youtube related permissions. It will ask to login two times when trying to login on Youtube Addon for Kodi, and on your google device will show a warning that the app is not verified as explained here

#  Go to Home page -> Youtube -> Add-on settings (left side) -> API: fill API Key, API Id and API Secret by your Youtube API

# You can set Proxy setting in Kodi -> Setting -> System -> Internet Access

# Kodi turns on TV when it is started, and turns off TV when exitted. The behaviour can be set up in Kodi -> Setting -> System -> Interface

# To avoid your raspberry pi turning on your TV when it is rebooted, add hdmi_ignore_cec_init=1 to /boot/firmware/config.txt

# PartyMode addon can be used to set youtube addon to start up automatically when running Kodi

# piflare.com service can be used to connect raspberry pi to telegram so it starts kodi by running /youtube command


/scripts/youtube.py :

#!/home/pi/python/bin/python3

import os, sys, time

os.chdir('/home/pi')


os.environ["DISPLAY"] = ":0"

os.environ["WAYLAND_DISPLAY"] = "wayland-0"

os.environ["XDG_RUNTIME_DIR"] = "/run/user/1000"

os.environ["DBUS_SESSION_BUS_ADDRESS"] = "unix:path=/run/user/1000/bus"


os.system("pkill -9 -f 'chrome|chromium|google-chrome|chrome_crashpad_handler|kodi|kodi21.bin'")

os.system('/usr/bin/kodi &')

No comments:

Post a Comment

How to set up Kodi with YouTube addon on Raspberry OS Debian 12

 In this post, we review how to run Kodi with Kodi Youtube Addon on Raspberry Pi 5.  There are two versions of Kodi available on Raspberry P...