from .const import ATTR_FORMAT_QUERY as ATTR_FORMAT_QUERY, ATTR_URL as ATTR_URL, DEFAULT_STREAM_QUERY as DEFAULT_STREAM_QUERY, DOMAIN as DOMAIN, SERVICE_EXTRACT_MEDIA_URL as SERVICE_EXTRACT_MEDIA_URL
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.config_entries import ConfigEntry as ConfigEntry
from homeassistant.const import ATTR_ENTITY_ID as ATTR_ENTITY_ID
from homeassistant.core import HomeAssistant as HomeAssistant, ServiceCall as ServiceCall, ServiceResponse as ServiceResponse, SupportsResponse as SupportsResponse
from homeassistant.exceptions import HomeAssistantError as HomeAssistantError
from homeassistant.helpers.typing import ConfigType as ConfigType
from typing import Any

_LOGGER: Incomplete
CONF_CUSTOMIZE_ENTITIES: str
CONF_DEFAULT_STREAM_QUERY: str
CONFIG_SCHEMA: Incomplete

async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: ...
async def async_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: ...
