Release Replacement YouTube addon for Android users (YouTube launcher)
#1
Overview

I made an addon for myself for use on Android which replaces the YouTube addon currently available in order to provide access to the native YouTube player on Android
(Mostly used for trailer playback)

With just 2 files and less than 25 lines of code, it is simpler to just paste but if you prefer I can package it.

What it does

When Kodi attempts to play a URL that is a YouTube video it calls the YouTube addon, plugin.video.youtube, this addon parses the url it is supposed to play and invokes the native android app to play it instead.

How To

Create a folder "plugin.video.youtube"
Inside that folder, create 2 files "addon.xml" and "default.py"
Paste the contents below into their files.
Zip the parent folder plugin.video.youtube
Install into Kodi (!replaces existing plugin.video.youtube addon)

You may also be able to just put it in the addons folder but it is not the correct way to install addons.

Source

addon.xml

xml:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="plugin.video.youtube" name="YouTube" version="99" provider-name="">
    <requires>
        <import addon="xbmc.python" version="3.0.0"/>
    </requires>
    <extension point="xbmc.python.pluginsource" library="default.py">
        <provides>video</provides>
    </extension>
    <extension point="xbmc.addon.metadata">
    </extension>
</addon>

default.py

python:
import sys, xbmc
if __name__ == '__main__':
    args=sys.argv[2].split("&")
    for arg in args:
        if "video_id" in arg or "videoid" in arg:
            vid=arg.split("=")[1]
            break
    playurl = "https://www.youtube.com/watch?v={}".format(vid)
    xbmc.log("YouTube Trailer URL {}".format(playurl),1)
    if hasattr(sys, 'getandroidapilevel'):
        playtube = 'StartAndroidActivity(,android.intent.action.VIEW,,"%s")' % playurl
        xbmc.executebuiltin(playtube)


Why?!

On android I prefer the native YouTube application over the Kodi addon in terms of functionality.
Since it was such a simple thing I thought I would share it.
Reply

Logout Mark Read Team Forum Stats Members Help
Replacement YouTube addon for Android users (YouTube launcher)0