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
  Create Your First Addon whufclee 17 3,173 05-08-2017, 09:34 AM
Last Post: whufclee
  Addon Dev. Youtube links Man Cave 2 150 05-07-2017, 06:30 PM
Last Post: Man Cave
  Video Addon Help!! TheGrid 9 309 05-07-2017, 10:23 AM
Last Post: TheGrid
  How to add Online playable link pinoyako 5 221 04-29-2017, 02:38 AM
Last Post: blackburnman04
  Kodi 17 database questions for Android bluedangerforyou 1 142 03-18-2017, 09:34 PM
Last Post: OptimusGREEN
  [Addon Dev help] need help with Scraper tdbnz 14 1,042 03-09-2017, 06:13 AM
Last Post: Kiwi_man82
  Tutorial for build wizard on Kodi 17? hyp0xia 4 363 02-24-2017, 10:04 PM
Last Post: OptimusGREEN
  Addon DEV Help tdbnz 5 472 02-13-2017, 09:35 AM
Last Post: tdbnz
  How to get control back after running an addon bigoldboy 1 278 02-09-2017, 02:20 AM
Last Post: mydraal
  Delete remove addon kodiuser 6 699 02-09-2017, 12:58 AM
Last Post: Derrick Stanfield

Forum Jump:


Users browsing this thread: 1 Guest(s)