diff --git a/README.md b/README.md index 327d565..c2f8f39 100644 --- a/README.md +++ b/README.md @@ -48,6 +48,7 @@ key | type | description ### Attributes * url: URL of the most recent video +* content_id: the content ID (useful for sending to certain media players) * published: The time and date the video was published * stars: The 'stars' recieved on youtube. (This is all reactions both 👍 and 👎 combined) * views: the number of video views diff --git a/custom_components/youtube/sensor.py b/custom_components/youtube/sensor.py index 917e126..287ec4f 100644 --- a/custom_components/youtube/sensor.py +++ b/custom_components/youtube/sensor.py @@ -60,6 +60,7 @@ def __init__(self, channel_id, name, session): self._name = name self.channel_id = channel_id self.url = None + self.content_id = None self.published = None self.channel_live = False self.channel_image = None @@ -85,6 +86,7 @@ async def async_update(self): else: _LOGGER.debug('%s - Skipping live check', self._name) self.url = url + self.content_id = url.split('?v=')[1] self.published = info.split('')[2].split('