Improve cast HLS detection (#72787)
This commit is contained in:
parent
0df9cc907a
commit
44f332ed5f
2 changed files with 20 additions and 7 deletions
|
@ -266,10 +266,8 @@ async def parse_m3u(hass, url):
|
|||
hls_content_types = (
|
||||
# https://tools.ietf.org/html/draft-pantos-http-live-streaming-19#section-10
|
||||
"application/vnd.apple.mpegurl",
|
||||
# Some sites serve these as the informal HLS m3u type.
|
||||
"application/x-mpegurl",
|
||||
"audio/mpegurl",
|
||||
"audio/x-mpegurl",
|
||||
# Additional informal types used by Mozilla gecko not included as they
|
||||
# don't reliably indicate HLS streams
|
||||
)
|
||||
m3u_data = await _fetch_playlist(hass, url, hls_content_types)
|
||||
m3u_lines = m3u_data.splitlines()
|
||||
|
@ -292,6 +290,9 @@ async def parse_m3u(hass, url):
|
|||
elif line.startswith("#EXT-X-VERSION:"):
|
||||
# HLS stream, supported by cast devices
|
||||
raise PlaylistSupported("HLS")
|
||||
elif line.startswith("#EXT-X-STREAM-INF:"):
|
||||
# HLS stream, supported by cast devices
|
||||
raise PlaylistSupported("HLS")
|
||||
elif line.startswith("#"):
|
||||
# Ignore other extensions
|
||||
continue
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue