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

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

Open
Rjevski opened this issue Nov 12, 2021 · 27 comments
Open

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

Rjevski opened this issue Nov 12, 2021 · 27 comments
Labels
blocked require something else first feature-request Request of a new feature

Comments

@Rjevski
Copy link
Contributor

Rjevski commented Nov 12, 2021

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.

@Rjevski Rjevski added the feature-request Request of a new feature label Nov 12, 2021
@SamantazFox
Copy link
Member

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

Rjevski commented Nov 13, 2021

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 SamantazFox added the blocked require something else first label Feb 3, 2022
@SamantazFox
Copy link
Member

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

@onchov

This comment was marked as resolved.

@BloodRaven0

This comment was marked as spam.

@SamantazFox
Copy link
Member

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

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

se7enge commented Dec 29, 2022

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

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

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

garoto commented Feb 1, 2023

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

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

This comment was marked as spam.

@RichyHBM
Copy link

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

@GaetanLepage

This comment was marked as resolved.

@a7maadf
Copy link

a7maadf commented Mar 21, 2023

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

My.Video3.mp4

@BentiGorlich
Copy link

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

garoto commented Jul 25, 2023

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

This comment was marked as off-topic.

@BentiGorlich
Copy link

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

This comment was marked as off-topic.

@prologic

This comment was marked as off-topic.

@unixfox

This comment was marked as off-topic.

@CatPlanet

This comment was marked as duplicate.

@tristann21

This comment was marked as duplicate.

@seb81
Copy link

seb81 commented Jan 30, 2024

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

C8opmBM commented Apr 10, 2024

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked require something else first feature-request Request of a new feature
Projects
Status: Invidious features
Invidious - New features
Invidious features
Development

No branches or pull requests