webosbrew / youtube-webos

YouTube app for webOS without ads
GNU General Public License v3.0
593 stars 42 forks source link

Remove shorts from Subscriptions tab #201

Closed JaCzekanski closed 1 month ago

JaCzekanski commented 2 months ago

This PR adds filtering of JSON nodes containing reelWatchEndpoint which is an indicator that given video is a reel/short. Due to the convoluted format of JSON responses, it might not cover all of the cases.

Reel playback seems broken on TVs and I don't really care about having them, as it's ofter reused content. Please note that it'll only work on the Subscriptions tab (which is the one I use the most). However, It should be pretty easy to extend it to other tabs and search results.

Before:

Screenshot 2024-09-18 at 13 45 03

After:

Screenshot 2024-09-18 at 13 45 21

Green settings menu:

Screenshot 2024-09-18 at 13 45 37
FuriousBottle commented 2 months ago

Great work, keen to see this merged - shorts are a real pain point for me

JaCzekanski commented 1 month ago

@FuriousBottle Is there any action needed from my side to have this PR merged?

FuriousBottle commented 1 month ago

@JaCzekanski sorry for the confusion, I am just an admirer, I don't have any authority here 😅

JaCzekanski commented 1 month ago

I tested the current "hardcoded path" approach and recursive search - the latter is slightly slower (~0.2ms on nodejs, mac), but we don't have to store the path so it should be more maintainable in the future.

https://gist.github.com/JaCzekanski/7a35e15473d5bbe62056e6e03e3f5d17

$ node shorts-test.js  # initial Subscriptions response (gridRenderer)
original JSON.parse: 1.969ms
hardcoded remove shorts: 1.842ms
find remove shorts: 2.126ms

$ node shorts-test.js  # continuation response (gridContinuation)
original JSON.parse: 0.399ms
hardcoded remove shorts: 0.397ms
find remove shorts: 0.454ms
throwaway96 commented 1 month ago

I'm not really able to properly test the functionality, but at least it doesn't seem to break anything on K7Lp.

teolabx commented 1 month ago

Hello guys, please tell me when there will be an update with the function of hiding shorts, or now I can replace .js files in the file system via webos dev manager. But I don't know the way. Thanks for the information