from _typeshed import Incomplete
from collections.abc import Callable as Callable
from homeassistant.components.media_player import ATTR_MEDIA_CONTENT_ID as ATTR_MEDIA_CONTENT_ID, ATTR_MEDIA_CONTENT_TYPE as ATTR_MEDIA_CONTENT_TYPE, MEDIA_PLAYER_PLAY_MEDIA_SCHEMA as MEDIA_PLAYER_PLAY_MEDIA_SCHEMA, SERVICE_PLAY_MEDIA as SERVICE_PLAY_MEDIA
from homeassistant.const import ATTR_ENTITY_ID as ATTR_ENTITY_ID
from homeassistant.core import HomeAssistant as HomeAssistant, ServiceCall as ServiceCall
from homeassistant.helpers.typing import ConfigType as ConfigType
from typing import Any

_LOGGER: Incomplete
CONF_CUSTOMIZE_ENTITIES: str
CONF_DEFAULT_STREAM_QUERY: str
DEFAULT_STREAM_QUERY: str
DOMAIN: str
CONFIG_SCHEMA: Incomplete

def setup(hass: HomeAssistant, config: ConfigType) -> bool: ...

class MEDownloadException(Exception): ...
class MEQueryException(Exception): ...

class MediaExtractor:
    hass: Incomplete
    config: Incomplete
    call_data: Incomplete
    def __init__(self, hass: HomeAssistant, component_config: dict[str, Any], call_data: dict[str, Any]) -> None: ...
    def get_media_url(self) -> str: ...
    def get_entities(self) -> list[str]: ...
    def extract_and_send(self) -> None: ...
    def get_stream_selector(self) -> Callable[[str], str]: ...
    def call_media_player_service(self, stream_selector: Callable[[str], str], entity_id: str | None) -> None: ...
    def get_stream_query_for_entity(self, entity_id: str | None) -> str: ...

def get_best_stream(formats: list[dict[str, Any]]) -> str: ...
def get_best_stream_youtube(formats: list[dict[str, Any]]) -> str: ...
