Skip to content

Commit

Permalink
fixed crash on building series
Browse files Browse the repository at this point in the history
  • Loading branch information
kiddac committed Feb 2, 2025
1 parent df5f732 commit 177d3dd
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,9 @@ def processDownloads(self, stream_type, outputtype=None):
def loadLive(self):
if debugs:
print("*** loadLive ***")

self.clearCaches()

self.live_stream_data = []
settings = glob.current_playlist["settings"]
playlist_info = glob.current_playlist["playlist_info"]
Expand Down Expand Up @@ -382,7 +385,7 @@ def loadLive(self):

try:
bouquet_id1 = int(stream_id) // 65535
bouquet_id2 = int(stream_id) % 65535
bouquet_id2 = int(stream_id) - int(bouquet_id1 * 65535)
except:
continue

Expand Down Expand Up @@ -523,6 +526,9 @@ def loadLive(self):
def loadVod(self):
if debugs:
print("*** loadVod ***")

self.clearCaches()

self.vod_stream_data = []

settings = glob.current_playlist["settings"]
Expand Down Expand Up @@ -573,7 +579,7 @@ def loadVod(self):

try:
bouquet_id1 = int(stream_id) // 65535
bouquet_id2 = int(stream_id) % 65535
bouquet_id2 = int(stream_id) - int(bouquet_id1 * 65535)
except:
continue

Expand Down Expand Up @@ -690,6 +696,8 @@ def loadSeries(self):
if debugs:
print("*** loadSeries ***")

self.clearCaches()

self.series_stream_data = []

settings = glob.current_playlist["settings"]
Expand Down Expand Up @@ -744,7 +752,7 @@ def loadSeries(self):

try:
bouquet_id1 = int(stream_id) // 65535
bouquet_id2 = int(stream_id) % 65535
bouquet_id2 = int(stream_id) - int(bouquet_id1 * 65535)
except:
continue

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,18 +162,24 @@ def downloadUrlMulti(url, output_file=None):

else:
# Collect chunks into memory and return as content
content = ''
"""
if pythonVer == 2:
content = ''
else:
content = b""
"""

for chunk in r.iter_content(chunk_size=chunk_size):
if chunk: # Only append non-empty chunks
if ext == "text":
content += chunk.decode('utf-8', errors='ignore')
"""
if pythonVer == 2:
content += chunk.decode('utf-8', errors='ignore')
else:
content += chunk.decode('utf-8', errors='ignore').encode('utf-8')
"""
else:
content += chunk

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ def parseM3u8Playlist(response):
streamid = 0
url_pattern = re.compile(r'(https?://[^\s]+)')

if isinstance(response, bytes): # Ensure it's a string
response = response.decode('utf-8', 'ignore')

response_lines = response.splitlines()
length = len(response_lines)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,9 @@ def processDownloads(self, stream_type, outputtype=None):
os.remove(output_file)

def loadLive(self):

self.clearCaches()

self.live_stream_data = []

settings = glob.current_playlist["settings"]
Expand Down Expand Up @@ -425,7 +428,7 @@ def loadLive(self):

try:
bouquet_id1 = int(stream_id) // 65535
bouquet_id2 = int(stream_id) % 65535
bouquet_id2 = int(stream_id) - int(bouquet_id1 * 65535)
except:
continue

Expand Down Expand Up @@ -564,6 +567,9 @@ def loadLive(self):
self.finished()

def loadVod(self):

self.clearCaches()

self.vod_stream_data = []

settings = glob.current_playlist["settings"]
Expand Down Expand Up @@ -616,7 +622,7 @@ def loadVod(self):

try:
bouquet_id1 = int(stream_id) // 65535
bouquet_id2 = int(stream_id) % 65535
bouquet_id2 = int(stream_id) - int(bouquet_id1 * 65535)
except:
continue

Expand Down Expand Up @@ -731,6 +737,9 @@ def loadVod(self):
self.finished()

def loadSeries(self):

self.clearCaches()

self.series_stream_data = []

settings = glob.current_playlist["settings"]
Expand Down Expand Up @@ -790,7 +799,7 @@ def loadSeries(self):

try:
bouquet_id1 = int(stream_id) // 65535
bouquet_id2 = int(stream_id) % 65535
bouquet_id2 = int(stream_id) - int(bouquet_id1 * 65535)
except:
continue

Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.44-20250125
1.46-20250201
2 changes: 1 addition & 1 deletion CONTROL/control
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Package: enigma2-plugin-extensions-bouquetmakerxtream
Version: 1.44-20250125
Version: 1.46-20250201
Section: misc
Priority: optional
Architecture: all
Expand Down

0 comments on commit 177d3dd

Please sign in to comment.