mirror of
https://github.com/home-assistant/core.git
synced 2025-07-13 16:27:08 +00:00
Upgrade youtube_dl to 2017.7.9 (#8450)
This commit is contained in:
parent
229000b834
commit
4451d2e847
@ -1,8 +1,8 @@
|
|||||||
"""
|
"""
|
||||||
Decorator service for the media_player.play_media service.
|
Decorator service for the media_player.play_media service.
|
||||||
|
|
||||||
Extracts stream url and sends it to the media_player.play_media
|
For more details about this component, please refer to the documentation at
|
||||||
service.
|
https://home-assistant.io/components/media_extractor/
|
||||||
"""
|
"""
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
@ -12,28 +12,28 @@ from homeassistant.components.media_player import (
|
|||||||
MEDIA_PLAYER_PLAY_MEDIA_SCHEMA, SERVICE_PLAY_MEDIA)
|
MEDIA_PLAYER_PLAY_MEDIA_SCHEMA, SERVICE_PLAY_MEDIA)
|
||||||
from homeassistant.config import load_yaml_config_file
|
from homeassistant.config import load_yaml_config_file
|
||||||
|
|
||||||
|
REQUIREMENTS = ['youtube_dl==2017.7.9']
|
||||||
DOMAIN = 'media_extractor'
|
|
||||||
DEPENDENCIES = ['media_player']
|
|
||||||
REQUIREMENTS = ['youtube_dl==2017.7.2']
|
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
DOMAIN = 'media_extractor'
|
||||||
|
DEPENDENCIES = ['media_player']
|
||||||
|
|
||||||
|
|
||||||
def setup(hass, config):
|
def setup(hass, config):
|
||||||
"""Set up the media_extractor service."""
|
"""Set up the media extractor service."""
|
||||||
descriptions = load_yaml_config_file(
|
descriptions = load_yaml_config_file(
|
||||||
os.path.join(os.path.dirname(__file__),
|
os.path.join(os.path.dirname(__file__),
|
||||||
'media_player', 'services.yaml'))
|
'media_player', 'services.yaml'))
|
||||||
|
|
||||||
def play_media(call):
|
def play_media(call):
|
||||||
"""Get stream url and send it to the media_player.play_media."""
|
"""Get stream URL and send it to the media_player.play_media."""
|
||||||
media_url = call.data.get(ATTR_MEDIA_CONTENT_ID)
|
media_url = call.data.get(ATTR_MEDIA_CONTENT_ID)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
stream_url = get_media_stream_url(media_url)
|
stream_url = get_media_stream_url(media_url)
|
||||||
except YDException:
|
except YDException:
|
||||||
_LOGGER.error("Could not retrieve data for the url: %s",
|
_LOGGER.error("Could not retrieve data for the URL: %s",
|
||||||
media_url)
|
media_url)
|
||||||
return
|
return
|
||||||
else:
|
else:
|
||||||
@ -62,7 +62,7 @@ class YDException(Exception):
|
|||||||
|
|
||||||
|
|
||||||
def get_media_stream_url(media_url):
|
def get_media_stream_url(media_url):
|
||||||
"""Extract stream url from the media url."""
|
"""Extract stream URL from the media URL."""
|
||||||
from youtube_dl import YoutubeDL
|
from youtube_dl import YoutubeDL
|
||||||
from youtube_dl.utils import DownloadError, ExtractorError
|
from youtube_dl.utils import DownloadError, ExtractorError
|
||||||
|
|
||||||
|
@ -965,7 +965,7 @@ yeelight==0.3.0
|
|||||||
yeelightsunflower==0.0.8
|
yeelightsunflower==0.0.8
|
||||||
|
|
||||||
# homeassistant.components.media_extractor
|
# homeassistant.components.media_extractor
|
||||||
youtube_dl==2017.7.2
|
youtube_dl==2017.7.9
|
||||||
|
|
||||||
# homeassistant.components.light.zengge
|
# homeassistant.components.light.zengge
|
||||||
zengge==0.2
|
zengge==0.2
|
||||||
|
Loading…
x
Reference in New Issue
Block a user