Home Assistant Unofficial Reference 2024.12.1
homeassistant.components.media_extractor Namespace Reference

Namespaces

 config_flow
 
 const
 

Classes

class  MediaExtractor
 
class  MEDownloadException
 
class  MEQueryException
 

Functions

bool async_setup (HomeAssistant hass, ConfigType config)
 
bool async_setup_entry (HomeAssistant hass, ConfigEntry entry)
 
str get_best_stream (list[dict[str, Any]] formats)
 
str get_best_stream_youtube (list[dict[str, Any]] formats)
 

Variables

 _LOGGER = logging.getLogger(__name__)
 
string CONF_CUSTOMIZE_ENTITIES = "customize"
 
string CONF_DEFAULT_STREAM_QUERY = "default_query"
 
 CONFIG_SCHEMA = cv.config_entry_only_config_schema(DOMAIN)
 

Detailed Description

Decorator service for the media_player.play_media service.

Function Documentation

◆ async_setup()

bool homeassistant.components.media_extractor.async_setup ( HomeAssistant  hass,
ConfigType  config 
)
Set up the media extractor service.

Definition at line 53 of file __init__.py.

◆ async_setup_entry()

bool homeassistant.components.media_extractor.async_setup_entry ( HomeAssistant  hass,
ConfigEntry  entry 
)
Set up Media Extractor from a config entry.

Definition at line 47 of file __init__.py.

◆ get_best_stream()

str homeassistant.components.media_extractor.get_best_stream ( list[dict[str, Any]]  formats)
Return the best quality stream.

As per
https://github.com/yt-dlp/yt-dlp/blob/master/yt_dlp/extractor/common.py#L128.

Definition at line 262 of file __init__.py.

◆ get_best_stream_youtube()

str homeassistant.components.media_extractor.get_best_stream_youtube ( list[dict[str, Any]]  formats)
YouTube responses also include files with only video or audio.

So we filter on files with both audio and video codec.

Definition at line 272 of file __init__.py.

Variable Documentation

◆ _LOGGER

homeassistant.components.media_extractor._LOGGER = logging.getLogger(__name__)
private

Definition at line 39 of file __init__.py.

◆ CONF_CUSTOMIZE_ENTITIES

string homeassistant.components.media_extractor.CONF_CUSTOMIZE_ENTITIES = "customize"

Definition at line 41 of file __init__.py.

◆ CONF_DEFAULT_STREAM_QUERY

string homeassistant.components.media_extractor.CONF_DEFAULT_STREAM_QUERY = "default_query"

Definition at line 42 of file __init__.py.

◆ CONFIG_SCHEMA

homeassistant.components.media_extractor.CONFIG_SCHEMA = cv.config_entry_only_config_schema(DOMAIN)

Definition at line 44 of file __init__.py.