iv-org / invidious

Invidious is an alternative front-end to YouTube
https://invidious.io
GNU Affero General Public License v3.0
15.76k stars 1.72k forks source link

Disable annoying YouTube features such as shorts or "premiere" #2585

Open Rjevski opened 2 years ago

Rjevski commented 2 years ago

Is your feature request related to a problem? Please describe.

I'd like to have some option to filter out shorts or "premiere" videos.

Describe the solution you'd like

In my case I use a personal instance with the default settings overridden in config and use an RSS reader for subscriptions (manually adding each channel's RSS URL in there). As a result, I don't use Invidious' account system at all. In my case, a global server-side setting would be enough.

This solution might be problematic for other public instances though; so it should probably be a user-level setting. However, this still doesn't sit right with me as it would still be missing for channel-level RSS feeds.

A solution could be to allow RSS URLs to take query parameters to control this on a per-feed basis and allow the feature to be used without an instance-level account. Some kind of form with dropdowns would ideally need to be offered under the RSS button to allow the user to customize this and not have to manually tweak query params.

Describe alternatives you've considered

Additional context

I mostly use YouTube (and invidious) for long-form content but this "shorts" garbage comes up every so often and is a complete waste of time; if I wanted a TikTok experience I'd just go there directly. "Premiere" is equally annoying and outright user-hostile.

SamantazFox commented 2 years ago

For premiered videos, I guess that they can be ruled out simply by checking if "uploaded time" is after "now". For shorts, I don't know how this can be done. Do they show up in the channel's videos? And in the RSS feed, too? Afaik, shorts are using a separate endpoing that we don't support yet.

Rjevski commented 2 years ago

Shorts show up in channel and RSS views. They work just fine too - it seems like they're just a standard video besides having #shorts in the title, so filtering them out should be easy.

SamantazFox commented 2 years ago

Marking as blocked because it requires a huge rework of the data structures handling the videos first.

onchov commented 2 years ago

Could this be looked at again now that 'shorts' have become a plague?

BloodRaven0 commented 1 year ago

+1 for filtering out shorts. They are super annoying, low-effort clips that try to rip-off ticktock (which is shit itself) and capitalize on the ever-shortening attention span of viewers. All they do is clog subscription and video lists with their stupid vertical thumbnails. YouTube even moved them to their own tab, because of how annoying they are, is there no way to do the same?

SamantazFox commented 1 year ago

YouTube even moved them to their own tab, because of how annoying they are, is there no way to do the same?

Yes, we're working on having the same "tabs" as youtube for shorts and livestreams. This is tracked in #3371.

miangraham commented 1 year ago

For anyone else looking for a short-term solution to the noise, this is how I nuke shorts and premieres on my private instance.

diff --git a/src/invidious/users.cr b/src/invidious/users.cr
index b763596bc..fb3ec4c02 100644
--- a/src/invidious/users.cr
+++ b/src/invidious/users.cr
@@ -176,7 +176,7 @@ def get_subscription_feed(user, max_results = 40, page = 1)
         else
           values = "VALUES #{user.watched.map { |id| %(('#{id}')) }.join(",")}"
         end
-        videos = PG_DB.query_all("SELECT * FROM #{view_name} WHERE NOT id = ANY (#{values}) ORDER BY published DESC LIMIT $1 OFFSET $2", limit, offset, as: ChannelVideo)
+        videos = PG_DB.query_all("SELECT * FROM #{view_name} WHERE NOT id = ANY (#{values}) AND NOT title ILIKE '%shorts' AND views > 0 ORDER BY published DESC LIMIT $1 OFFSET $2", limit, offset, as: ChannelVideo)
       else
         # Sort subscriptions as normal

Not super versatile and you wouldn't want it on a multi-user server but it does the job for me.

Why this instead of just uBlock or another browser-side filter? For premieres that works okay, but if you hide shorts client-side they'll eventually fill up every free space on the page and leave you with nothing visible. Kinda sucks, therefore I'm resorting to a fork.

If there's interest I could potentially turn something like this into a per-user setting that could get upstreamed, but it should probably wait until the "tabs" mentioned above are in place to see if it's even needed.

se7enge commented 1 year ago

Does anyone know of a workaround to remove shorts using something like uBlock? I found some results for this kind of thing for YouTube (such as this: https://old.reddit.com/r/uBlockOrigin/comments/tg220d/filters_to_completely_remove_youtube_shorts_like/) but I'm not sure how functionally implement this for Invidious.

Shorts are mostly a nuisance in the Subscriptions feed; they are tolerable elsewhere.

GaetanLepage commented 1 year ago

@SamantazFox, does the now-merged PR #3419 implements a way to filter shorts or do we need to implement this specific feature on top ?

SamantazFox commented 1 year ago

No, sorry, PR #3419 didn't implement any filtering. Because Youtube separated the channel videos in 3 tabs (which require 3 different types of request), we had to add the required logic in the backend to fetch those tabs, plus the related GUI elements.

The code for the subscriptions uses different way of fetching the channel videos, so specific logic needs to be implemented there to filter our shorts/premiere/lives/etc..

garoto commented 1 year ago

@se7enge

Does anyone know of a workaround to remove shorts using something like uBlock?

I use the below:

instance.one,instance.two,instance.three##.pure-u-md-1-4:has-text(/#shorts/i)

But hardly matters nowadays since more than half won't have the hashtag as part of the titles anymore.

punkie909 commented 1 year ago

I use something similar to @miangraham. It filters videos that are less than 65sec long.. This may be a bit drastic, but it cleans up the feed quite well.

diff --git a/src/invidious/users.cr b/src/invidious/users.cr
index b763596b..147cb1e8 100644
--- a/src/invidious/users.cr
+++ b/src/invidious/users.cr
@@ -180,7 +180,7 @@ def get_subscription_feed(user, max_results = 40, page = 1)
       else
         # Sort subscriptions as normal

-        videos = PG_DB.query_all("SELECT * FROM #{view_name} ORDER BY published DESC LIMIT $1 OFFSET $2", limit, offset, as: ChannelVideo)
+        videos = PG_DB.query_all("SELECT * FROM #{view_name} WHERE length_seconds > 65 ORDER BY published DESC LIMIT $1 OFFSET $2", limit, offset, as: ChannelVideo)
       end
     end

I once even filtered premieres, but that is defunct at the moment. videos = videos.select { |v| !(v.premiere_timestamp.try { |t| t > Time.utc }) }

ForceConstant commented 1 year ago

+1 this feature, was looking today in the settings to disable shorts.

RichyHBM commented 1 year ago

Maybe one approach could be to add a new SHORTS section in addition to the exsisting "[POPULAR] [TRENDING] [SUBSCRIPTIONS] [PLAYLISTS]" that would use something like https://github.com/iv-org/invidious/issues/2585#issuecomment-1417403561 to group up all videos less than X length, then expose the length value to the user as a setting, that way you could filter out likely shorts but still have access to them incase of false positives

GaetanLepage commented 1 year ago

Maybe one approach could be to add a new SHORTS section in addition to the exsisting "[POPULAR] [TRENDING] [SUBSCRIPTIONS] [PLAYLISTS]" that would use something like #2585 (comment) to group up all videos less than X length, then expose the length value to the user as a setting, that way you could filter out likely shorts but still have access to them incase of false positives

Yes, that would be great !

a7maadf commented 1 year ago

Here is a script I'm currently using

https://gist.github.com/a7maadf/22ec4199832fec2751abf09bbea51fa6

Add it to Violent monkey/Tamper monkey and it should work

https://user-images.githubusercontent.com/89315818/226683727-f5449a1b-53b1-4567-b810-95b63e6adc79.mp4

BentiGorlich commented 1 year ago

for anyone wondering how to remove shorts with uBlock Origin:

instance.tld##div.pure-u-md-1-4.pure-u-1:not(:has(.length))

This works for me

garoto commented 1 year ago

Plenty of shorts on my subs have a length field. Former livestreams will also not have a length parameter at least till it's converted from hls to a regular format (dash and single).

prologic commented 11 months ago

Speaking of features to disable, can we please have a way to disable comments? I'd like to run Indivious for my family and I have young children, I really don't want comments at all.

BentiGorlich commented 11 months ago

for anyone wondering how to remove shorts with uBlock Origin:

instance.tld##div.pure-u-md-1-4.pure-u-1:not(:has(.length))

This works for me

Modified it to

instance.tld##div.pure-u-md-1-4.pure-u-1:has(.bottom-right-overlay):not(:has(.length))

So it doesn't interfere with the watch history. I really have not encountered a lot of videos that get through it.

syeopite commented 11 months ago

Speaking of features to disable, can we please have a way to disable comments? I'd like to run Indivious for my family and I have young children, I really don't want comments at all.

Invidious actually already has a way to disable comments. It's just not very clear in the UI.

In the preferences page, if you set both of the default comments drop-down to none then comments will be disabled.

prologic commented 11 months ago

Can this setting be enforced at the instance level though? Trying to protect children here 😆

unixfox commented 11 months ago

Can this setting be enforced at the instance level though? Trying to protect children here 😆

Yes in the settings.yml file?

Don't say: "where?" Try to find it yourself first

CatPlanet commented 9 months ago

Adding a "shorts" category to RSS items would be plenty, as for now channels continue to spew out this garbage straight into the main (and olny) feed.

tristann21 commented 6 months ago

It seems like every single content creator I'm subscribed to now is pushing shorts and is very annoying on the feed, would love something in settings that would just let me tick a box to hide shorts!

seb81 commented 6 months ago

hide by ublock origin

instance.tld##div.pure-u-md-1-4.pure-u-1:has(.bottom-right-overlay):not(:has(.length))
instance.tld##div.pure-u-1.pure-u-md-1-4:has(.length):has-text(/ 0:[0-5][0-9]/)
instance.tld##div.pure-u-1.pure-u-md-1-4:has(.length):has-text(/ 1:[0-2][0-9]/):not(:has-text(/1:[0-5][0-9]:[0-5][0-9]/))
C8opmBM commented 3 months ago

hide by ublock origin

instance.tld##div.pure-u-md-1-4.pure-u-1:has(.bottom-right-overlay):not(:has(.length))
instance.tld##div.pure-u-1.pure-u-md-1-4:has(.length):has-text(/ 0:[0-5][0-9]/)
instance.tld##div.pure-u-1.pure-u-md-1-4:has(.length):has-text(/ 1:[0-2][0-9]/):not(:has-text(/1:[0-5][0-9]:[0-5][0-9]/))

This breaks some of my legit videos/channels from showing. Any update? Thanks!