-
Notifications
You must be signed in to change notification settings - Fork 16
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! #18
Comments
I just noticed the same thing and was going to post on the forum but then I thought I should check here first... |
I found this relationship at https://www.youtube.com/channel/[channel_ID]/live html code returns a response "isLive":true |
The live attribute is still working for me. |
Without sensor attributes and configuration there is no way to tell |
In this moment on the Kreator channel is stream live. My sensor return: Sensor are defined: #Kreator
What else should I do? |
I can't even get it to start, something changed with Python 3.9 with |
I'm running full home assistant (home assistant os, supervisor + core) in a proxmox vm. This is strange though as it shouldn't make a difference that I can see, unless you are running core on a different version of python. Unless... I'm just wondering if YouTube generates the page differently depending on country for example. This is however only a speculation |
The script looks for the string in https://www.youtube.com/feeds/videos.xml?channel_id= |
I wonder if it's a language thing, where YT serves the page that is scraped with a different language based on IP |
Maybe this is it. That's why I included my xml. I am currently using YouTube API to check live streams, but there is a query limit of up to 10,000 per day. One search costs 100 units. |
enable debug for the integration, see example in .devcontainer/configuration.yaml |
I enabled debug and this is result: 2021-01-13 12:44:02 DEBUG (MainThread) [custom_components.youtube.sensor] Kreator - Running update |
OK, the "Started streaming" is NOT scraped from the channel's videos.xml page. |
Yes, the latest video is scraped. |
That XML is the channel videos.xml which is only scraped for the link to the latest video. |
I don't understand now how to get you what you need. |
yes, the html page of any live video. Note that while I can use the channel you just linked to work out what is going on, it is not the most recent video, so the sensor would still report the latest video as not live |
ok, I saved this page in the browser as HTML. This is the file. You have inside two examples, |
thanks, that is more than I need. I really only needed the html, but this is the html complete, but no matter, I can get the info from this. It looks like the scraped text is indeed automatically translated into the local language. I'll look if there are alternative options |
Ok, I think I've found something I can use. Can you please save a page from the browser of a live stream which has finished so that I can verify. |
ok, I saved one of the channels wherein strem is offline. This is the file |
That's great, thanks I think I've found a fix, I'll get back to you! |
Are you able to test the sensor.py located in the |
I replaced the sensor.py file and now it works fine. I will test a little and give feedback. |
great, thanks. |
I think you should have permissions to release, if you do, go ahead when you are ready, if not ping me and I'll adjust 👍 |
I checked few channels and sometimes detection not worked. This is a file HTML when detection not worked. Maybe it will help. |
The first video in the zip shows a start date of back in November. If there has been a more recent video published, the sensor would not show live for this. I can't see any other reason why this does not show as live. |
I tested and it looks like the attributes are working. |
Version of the custom_component
0.3.3
Describe the bug
Live attribute return always false but stream is live
The text was updated successfully, but these errors were encountered: