Hi everybody,
I just realized while reading this post after writing it that the latter one (example 2) has a different URL, as it seems to be a user instead of a channel. This might be causing this problem… I’ll still post the original draft here because perhaps somebody still knows how to make this work
I am using the youtube custom_component
; it is supposed to work like this
sensor:
platform: youtube
channel_id: UCZ2Ku6wrhdYDHCaBzLaA3bw
I have currently only added three channels for testing. Two of those have a channel ID, but one has what I’ll refer to as a channel name instead.
Example 1 (working)
- URL : https://www.youtube.com/readytoglare
- click on channel info
- URL: https://www.youtube.com/channel/UC1nJzvNaB_ql4RHrzgozrQQ/about
- ==> Channel ID: UC1nJzvNaB_ql4RHrzgozrQQ
Example 2 (not working)
- URL: UC1nJzvNaB_ql4RHrzgozrQQ
- click on channel info
- URL: https://www.youtube.com/user/msadaghd/about
- ==> channel NAME: msadaghd
So I created
sensor:
- platform: youtube
channel_id: UC1nJzvNaB_ql4RHrzgozrQQ # Ready To Glare
- platform: youtube
channel_id: msadaghd # electroBOOM
I can find sensor.ready_to_glare
, but there is neither sensor.msadaghd
nor sensor.electroboom
.
Is there a way to find “msadaghd”'s channel ID, or is there some way to make the component work with the channel name instead?
Since the custom components uses web scraping, I don’t see why the channel name would not work, as the component should just be able to find the correct URL with it too, correct?
This uses web scraping, a better implementation will be to use the API.