Return the actual media url from media extractor (#97408)

This commit is contained in:
Joost Lekkerkerker 2023-07-30 18:43:42 +02:00 committed by GitHub
parent 9d2f52dbc5
commit 2b4387f7c2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -127,7 +127,12 @@ class MediaExtractor:
_LOGGER.error("Could not extract stream for the query: %s", query) _LOGGER.error("Could not extract stream for the query: %s", query)
raise MEQueryException() from err raise MEQueryException() from err
return requested_stream["webpage_url"] if "formats" in requested_stream:
best_stream = requested_stream["formats"][
len(requested_stream["formats"]) - 1
]
return best_stream["url"]
return requested_stream["url"]
return stream_selector return stream_selector