Skip to content
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

Enhancement: Allow filtering livestreams from subscription page #258

Open
manuelgrabowski opened this issue Jan 29, 2025 · 2 comments
Open

Comments

@manuelgrabowski
Copy link

Just like #201 did for Shorts, I'd like to see an option to hide live video from the subscriptions list as well.

@manuelgrabowski
Copy link
Author

manuelgrabowski commented Jan 29, 2025

I tried my hand at implementing this by copying what @JaCzekanski did – unfortunately I couldn't identify a uniquely identifying mark for livestreams like the reelWatchEndpoint thing for shorts.

The best I could identify is the fact that for livestreams it says Streamed x hours ago instead of x hours ago. I understand using that to identify the videos is far from ideal to put it mildly – it probably doesn't work with different languages, a currently running livestream is also different… but I at least wanted to see if I could get this approach to work at all. Sadly, I couldn't, and despite trying a lot of things to debug this further I'm at my wits end.

I've looked into the JSON output for my page via the webOS simulator – I could see the reelWatchEndpoint at the expected spot based on the code for hiding Shorts, so I assume I was looking at the correct thing in general. Here's the corresponding output of two videos, a normal one and a livestream. As I said, the only discernable difference to me seems to be the Streamed prefix in one of the lineItemRenderer->text->simpleText items.


My attempts are here: https://github.com/webosbrew/youtube-webos/compare/main...manuelgrabowski:youtube-webos:filter-live-video-from-subscriptions?expand=1 – in the first commit I just copied the entire approach, only changing the callback function for container.items.filter((elm)). After tinkering with that for a while, I was wondering if the two filters might be in conflict, so as another experiment I just added my check to the existing callback function – that's the second commit.

I know that modifying the existing callback function as shown in the second commit works in general. When changing my isLive determination to a simple Math.random() < 0.5, then building the IPK and sending it to my TV, I do indeed get random videos hidden on my subscriptions page. So it must be that my condition isn't working… but it looks logically correct to me.

For debugging, I was unable to get any console.log output to show in the web inspector for the webOS simulator. I have no idea how I'd go about showing debug output directly on the TV itself, or how to use the console in the simulator to try and evaluate my expression there. :/

@fire332
Copy link
Collaborator

fire332 commented Jan 29, 2025

Great attempt. To remotely inspect TV apps, you need to clone this repo and run npm install in the terminal in the same directory. Then npx ares-inspect -a youtube.leanback.v4 also in the same directory. If you've never used the webOS CLI tools before to work directly with your TV, you'll need to run npx ares-setup-device first and follow the prompts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants