-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Live attribute not working again! #11
Comments
ok, I think I have a working solution, however I'm not sure that it has the desired effect. For example, if a new video is uploaded the channel may still show live if another stream is going on. Additionally, if long-term streams are also ongoing, and videos are uploaded, it is possible that the live attribute does not show. I think I have a solution which checks the video itself to find out if that video is being streamed live, which I think would be the preferred option.
|
I tried, i couldn't get it working. but i think your best option would be to do something along the lines of
but i am no Python Programmer! This way it would get it directly from the video page and then if say a channel was streaming more than one thing it would not mess things up! :) |
That's one way i was looking at, checking the latest video. Your code's not quite right, you need to pass the video URL when calling rather than in the definition. I was looking for I tried looking for the live icon on the Channel page, but it is not reliable 100%. If everyone's happy with checking the latest video (rather than the channel) I'll open a PR later. |
I don't think this is correct, I just opened up a live stream from last night (no longer live) and it still has
but an uploaded video does not have it. So it seems like that flag is to show weather it was a live stream or an upload. |
Can you please give details of the video you are checking. sensor:
- platform: youtube
channel_id: UC7G4tLa4Kt6A9e3hJ-HO8ng There was a live stream on his channel yesterday evening (no longer live). |
Sure, this is the video that comes up with
even though it is no longer live (if you do a search in the source for the video) it was also coming up live with the new code you had committed. https://www.youtube.com/watch?v=HBFp2z6tvUg i have made a work around which seems to be working and detecting lives correctly
|
trying with |
thanks @physk confirmed |
No worries, Glad I could help :) |
Version of the custom_component
0.3.1
Describe the bug
Live attribute is not working again (ref #8). Youtube have changed the page again,
BADGE_STYLE_TYPE_LIVE_NOW
(ref #9) is now also not usedlog
I'm looking into alternatives
The text was updated successfully, but these errors were encountered: