some streams detection fix

This commit is contained in:
DYefremov
2021-01-02 18:10:58 +03:00
parent ec6ebb2a0e
commit 676bc14f73
2 changed files with 2 additions and 2 deletions

View File

@@ -94,6 +94,7 @@ def get_bouquet(path, bq_name, bq_type):
return "{} [empty]".format(bq_name), services
bq_name = srvs.pop(0)
stream_types = {"4097", "5001", "5002", "8193"}
for num, srv in enumerate(srvs, start=1):
srv_data = srv.strip().split(":")
@@ -103,7 +104,7 @@ def get_bouquet(path, bq_name, bq_type):
elif srv_data[1] == "832":
m_data, sep, desc = srv.partition("#DESCRIPTION")
services.append(BouquetService(desc.strip() if desc else "", BqServiceType.SPACE, srv, num))
elif "http" in srv or srv_data[0] == "8193":
elif srv_data[10].startswith(("http", "rtsp")) or srv_data[0].strip() in stream_types:
stream_data, sep, desc = srv.partition("#DESCRIPTION")
desc = desc.lstrip(":").strip() if desc else srv_data[-1].strip()
services.append(BouquetService(desc, BqServiceType.IPTV, srv, num))

View File

@@ -1202,7 +1202,6 @@ class Application(Gtk.Application):
uris = data.get_uris()
if uris:
from urllib.parse import unquote, urlparse
self.on_import_bouquet(None, file_path=urlparse(unquote(uris[0])).path.strip())
return