Use yt-dlp instead of youtube-dl (#94625)

* Update to use yt-dlp instead of youtube-dl

* Update homeassistant/components/media_extractor/__init__.py

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
This commit is contained in:
Kyle Hildebrandt 2023-06-21 06:16:58 -04:00 committed by GitHub
parent 732ce34a66
commit dcf8db36b7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 7 deletions

View File

@ -2,8 +2,8 @@
import logging
import voluptuous as vol
from youtube_dl import YoutubeDL
from youtube_dl.utils import DownloadError, ExtractorError
from yt_dlp import YoutubeDL
from yt_dlp.utils import DownloadError, ExtractorError
from homeassistant.components.media_player import (
ATTR_MEDIA_CONTENT_ID,
@ -127,7 +127,7 @@ class MediaExtractor:
_LOGGER.error("Could not extract stream for the query: %s", query)
raise MEQueryException() from err
return requested_stream["url"]
return requested_stream["webpage_url"]
return stream_selector
@ -147,7 +147,7 @@ class MediaExtractor:
if entity_id:
data[ATTR_ENTITY_ID] = entity_id
self.hass.async_create_task(
self.hass.create_task(
self.hass.services.async_call(MEDIA_PLAYER_DOMAIN, SERVICE_PLAY_MEDIA, data)
)

View File

@ -5,7 +5,7 @@
"dependencies": ["media_player"],
"documentation": "https://www.home-assistant.io/integrations/media_extractor",
"iot_class": "calculated",
"loggers": ["youtube_dl"],
"loggers": ["yt_dlp"],
"quality_scale": "internal",
"requirements": ["youtube-dl==2021.12.17"]
"requirements": ["yt-dlp==2023.3.4"]
}

View File

@ -2727,7 +2727,7 @@ yolink-api==0.2.9
youless-api==1.0.1
# homeassistant.components.media_extractor
youtube-dl==2021.12.17
yt-dlp==2023.3.4
# homeassistant.components.zamg
zamg==0.2.2