create addon that just play an .m3u8 link
#1
Hi, 
I would like to make a simple kodi addon that just plays a simple .m3u8 link, there is no problem with the installation, but when I start the addon it does nothing and the error is not logged

does anyone have any idea what I'm doing wrong?
thanks in advance!

python:
#addon.xml file
<addon id="plugin.video.play_test" name="play_test" version="0.0.1" provider-name="asd">
    <extension point="xbmc.python.pluginsource" library="main.py"></extension>
</addon>

#main.py file
import xbmcaddon
import xbmcgui
import xbmcplugin
import urllib.parse
import sys

addon = xbmcaddon.Addon()

def play_video(url):
    xbmcplugin.setResolvedUrl(handle=int(sys.argv[1]), succeeded=True, listitem=xbmcgui.ListItem(path=url))

params = {'url': 'https://....m3u8_link'}

video = {'title': 'Test Video', 'url': params['url']}

url = sys.argv[0] + '?action=play&title=' + urllib.parse.quote(video['title']) + '&url=' + urllib.parse.quote(video['url'])

play_video(video['url'])
Reply
#2
Check your tags, you are closing right after defining the addon.
Reply
#3
(2023-05-09, 11:17)hunadamka Wrote: I would like to make a simple kodi addon that just plays a simple .m3u8 link, there is no problem with the installation, but when I start the addon it does nothing and the error is not logged

does anyone have any idea what I'm doing wrong?
thanks in advance!

Can you post the logs for when you run the addon ?  This will allow us to see if the player is starting and whether it is getting an error .


Thanks,

jeff
Running with the Mezzmo Kodi addon.  The easier way to share your media with multiple Kodi clients.
Service.autostop , CBC Sports, Kodi Selective Cleaner and Mezzmo Kodi addon author.
Reply
#4
Not sure you're playing anything?  Is there more code than this that adds the listitem to a directory?

Not any expert but I would think you need something like:
python:
def play_video(url):
    liz = xbmcgui.ListItem(path=url)
    xbmcplugin.setResolvedUrl(handle=int(sys.argv[1]), succeeded=True, listitem=liz)
    xbmc.Player().play(liz.getPath())

scott s.
.
Reply
#5
Hi hunadamka, here is the smaple code 

<?xml version="1.0" encoding="UTF-8"?>
<addon id="my_addon" name="My Addon" version="1.0" provider-name="Your Name">
  <extension point="xbmc.addon.metadata">
    <summary>My Addon</summary>
    <description>This is a simple Kodi addon that plays a single .m3u8 link.</description>
  </extension point>
  <extension point="xbmc.addon.video">
    <video>
      <default>
        <file>MyVideo.py</file>
      </default>
    </video>
  </extension point>
</addon>
Reply

Logout Mark Read Team Forum Stats Members Help
create addon that just play an .m3u8 link0