changed URL extraction for IPTV (#187)

This commit is contained in:
DYefremov
2023-11-05 17:17:49 +03:00
parent 32a847fc5d
commit 3f0e9e44a9

View File

@@ -819,13 +819,16 @@ def append_text_to_tview(char, view):
def get_iptv_url(row, s_type, column=Column.FAV_ID):
""" Returns url from iptv type row """
""" Returns URL from IPTV type row. """
data = row[column].split(":" if s_type is SettingsType.ENIGMA_2 else "::")
if s_type is SettingsType.ENIGMA_2:
data = list(filter(lambda x: "http" in x, data))
if data:
url = data[0]
return unquote(url) if s_type is SettingsType.ENIGMA_2 else url
if s_type is SettingsType.ENIGMA_2:
if len(data) > 10 and "http" in data[10]:
url, sep, desc = data[10].partition("#DESCRIPTION")
return unquote(url.strip())
else:
return data[0]
def get_iptv_data(fav_id):