2015-11-25, 04:38
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 :
so is there any way to do that ?! any streaming url catching method or something like that ?! also I need those youtube nice adds because I want to send my own links to my clients and want those ads played before video.
Thanks a lot
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 because I want to send my own links to my clients and want those ads played before video.
Thanks a lot