Skip to content

Commit 85e4036

Browse files
author
pereramirbosh
committed
[plugin.video.3catdirectes] v1.0.0
1 parent 559bebc commit 85e4036

File tree

3 files changed

+55
-0
lines changed

3 files changed

+55
-0
lines changed

plugin.video.3catdirectes/addon.xml

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<addon id="plugin.video.3catdirectes" name="3cat Directes" version="1.0.0" provider-name="PereRB">
2+
<requires>
3+
<import addon="xbmc.python" version="3.0.0"/>
4+
</requires>
5+
<extension point="xbmc.python.pluginsource" library="main.py">
6+
<provides>video</provides>
7+
</extension>
8+
<extension point="xbmc.addon.metadata">
9+
<summary lang="en_GB">Live streamings from catalan TV www.3cat.cat</summary>
10+
<description lang="en_GB">Watch online catalan TV channels from https://www.3cat.cat like TV3, 3/24, Esport3, Sx3 and 33</description>
11+
<summary lang="ca_ES">Canals online en directe de la plataforma 3cat</summary>
12+
<description lang="ca_ES">Goita els canals en directe de 3cat/Televisió de Catalunya: TV3, 3/24, Esport3, Sx3 i 33</description>
13+
<summary lang="es_ES">Canales en directo de la plataforma 3cat</summary>
14+
<description lang="es_ES">Mira los canales en directo de 3cat/Televisió de Catalunya: TV3, 3/24, Esport3, Sx3 y 33</description>
15+
<language>ca</language>
16+
<platform>all</platform>
17+
<assets>
18+
<icon>resources/icon.png</icon>
19+
</assets>
20+
</extension>
21+
</addon>

plugin.video.3catdirectes/main.py

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import xbmcplugin
2+
import xbmcgui
3+
import xbmc
4+
5+
# Diccionari amb els fluxos M3U8
6+
# URLs dels fluxos M3U8
7+
streams = {
8+
"TV3": {"https://directes3-tv-cat.3catdirectes.cat/live-content/tv3-hls/master.m3u8"},
9+
"3/24": {"https://directes-tv-int.3catdirectes.cat/live-content/canal324-hls/master.m3u8"},
10+
"Esport 3": {"https://directes-tv-cat.3catdirectes.cat/live-content/esport3-hls/master.m3u8"},
11+
"SX3": {"https://directes-tv-cat.3catdirectes.cat/live-content/super3-hls/master.m3u8"},
12+
"33": {"https://directes-tv-cat.3catdirectes.cat/live-content/c33-super3-hls/master.m3u8"}
13+
}
14+
15+
16+
# Create a gUI with a table with the available channels
17+
def show_stream_choices():
18+
19+
dialog = xbmcgui.Dialog()
20+
21+
# Grab the table items, which are the channel names from the streams dict keys
22+
stream_names = list(streams.keys())
23+
# Show the menu with the options
24+
choice = dialog.select("Tria un flux per reproduir", stream_names)
25+
if choice != -1: # If not cancel
26+
stream_key = stream_names[choice]
27+
player = xbmc.Player()
28+
player.play(list(streams[stream_key])[0])
29+
30+
31+
# Plugin entry point
32+
if __name__ == "__main__":
33+
show_stream_choices()
34+
37.4 KB
Loading

0 commit comments

Comments
 (0)