added 8739 stream type

This commit is contained in:
DYefremov
2021-01-11 12:30:44 +03:00
parent b9881fc345
commit 33ffccf57a
4 changed files with 13 additions and 4 deletions

View File

@@ -89,7 +89,7 @@ class BouquetsReader:
""" Class for reading and parsing bouquets. """
_ALT_PAT = re.compile(".*alternatives\\.+(.*)\\.([tv|radio]+).*")
_BQ_PAT = re.compile(".*userbouquet\\.+(.*)\\.+[tv|radio].*")
_STREAM_TYPES = {"4097", "5001", "5002", "8193"}
_STREAM_TYPES = {"4097", "5001", "5002", "8193", "8739"}
__slots__ = ["_path"]

View File

@@ -19,6 +19,7 @@ class StreamType(Enum):
NONE_REC_1 = "5001"
NONE_REC_2 = "5002"
E_SERVICE_URI = "8193"
E_SERVICE_HLS = "8739"
def parse_m3u(path, s_type, detect_encoding=True):

View File

@@ -251,6 +251,9 @@ Author: Dmitriy Yefremov
<row>
<col id="0">eServiceUri</col>
</row>
<row>
<col id="0">eServiceHLS</col>
</row>
</data>
</object>
<object class="GtkDialog" id="iptv_list_configuration_dialog">

View File

@@ -40,7 +40,9 @@ def get_stream_type(box):
return StreamType.NONE_REC_1.value
elif active == 3:
return StreamType.NONE_REC_2.value
return StreamType.E_SERVICE_URI.value
elif active == 4:
return StreamType.E_SERVICE_URI.value
return StreamType.E_SERVICE_HLS.value
class IptvDialog:
@@ -161,6 +163,8 @@ class IptvDialog:
self._stream_type_combobox.set_active(3)
elif stream_type is StreamType.E_SERVICE_URI:
self._stream_type_combobox.set_active(4)
elif stream_type is StreamType.E_SERVICE_HLS:
self._stream_type_combobox.set_active(5)
except ValueError:
self.show_info_message("Unknown stream type {}".format(s_type), Gtk.MessageType.ERROR)
@@ -200,7 +204,8 @@ class IptvDialog:
def on_url_changed(self, entry):
url_str = entry.get_text()
url = urlparse(url_str)
cond = all([url.scheme, url.netloc, url.path]) or self.get_type() == StreamType.E_SERVICE_URI.value
e_types = (StreamType.E_SERVICE_URI.value, StreamType.E_SERVICE_HLS.value)
cond = all([url.scheme, url.netloc, url.path]) or self.get_type() in e_types
entry.set_name("GtkEntry" if cond else _DIGIT_ENTRY_NAME)
yt_id = YouTube.get_yt_id(url_str)
@@ -251,7 +256,7 @@ class IptvDialog:
yield True
def on_stream_type_changed(self, item):
if self.get_type() == StreamType.E_SERVICE_URI.value:
if self.get_type() in (StreamType.E_SERVICE_URI.value, StreamType.E_SERVICE_HLS.value):
self.show_info_message("DreamOS only!", Gtk.MessageType.WARNING)
self.update_reference_entry()