-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- list channels - play the streams - couple of settings
- Loading branch information
=
committed
Sep 9, 2023
1 parent
1fe5cfc
commit b9f9dc7
Showing
5 changed files
with
104 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
# plugin.video.fritz-dvbc | ||
Kodi-Addon to list and play DVB-C streams supplied by AVM FRITZ! hardware | ||
|
||
This project is in no way, shape or form affiliated with or endorsed by AVM! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import sys | ||
import urllib.error | ||
|
||
import m3u8 | ||
import xbmcplugin as plugin | ||
from xbmcgui import ListItem, Dialog | ||
|
||
|
||
# filter out #EXTVLCOPT lines in the M3U files to circumvent a bug in m3u8 < 3.6.0 | ||
def drop_extvlcopt(line, lineno, data, state): | ||
if line.startswith('#EXTVLCOPT'): | ||
return True | ||
else: | ||
return False | ||
|
||
|
||
def get_available_channels(): | ||
hostname = plugin.getSetting(addon_handle, 'host') | ||
sources = [] | ||
|
||
if plugin.getSetting(addon_handle, 'tvsd') == 'true': | ||
sources.append(f"http://{hostname}/dvb/m3u/tvsd.m3u") | ||
|
||
if plugin.getSetting(addon_handle, 'tvhd') == 'true': | ||
sources.append(f"http://{hostname}/dvb/m3u/tvhd.m3u") | ||
|
||
channels = [] | ||
try: | ||
for source in sources: | ||
for stream in m3u8.load(source, custom_tags_parser=drop_extvlcopt).segments: | ||
channels.append(dict(title=stream.title, uri=stream.uri)) | ||
except urllib.error.URLError as e: | ||
Dialog().ok("Error", str(e)) | ||
|
||
return channels | ||
|
||
|
||
addon_handle = int(sys.argv[1]) | ||
plugin.setContent(addon_handle, 'videos') | ||
|
||
for available_channel in get_available_channels(): | ||
channel = ListItem(label=available_channel['title']) | ||
channel.setInfo('video', {'title': available_channel['title']}) | ||
plugin.addDirectoryItem(handle=addon_handle, url=available_channel['uri'], listitem=channel) | ||
|
||
plugin.addSortMethod(addon_handle, plugin.SORT_METHOD_TITLE) | ||
plugin.endOfDirectory(addon_handle) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> | ||
<addon | ||
id="plugin.video.fritz-dvbc" | ||
name="FRITZ!DVB-C" | ||
version="0.0.1" | ||
provider-name="MrChick"> | ||
<requires> | ||
<import addon="xbmc.python" version="3.0.1"/> | ||
<import addon="script.module.m3u8" version="3.5.0"/> | ||
</requires> | ||
<extension point="xbmc.python.pluginsource" library="addon.py"> | ||
<provides>video</provides> | ||
</extension> | ||
<extension point="xbmc.addon.metadata"> | ||
<platform>all</platform> | ||
<summary lang="en">List and watch DVB-C streams supplied by your FRITZ! hardware</summary> | ||
<description lang="en">Watch the live tv DVB-C streams supplied by your AVM FRITZ!Box/FRITZ!Repeater | ||
|
||
This project is in no way, shape or form affiliated with or endorsed by AVM! | ||
</description> | ||
<license>GPL-3.0-or-later</license> | ||
<source>https://github.com/mrchick/plugin.video.fritz-dvbc</source> | ||
</extension> | ||
</addon> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Kodi language file | ||
# Addon id: plugin.video.fritz-dvbc | ||
# Addon Provider: MrChick | ||
msgid "" | ||
msgstr "" | ||
"Content-Type: text/plain; charset=UTF-8\n" | ||
"Content-Transfer-Encoding: 8bit\n" | ||
"Language: en\n" | ||
|
||
msgctxt "#30000" | ||
msgid "Device address (hostname or IP)" | ||
msgstr "" | ||
|
||
msgctxt "#30001" | ||
msgid "Include SD channels" | ||
msgstr "" | ||
|
||
msgctxt "#30002" | ||
msgid "Include HD channels" | ||
msgstr "" | ||
|
||
msgctxt "#30010" | ||
msgid "TV formats" | ||
msgstr "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?xml version="1.0" encoding="utf-8" standalone="yes"?> | ||
<settings> | ||
<setting type="text" label="30000" default="fritz.box" id="host"/> | ||
<setting label="30010" type="lsep"/> | ||
<setting type="bool" label="30001" default="true" id="tvsd"/> | ||
<setting type="bool" label="30002" default="true" id="tvhd"/> | ||
</settings> |