Windows - Creating your first Youtube Add-on

  Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
zag Offline
Retired Team-Kodi Member
Posts: 4,006
Joined: Oct 2007
Reputation: 75
Location: UK
Post: #16
No this only works for a single youtube channel ID
find quote
liquidgee Offline
Junior Member
Posts: 2
Joined: Jan 2016
Reputation: 0
Post: #17
(2016-02-08 22:12)zag Wrote:  No this only works for a single youtube channel ID

Is there a way to setup a per link add-on?
find quote
andrewmo Offline
Junior Member
Posts: 4
Joined: Feb 2016
Reputation: 0
Post: #18
This is excellent, thank you!

KodiStop.com - Tutorials, Add-Ons, Trips & Tricks for Kodi
find quote
tshark2 Offline
Junior Member
Posts: 13
Joined: Feb 2016
Reputation: 0
Location: New York
Post: #19
This is really helpful, thanks!
find quote
abbodj Offline
Junior Member
Posts: 1
Joined: Feb 2016
Reputation: 0
Post: #20
Is there any way to link to a playlist rather than a channel?
find quote
speedwell68 Offline
Fan
Posts: 634
Joined: Sep 2013
Reputation: 11
Post: #21
Will this only work on Windows PCs? I have tried it on Ubuntu 14.04 and am getting no joy?

HTPCs: RPi 2B & 3 x RPi 1B on LibreELEC 7.x
Amp: Pioneer VSX-819HK & S-HS 100 5.1 Speakers
Server: Acer Revo R3610, 4GB RAM, 3TB HDDs, Xubuntu 16.04 x64, NFS, MySQL
find quote
RPico Offline
Junior Member
Posts: 18
Joined: Sep 2012
Reputation: 0
Post: #22
Current Youtube API troubles are causing the familliar "Project marked for deletion error". I notice that some addons are functioning under the latest upgrade (5.1.17), and some aren't. Does something need to be changed at the addon level to eliminate the error?
find quote
misty01 Offline
Senior Member
Posts: 118
Joined: May 2014
Reputation: 22
Post: #23
(2016-02-08 18:58)liquidgee Wrote:  
(2015-12-30 14:59)zag Wrote:  Here is a quick guide on creating an add-on that can browse any specific Youtube channel. It uses the plugin tools module from Jesús, so thanks to him its very easy.
I wanted to create a specific youtube channel Add-on as I browse a it regularly and wanted a quick way to get to those with minimum fuss.
I just copied an existing add-on I found, so please feel free to comment on the code or way of doing things. I'm always looking to improve.

Im trying to create an add-on using different YouTube links but not a whole channel. Will the individual link to certain video work the same way?

Yes you can link directly to a video. As you can see in the example, thumbnail pointing to jpg for icon and fanart pointing to bigger jpg for background image. Most important is to be sure parameter 'folder=False', if by mistake you set 'folder=True', then when you click the video link in kodi gui, the video will not play, instead you get a new blank menu page.

Here's example 1:
Code:
plugintools.add_item(
    #action="",
    title="Wheel of Musical Impressions with Demi Lovato",
    url="plugin://plugin.video.youtube/play/?video_id=GWpVTGnr_hA",
    thumbnail="https://i.ytimg.com/vi/GWpVTGnr_hA/mqdefault.jpg",
    fanart="https://i.ytimg.com/vi/GWpVTGnr_hA/hqdefault.jpg",
    folder=False )

example 2 code: Here I separate the youtube video id and assign it to v_id_1 variable. Both ways will work.

Code:
v_id_1 = "GWpVTGnr_hA"

plugintools.add_item(
    #action="",
    title="Wheel of Musical Impressions with Demi Lovato",
    url="plugin://plugin.video.youtube/play/?video_id=%s" % v_id_1,
    thumbnail="https://i.ytimg.com/vi/GWpVTGnr_hA/mqdefault.jpg",
    fanart="https://i.ytimg.com/vi/GWpVTGnr_hA/hqdefault.jpg",
    folder=False )

Get Best of NHK, DigitalRev TV and XiveTv add-ons via my repository. Enjoy!
(This post was last modified: 2016-02-27 08:48 by misty01.)
find quote
misty01 Offline
Senior Member
Posts: 118
Joined: May 2014
Reputation: 22
Post: #24
(2016-02-17 12:36)abbodj Wrote:  Is there any way to link to a playlist rather than a channel?

Yes, you can link to a playlist.

Example 1:

Code:
plugintools.add_item(
    #action="",
    title="Best of Fallon",
    url="plugin://plugin.video.youtube/playlist/PLykzf464sU9-aOpnO-5cvGNU_p-lVjIv-/",
    thumbnail="https://yt3.ggpht.com/-x3CU1CXklQI/AAAAAAAAAAI/AAAAAAAAAAA/jPQ9GJeU53g/s100-c-k-no/photo.jpg",
    folder=True )

Example 2: Same as above except playlist id is assigned to pl_id_1 variable. Both have the same result.

Code:
pl_id_1 = "PLykzf464sU9-aOpnO-5cvGNU_p-lVjIv-"

