Sponsored Links:
  • 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
Sponsored Links:
#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.
WANT EARLY DEVELOPMENT RELEASE ACCESS?
All users who've helped out with a donation can now gain early access to the
latest test versions of add-ons, often weeks or months ahead of the public stable releases.

[Image: 11i3ihd.jpg]
  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
  disable uninstall for my addon james739 6 68 Yesterday, 03:00 PM
Last Post: whufclee
  Repo : Video addon not showing on android Platform tdbnz 1 86 12-22-2016, 07:47 AM
Last Post: whufclee
  Delete remove addon kodiuser 5 162 12-16-2016, 10:36 PM
Last Post: whufclee
  Python, how to launch addon inside of a subfolder bluedangerforyou 5 164 12-06-2016, 07:47 AM
Last Post: bluedangerforyou
  kodi python help needed, opty 4 379 08-11-2016, 02:52 AM
Last Post: opty
Big Grin cache and play next toall1985 2 352 07-19-2016, 04:28 PM
Last Post: toall1985
  Changing the Name of a Repo addon kodiuser 1 271 07-19-2016, 03:28 PM
Last Post: whufclee
  Making a main page for the addon nath183 1 334 07-03-2016, 05:08 PM
Last Post: whufclee
  addon.xml tagging whufclee 0 1,174 05-09-2016, 03:21 PM
Last Post: whufclee
  Video addon - External links kodikraze 0 430 02-07-2016, 12:51 AM
Last Post: kodikraze

Forum Jump:


Users browsing this thread: 1 Guest(s)