Add option to hide YouTube Shorts
What is it?
- [ ] Bugfix (user facing)
- [x] Feature (user facing)
- [ ] Codebase improvement (dev facing)
- [ ] Meta improvement to the project (dev facing)
Description of the changes in your PR
Adds an options to hide YouTube Shorts from the feed.
Before/After Screenshots/Screen Record
-
Before:

-
After:

Fixes the following issue(s)
- https://github.com/TeamNewPipe/NewPipe/issues/7644
APK testing
The APK can be found by going to the "Checks" tab below the title. On the left pane, click on "CI", scroll down to "artifacts" and click "app" to download the zip file which contains the debug APK of this PR.
Due diligence
- [x] I read the contribution guidelines.
This is a non-viable solution, as it is planned in the future to extract shorts duration from channels using the accessibility data. Also, this would hide any video if the duration extraction fails in the future.
Note: YouTube will roll out in the future dedicated shorts and live tabs, as you can see in this video.
Thanks for the comments, both.
I spent some more time on this, and struggled to find a way to elegantly implement this, so I raised this PR in NewPipeExtractor to be able to identify streams that are short-form content (i.e. content in the style of TikTok, YouTube Shorts, or Instagram Moment videos), that this PR is contingent on.
I'd like to keep this PR open in the meantime to provide some context for the NewPipeExtractor PR, and for any tangential discussions, e.g.
- whether such setting should be applied globally (channel feeds, trending feeds), or only to subscription feeds
- whether such toggle would be better placed in the settings view
- a more appropriate icon to use for the toggle
It would be nice if this was a unified option to filter types of content: a filter content menu where you can tick on/off
- regular video
- shorts
- live streams
- possibly future videos (premiers), although this would duplicate the show future content button in feed
- other types of content from other services
although this would duplicate the show future content button in feed
@Douile This is the exact button that would need to be changed into a content filter menu. We shouldn't have the same functionality in different buttons/menus.
other types of content from other services
This raises an important point: the filter should be service-specific. So when you change the service from the hamburger menu, the filter menu should change accordingly. Also, it should remember the last set of selections for that service.
whether such setting should be applied globally
@chowder How about only feeds for now?
whether such toggle would be better placed in the settings view
As mentioned above, the "hide premieres" button could be changed into a menu with check boxes. Probably, the last ticked item in the check box shouldn't be untick-able.
a more appropriate icon to use for the toggle
A filter icon? Is that available?
Honestly, I would prefer the eye icon, which is unfortunately taken up by the "hide watched videos" button. But I don't know if we could find another icon for that button, either. Something like a play icon with a tick at the bottom.
Or maybe the "watched videos" button could become just one more check box in the filter menu itself, though visually separated from the content-type check boxes. After all, the functionality is the same - hiding certain videos based on a condition. In that case, the eye icon could be used for this single unified drop-down.
Question: should the filter be feed-specific as well? e.g. you might only want regular videos from a news channel, but livestreams from a gaming channel. And this preference is unlikely to change much. So someone who frequently switches between feeds would have to keep adjusting the filters, which seems inconvenient.
Thank you! I think there are some database-related issues, since the 5.json schema shouldn't change. Could you revert changes in that file? Also, at the moment there does not seem to be any code that actually sets the "is short content" value to stream entities, and so that field is always set to false by default. You will want to use https://github.com/TeamNewPipe/NewPipeExtractor/pull/946 for this :-)
Thanks for reviewing, @Stypox!
Indeed NewPipeExtractor doesn't support the new channel tabs layout at the moment; as such, shorts are currently not being extracted, making this PR somewhat pointless (for now).
I'll mark this as a draft until https://github.com/TeamNewPipe/NewPipeExtractor/pull/951 makes further progress.
I don't know the code of the NewPipe Extractor but there is already a shorts filter in youtube. If you click on a channels videos page only long form content will be displayed, no shorts.
WhatsNew:
Channel View:
So if there is a video shorter than 1min and not in the channel video view it won't be displayed. This would be the filter.
As I said I didn't look into the code but it's just a thought that came to me and I had to share it.
@chowder As channel tabs' PR is merged, you may resume or discontinue working on https://github.com/TeamNewPipe/NewPipe/issues/8069.
Closing due to no response from author







