Play youtube link from list
#1
Hi,
I want to play youtube directly from link in KODI!
my goal is to get youtube link from Dynamic generated XML file and after that send it to player using xbmcplugin.addDirectoryItem or something like that!

an example :

Code:
def add_video_item(title,url,img):
    url = 'plugin://plugin.video.MYPLUGIN/?playtrk=' + url + '***' + title + '***' + img
    listitem = xbmcgui.ListItem(title, iconImage=img, thumbnailImage=img)
    listitem.setProperty('IsPlayable', 'false')
    xbmcplugin.addDirectoryItem(plugin_handle, url, listitem)
    return

def main():
    
    url = "http://domain.com/my.xml"
    link = get_url(url)
    soup = BeautifulSOAP(link, convertEntities=BeautifulStoneSoup.XML_ENTITIES)

    items = soup.findAll("item")
    for item in items:
            try:
                videoTitle=item.title.string
            except: pass
            try:
                if item.thumbnail.string == 'none': thumbnail = icon    
                elif 'http://' in item.thumbnail.string: thumbnail = item.thumbnail.string
                else: thumbnail = icons + item.thumbnail.string  
            except:
                thumbnail = icon
            try:
                url= item.link.string
            except: pass

            add_video_item(videoTitle,url,thumbnail)
    xbmcplugin.endOfDirectory(plugin_handle)
    sys.exit(0)

so is there any way to do that ?! any streaming url catching method or something like that ?! also I need those youtube nice adds Big Grin because I want to send my own links to my clients and want those ads played before video.

Thanks a lot
Reply
#2
any Idea ?
Reply
#3
Set the URL to 'plugin://plugin.video.youtube/?action=play_video&videoid=THE_ID_HERE'.
Reply
#4
Wow Thanks a lot Smile
and one more question, is it open youtube plugin or just play item and automatically go to next Item ?!
Reply
#5
(2015-11-28, 08:29)Pline Wrote: Set the URL to 'plugin://plugin.video.youtube/?action=play_video&videoid=THE_ID_HERE'.

Hi,
Thanks again for answer Smile
I've test it - it works perfectly! but what about Ads ? I want to play youtube ads too! is there any way for it ?
Thanks a lot Smile
Reply

Logout Mark Read Team Forum Stats Members Help
Play youtube link from list0