Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions plugin.video.3catdirectes/addon.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<addon id="plugin.video.3catdirectes" name="3cat Directes" version="1.0.0" provider-name="PereRB">
<requires>
<import addon="xbmc.python" version="3.0.0"/>
</requires>
<extension point="xbmc.python.pluginsource" library="main.py">
<provides>video</provides>
</extension>
<extension point="xbmc.addon.metadata">
<summary lang="en_GB">Live streamings from catalan TV www.3cat.cat</summary>
<description lang="en_GB">Watch online catalan TV channels from https://www.3cat.cat like TV3, 3/24, Esport3, Sx3 and 33</description>
<summary lang="ca_ES">Canals online en directe de la plataforma 3cat</summary>
<description lang="ca_ES">Goita els canals en directe de 3cat/Televisió de Catalunya: TV3, 3/24, Esport3, Sx3 i 33</description>
<summary lang="es_ES">Canales en directo de la plataforma 3cat</summary>
<description lang="es_ES">Mira los canales en directo de 3cat/Televisió de Catalunya: TV3, 3/24, Esport3, Sx3 y 33</description>
<language>ca</language>
<platform>all</platform>
<assets>
<icon>resources/icon.png</icon>
</assets>
</extension>
</addon>
34 changes: 34 additions & 0 deletions plugin.video.3catdirectes/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import xbmcplugin
import xbmcgui
import xbmc

# Diccionari amb els fluxos M3U8
# URLs dels fluxos M3U8
streams = {
"TV3": {"https://directes3-tv-cat.3catdirectes.cat/live-content/tv3-hls/master.m3u8"},
"3/24": {"https://directes-tv-int.3catdirectes.cat/live-content/canal324-hls/master.m3u8"},
"Esport 3": {"https://directes-tv-cat.3catdirectes.cat/live-content/esport3-hls/master.m3u8"},
"SX3": {"https://directes-tv-cat.3catdirectes.cat/live-content/super3-hls/master.m3u8"},
"33": {"https://directes-tv-cat.3catdirectes.cat/live-content/c33-super3-hls/master.m3u8"}
}


# Create a gUI with a table with the available channels
def show_stream_choices():

dialog = xbmcgui.Dialog()

# Grab the table items, which are the channel names from the streams dict keys
stream_names = list(streams.keys())
# Show the menu with the options
choice = dialog.select("Tria un flux per reproduir", stream_names)
if choice != -1: # If not cancel
stream_key = stream_names[choice]
player = xbmc.Player()
player.play(list(streams[stream_key])[0])


# Plugin entry point
if __name__ == "__main__":
show_stream_choices()

Binary file added plugin.video.3catdirectes/resources/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.