• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Youtube videos play via my addon on Kodi 17, not playable in Kodi 16
#1
Hello everyone,

I have followed the Python Koding videos and I have attempted to create a simple video addon, which will contain a few links to video links from Youtube, DailyMotion, and Google Drive. I have no issues with the Google Drive and Dailymotion files, when I click on the link it will play the video correctly. But when I click on any of the Youtube links, nothing seems to happen. When I right click on the file there is only Addon Settings and Addon information displayed in the context menu, nothing like "Play from here" is mentioned.

What I don't understand is if I run the same addon via Kodi 17 RC, if I right click on the link, there is a "Play" option shown, and the Youtube videos load without any issues.

My code is below:

http://pastebin.com/rrkds7fE


Kodi 16 Log: (seems to mention about "attempt to use invalid handle -1", just after I select the video quality)

http://pastebin.com/Ny7QpciC

What is strange to me is why it would play with no issues in Kodi 17, but in Kodi 16 it won't work but every other link works correctly (GVideo and Dailymotion), could it be that I have structured the Youtube link incorrectly?

Many Thanks to anyone who can provide a possible solution or insight into this issue.

Many thanks for the great videos as well, credit for the code posted goes to the original poster of the Python Koding videos, I have just added the directories I needed to display in, and the video links Smile
  Reply
#2
When playing back links you need a final resolved link when using the basic method used in the guides. I presume the dailymotion and gdrive ones are final resolved links (in other words you paste that link into a web browser and it automatically plays).

The YouTube website has the links well hidden so you would need to use something like the URLResolver module to resolve your links. It may well be as of Krypton they've added the ability to auto-resolve YT links, afraid I've not played around with Krypton much yet but from your results that's what it sounds like is happening.

Another good way to check if you have a final resolved URL is try playing it through VLC, it's a free app and works on Mac/Linux/Windows. Just click on something like "Open Network Stream" then paste the URL and see if it loads, if it does then you know it should work in Kodi as that's a final resolved link.
IMPORTANT:
NO LOG == NO PROBLEM
  Reply
#3
(01-09-2017, 07:03 PM)whufclee Wrote: When playing back links you need a final resolved link when using the basic method used in the guides. I presume the dailymotion and gdrive ones are final resolved links (in other words you paste that link into a web browser and it automatically plays).

The YouTube website has the links well hidden so you would need to use something like the URLResolver module to resolve your links. It may well be as of Krypton they've added the ability to auto-resolve YT links, afraid I've not played around with Krypton much yet but from your results that's what it sounds like is happening.

Another good way to check if you have a final resolved URL is try playing it through VLC, it's a free app and works on Mac/Linux/Windows. Just click on something  like "Open Network Stream" then paste the URL and see if it loads, if it does then you know it should work in Kodi as that's a final resolved link.

Many thanks for the explanation whufclee. For the YouTube links I had just added the link as such

media_url = urlresolver.resolve('http://YouTube.com/videoidwillbehere).

Am i right in thinking in the case with YouTube that this is not enough and I will have to do something further, such as setResolvedUrl?

Reading the URLResolver documentation I found the following snippet of code below:

Code:
import urlresolver

stream_url = urlresolver.resolve(web_url)

if stream_url:
   xbmcplugin.setResolvedUrl(plugin_handle, True,
                             xbmcgui.ListItem(path=stream_url))
else:
   xbmcplugin.setResolvedUrl(plugin_handle, False,
                             xbmcgui.ListItem())

My assumption (most likely wrong) from this is that urlresolver should resolve the YouTube link then using setResolvedUrl will contain a direct link to the video and a link in Kodi will be displayed that when clicked will load the path of the resolved URL? (Sorry just trying to get my head around how this setResolvedUrl function is working) 


PS:
 By looking at my log in Kodi 17 I can see that as you correctly assumed, Krypton must be doing some auto resolving of YT links as there is a r2-googlevideo.com direct link which when copied into the browser plays the YouTube video in standard web browser video player.
  Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
  Scraper addon Universe addon 1 50 10-14-2017, 07:14 AM
Last Post: whufclee
  Live TV addon TonyH 10 126 09-26-2017, 08:45 AM
Last Post: whufclee
  error when trying to open addon keepforgettingmypassword 5 27 09-20-2017, 02:26 PM
Last Post: keepforgettingmypassword
  [TEMPLATE] My YouTube Add-on whufclee 19 209 09-19-2017, 01:09 PM
Last Post: keepforgettingmypassword
  creating a search feature in addon streemz 10 80 09-04-2017, 07:50 PM
Last Post: streemz
  Change proxy from kodi whufclee 0 7 08-20-2017, 04:07 PM
Last Post: whufclee
  how can i import pyqt4 in my addon naveengautam002 1 12 08-15-2017, 10:55 AM
Last Post: whufclee
  Python Question Android Kodi Based_Skid 2 22 08-08-2017, 02:27 PM
Last Post: Based_Skid
  installing scripts required for addon BigYid 5 39 08-05-2017, 11:51 AM
Last Post: whufclee
  How to submit an addon to the Add-on Portal whufclee 11 2,896 08-04-2017, 10:44 PM
Last Post: BigYid

Forum Jump:


Users browsing this thread: 1 Guest(s)