plugintools.add_item(
    #action="",
    title="Best of Fallon",
    url="plugin://plugin.video.youtube/playlist/%s/" % pl_id_1,
    thumbnail="https://yt3.ggpht.com/-x3CU1CXklQI/AAAAAAAAAAI/AAAAAAAAAAA/jPQ9GJeU53g/s100-c-k-no/photo.jpg",
    folder=True )

Get Best of NHK, DigitalRev TV and XiveTv add-ons via my repository. Enjoy!
(This post was last modified: 2016-02-27 08:47 by misty01.)
find quote
misty01 Offline
Senior Member
Posts: 118
Joined: May 2014
Reputation: 22
Post: #25
(2016-02-17 21:25)speedwell68 Wrote:  Will this only work on Windows PCs? I have tried it on Ubuntu 14.04 and am getting no joy?

Coding in python so will work across all platforms that kodi runs on. I would guess you have indenting errors in your code. Other minor coding mistakes like missing a comma " , " for instance can cause problems too. Best is to review the code from a known good working addon and emulate it. Don't give up, it's probably something minor and you'll kick yourself once you find it.

(2016-02-25 22:04)RPico Wrote:  Current Youtube API troubles are causing the familliar "Project marked for deletion error". I notice that some addons are functioning under the latest upgrade (5.1.17), and some aren't. Does something need to be changed at the addon level to eliminate the error?

All youtube based addons using this code method will work properly if the youtube addon has the working api keys put in the proper places. I read comments in the main youtube thread that user ids no longer work, change to channel ids. That is not true. If working api keys (in youtube addon) are installed properly, then user id, channel id, playlist id and video id will work with this method.

Get Best of NHK, DigitalRev TV and XiveTv add-ons via my repository. Enjoy!
find quote
Don_black00 Offline
Junior Member
Posts: 29
Joined: Jan 2015
Reputation: 0
Post: #26
@Misty01, @Zag the addon says fail to install after I zipped it up. can you please look at the file and see what I did wrong.
https://dl.dropboxusercontent.com/u/3542...master.zip
find quote
misty01 Offline
Senior Member
Posts: 118
Joined: May 2014
Reputation: 22
Post: #27
Just downloaded and took a quick look at the add-on structure, did not run it. You must be on Mac OS because there is a .DS_Store file in the add-on folder. This will prevent the add-on from installing from zip. Use CleanArchiver to auto-remove .DS_Store and Mac resource forks while it zips your add-on. Use normal zip, not any of the other zip methods offered by CleanArchiver.

Edit:

Ok, I loaded your add-on, but you have some issues.

Code:
Just a small part of your code.

YOUTUBE_CHANNEL_ID1 = "theUrltv"
.
.
.
.
    plugintools.add_item(
        #action="",
        title="Urban Rap League TV",
        url="plugin://plugin.video.youtube/user/"theUrltv"/",
        thumbnail="https://www.dropbox.com/home/Public/Plugin%20icons?preview=URLTV.jpg",
        folder=True )

You are assigning value 'theUrltv' to variable 'YOUTUBE_CHANNEL_ID1', but later you don't call the variable. Also you use quotes where it causes a problem.

Working example 1:
Code:
YOUTUBE_CHANNEL_ID1 = "theUrltv"
.
.
.
.
    plugintools.add_item(
        #action="",
        title="Urban Rap League TV",
        url="plugin://plugin.video.youtube/user/"+YOUTUBE_CHANNEL_ID1+"/",
        thumbnail="https://www.dropbox.com/home/Public/Plugin%20icons?preview=URLTV.jpg",
        folder=True )

OR

    plugintools.add_item(
        #action="",
        title="Urban Rap League TV",
        url="plugin://plugin.video.youtube/user/%s/" % YOUTUBE_CHANNEL_ID1,
        thumbnail="https://www.dropbox.com/home/Public/Plugin%20icons?preview=URLTV.jpg",
        folder=True )

Working example 2:
Code:
YOUTUBE_CHANNEL_ID1 = "theUrltv"   #<< this line not needed if coded like below
.
.
.
.
    plugintools.add_item(
        #action="",
        title="Urban Rap League TV",
        url="plugin://plugin.video.youtube/user/theUrltv/",
        thumbnail="https://www.dropbox.com/home/Public/Plugin%20icons?preview=URLTV.jpg",
        folder=True )

Hope that helps.

Get Best of NHK, DigitalRev TV and XiveTv add-ons via my repository. Enjoy!
(This post was last modified: 2016-03-07 19:31 by misty01.)
find quote
Don_black00 Offline
Junior Member
Posts: 29
Joined: Jan 2015
Reputation: 0
Post: #28
@Misty01, I cleaned it up and it installed but I get api error saying it is not enabled. How do I fix that issue.
find quote
zag Offline
Retired Team-Kodi Member
Posts: 4,006
Joined: Oct 2007
Reputation: 75
Location: UK
Post: #29
That may have something to do with the youtube add-on being broken currently with API key needing to be replaced. Check the other thread for the fix.

http://forum.kodi.tv/showthread.php?tid=200735&page=243
find quote
Don_black00 Offline
Junior Member
Posts: 29
Joined: Jan 2015
Reputation: 0
Post: #30
Thanks, @Zag, @ Misty01 now that I have that working. How can I create a custom view so that it defaults to thumbnail view. In addition, how can I do custom search in the channel for particular video(s). In addition can I also create a private channel and have people view it with the code I give them.
find quote