Skip to content

Commit a0dee11

Browse files
back-tobastimeyer
authored andcommitted
plugins.mitele: use '_{bitrate}' and remove duplicates
before ``` [cli][info] Available streams: 360p (worst), 480p, 576p, 720p_alt2, 720p_alt, 720p (best) ``` now ``` [cli][info] Available streams: 360p_364k (worst), 480p_764k, 720p_1564k, 720p_2564k, 576p_5008k, 720p_6891k, 720p_9726k (best) ``` closes #3708
1 parent 3fdd208 commit a0dee11

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/streamlink/plugins/mitele.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ def _get_streams(self):
7878
self.token_errors.get(tokens["code"], "unknown error")))
7979
return
8080

81+
list_urls = []
8182
for stream in pdata["dls"]:
8283
if stream["drm"]:
8384
log.warning("Stream may be protected by DRM")
@@ -87,7 +88,13 @@ def _get_streams(self):
8788
cdn_token = tokens.get(stream["lid"], {}).get("cdn", "")
8889
qsd = parse_qsd(cdn_token)
8990
if sformat == "hls":
90-
yield from HLSStream.parse_variant_playlist(self.session, update_qsd(stream["stream"], qsd)).items()
91+
list_urls.append(update_qsd(stream["stream"], qsd))
92+
93+
if not list_urls:
94+
return
95+
96+
for url in list(set(list_urls)):
97+
yield from HLSStream.parse_variant_playlist(self.session, url, name_fmt="{pixels}_{bitrate}").items()
9198

9299

93100
__plugin__ = Mitele

0 commit comments

Comments
 (0)