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

Remove shorts from Subscriptions tab #201

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

JaCzekanski
Copy link

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
Copy link

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

@JaCzekanski
Copy link
Author

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

@FuriousBottle
Copy link

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

Copy link
Member

@throwaway96 throwaway96 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this PR. I'll merge it after these things are addressed.

@@ -6,7 +6,7 @@
"packages": {
"": {
"name": "youtube-webos",
"version": "0.3.3",
"version": "0.3.4",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove this.

@@ -122,6 +122,7 @@ function createOptionsPanel() {
elmContainer.appendChild(createConfigCheckbox('enableAdBlock'));
elmContainer.appendChild(createConfigCheckbox('hideLogo'));
elmContainer.appendChild(createConfigCheckbox('enableSponsorBlock'));
elmContainer.appendChild(createConfigCheckbox('removeShorts'));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should probably either be at the end or before enableSponsorBlock. (Same in config.js.)

Comment on lines +14 to +16
r?.contents?.tvBrowseRenderer?.content?.tvSecondaryNavRenderer?.sections[0]
?.tvSecondaryNavSectionRenderer?.tabs[0]?.tabRenderer?.content
?.tvSurfaceContentRenderer?.content?.gridRenderer;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a pretty long/specific path, and I don't know how stable it will be. Is there another way to find the target element?

Copy link
Author

@JaCzekanski JaCzekanski Oct 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought about it - doing something like a depth search on the r object to find gridRenderer would get rid of the hardcoded path and should be better in terms of keeping it up to date, but it'll run on all JSONs that are being parsed possibly leading to longer loading times/stutter.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be possible to string search the unparsed JSON for gridRenderer and replace it with a misspelling? Would YouTube throw when it encounters unexpected keys?

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

Successfully merging this pull request may close these issues.

4 participants