YouTube Fix & Customizations (4+ Videos Per Row)

duplicate (Weekly Pinned YouTube Thread)

This is a follow-up thread of YouTube homepage 3 videos per row issue and has alternative ways of watching YouTube section as well.

Copy these 7 + 2 (optional) filters below and paste them to uBO "My filters" to revert back to 4 videos per row.

First section is for 4 videos per row, 2nd is for Short Section 6 Videos Per Row Fix, 3rd is for Channel page margin fix on the 4th column, 4th is for font size and line height, 5th is for removing annoying horizontal scrollbar.

6th is for keeping menu closed to have more space for videos. This one prevents the menu from opening even when you click on it for now. If you often use the menu, exclude this filter or simply add an exclamation mark "!" at the beginning of this line.

7th is for Search results video thumb size fix, reverts back to way smaller thumb size.

8th is for Full Width fix for Channel page Videos, Shorts, Live, Podcasts and Playlists tabs, make videos to fill the page. Only use these 2 filters if you set items-per-row to 5 or 6 from the first filter set, "(1/9) 4 Videos Per Row Fix", in 1080p or larger resolutions.

9th is for blocking / hiding any YouTube channel thumbs on the home page. You can either use first one for a single channel or duplicate it for multiple channels and second one for multiple channels with a single filter. Replace "/@channelURL" with the channel URL that you want to block/hide.

Tip: If you want to have more than 4 videos in a row, simply change --ytd-rich-grid-items-per-row and ytd-rich-grid-posts-per-row values to 5 or 6.

! YouTube Fix & Customization by Arch v1.7.4
! (1/9) YouTube 4 Videos Per Row Fix (Home and Channel Pages) / YouTube Fix & Customization
youtube.com##ytd-rich-grid-row, #contents.ytd-rich-grid-row:style(display:contents !important;)
youtube.com##ytd-rich-grid-renderer, html:style(--ytd-rich-grid-items-per-row: 4 !important;)
youtube.com##ytd-rich-grid-renderer, html:style(--ytd-rich-grid-posts-per-row: 4 !important;)
! (2/9) YouTube Home Short Section 6 Videos Per Row Fix / YouTube Fix & Customization
youtube.com##ytd-rich-grid-renderer, html:style(--ytd-rich-grid-slim-items-per-row: 6 !important;)
youtube.com##ytd-rich-grid-renderer, html:style(--ytd-rich-grid-game-cards-per-row: 7 !important;)
youtube.com##+js(set-attr, ytd-rich-shelf-renderer, is-show-more-hidden)
youtube.com##+js(ra, hidden, ytd-rich-item-renderer, stay)
! (3/9) YouTube Channel Page Margin Fix / YouTube Fix & Customization
youtube.com##ytd-rich-item-renderer[is-slim-grid]:first-of-type:style(margin-left: auto !important;)
youtube.com##ytd-rich-item-renderer[is-slim-grid]:last-of-type:style(margin-right: auto !important;)
! (4/9) YouTube Font Size Fix / YouTube Fix & Customization
youtube.com###video-title.ytd-rich-grid-media, #video-title.ytd-rich-grid-slim-media:style(font-size: 1.4rem !important; line-height: 2rem !important;)
youtube.com###metadata-line.ytd-video-meta-block:style(font-size: 1.2rem !important; line-height: 1.8rem !important;)
! (5/9) YouTube Horizontal Scrollbar Fix / YouTube Fix & Customization
youtube.com##body:style(overflow-x: hidden !important;)
! (6/9) YouTube Customizations (Closes menu to have more space for videos) Notice: This rule prevents the menu from opening even when you click on it for now. If you often use the menu, exclude this rule. / YouTube Fix & Customization
youtube.com##tp-yt-app-drawer:remove-attr(/opened|persistent/)
! (7/9) YouTube Search Results Video Thumb Size Fix / YouTube Fix & Customization
youtube.com##ytd-video-renderer[use-bigger-thumbs][bigger-thumbs-style="BIG"] ytd-thumbnail.ytd-video-renderer, ytd-video-renderer[use-bigger-thumbs] ytd-thumbnail.ytd-video-renderer, ytd-radio-renderer[use-bigger-thumbs] ytd-thumbnail.ytd-radio-renderer, #avatar-section.ytd-channel-renderer:style(max-width: 360px !important;)

Optional:

! Optional! Only use these 2 rules below if you set items-per-row and posts-per-row to 5 or 6 from the first filter set, "(1/9) 4 Videos Per Row Fix"
! (8/9) YouTube Channel Page Videos, Shorts, Live, Podcasts and Playlists Tabs Full Width Video Content (Makes video thumbs to fill the page) / YouTube Fix & Customization
youtube.com##:matches-path(//videos|/shorts|/streams|/podcasts|/playlists/) ytd-two-column-browse-results-renderer.grid-5-columns, ytd-two-column-browse-results-renderer.grid-6-columns:style(width: 100% !important;)
youtube.com##ytd-two-column-browse-results-renderer.grid, ytd-rich-grid-renderer[is-shorts-grid] #contents.ytd-rich-grid-renderer:style(max-width: initial !important;)

Blocking Videos by Channel:

! (9/9) YouTube Channel Block (You can block/hide any videos from a specific channel or multiple channels with these filters on the home page. Replace "/@channelURL" with the channel URL that you want to block/hide) / YouTube Fix & Customization
youtube.com##[page-subtype="home"] a[href="/@channelURL"]:upward(ytd-rich-item-renderer)
youtube.com##ytd-search a[href="/@channelURL"]:upward(ytd-video-renderer)
! Blocks multiple channels with a single filter
youtube.com##[page-subtype="home"] :is(a[href="/@channelURL"], a[href="/@channelURL"]):upward(ytd-rich-item-renderer)
youtube.com##ytd-search :is(a[href="/@channelURL"], a[href="/@channelURL"]):upward(ytd-video-renderer)

Updates:

v1.7.4

  • Home Short Section 6 Videos Per Row Fix improved, no more empty space on the 6th row, now it'll show 6 videos for each row. Section is extended and always shows 2 rows.
  • Sections and numbering has changed.
  • Blocking Videos by Channel is improved, now covers search page as well.

^([ Oct 19, 2023 ])

v1.7.3

  • Home Short Section 6 Videos Per Row Fix added.
  • Slight improvements.

^([ Aug 8, 2023 ])

FAQ:

  • "X" is not working! How can I do "Y"?

Please read the comments on the original post before asking any questions, as we most likely have already discussed it there in an 8-month-old post. Thanks!

​

  • I heard that using custom filters causes YouTube's Anti-Adblock and Ads pop-up. Is that correct?

I have tested these filters with Firefox and uBO and have never encountered that pop-up. However, I personally prefer using YouTube while logged out. If you think these filters are causing the pop-up, I suggest trying the Alternative Fix or checking one of the Alternative Ways of Watching YouTube sections below.

Alternative Fix

Alternatively you can install the YouTube Normal Thumbnails userscript to revert to smaller thumbnails. This userscript modifies the YouTube script responsible for calculating thumbnail width and adjusts the thumbnail size based on your browser width. It cleverly watches the calculation and adds +1 to the result. This is what I had intended to achieve with Filters, but we encountered limitations.

If you want to have more than 4 videos in a row, you can edit the userscript to achieve that. However, remember that editing the userscript will disable auto-updating, and you'll need to update it manually if it stops working in the future.

  • Go to 26th line of the code. return origMathMin.apply(Math, arguments) + 1;
  • Change 1 to 2 to have 5 or 3 to have 6 videos per row.
  • Make sure to click Save.

You'll need a userscript manager like Violentmonkey.

Alternative Ways of Watching YouTube

There are Pipe instances that work on browsers (both on desktop and mobile, including Safari) like https://piped.video/ or invidious like https://yewtu.be or https://vid.puffyan.us. There are apps using invidious. As well as apps using Pipe. There is even Yattee that works on iOS! I wrote a how to set up guide about it.

Since it's not allowed to show ads when the video is embedded, one could just share the video they want to watch on facebook, twitter or any other social media profile then watch it there without any ads. Or one could just replace watch?v= with embed/ in the address bar and let YouTube load the video in full screen embed mode and watch it there without any ads. Most of the videos work with this trick unless embedding is turned off for that specific video.

Sample:

https://www.youtube.com/watch?v=NcQQVbioeZk

https://www.youtube.com/embed/NcQQVbioeZk

​

Embed Options:

  • 1 Bookmarklet: I wrote a bookmarklet to convert the current YouTube video tab to an embedded URL. If you aim to keep your extension library compact, this is the way to go. You can watch almost any video without any ads in embed mode. In fact, it works even if you don't have any content blockers installed!

To create the bookmarklet:

  1. Create a new bookmark in your browser.
  2. Give it a name ("YouTube Embed by Arch").
  3. Copy the single-line JavaScript code provided below.
  4. Paste the code into the URL field of the bookmark.
  5. Save the bookmark.

​

javascript:(function(){/^https:\/\/www\.youtube\.com\/watch\?v=/.test(location.href)?location.href=location.href.replace(/\/watch\?v=/,'/embed/'):alert("NOTICE: This works only on youtube.com");})();

​

​

Logged out:

Here's another trick: open the video in a new container, such as Multi-Account Containers, where you're not logged in. It seems that YouTube targets its logged-in users, but simply opening the video in a new container tab (Private Window works as well) where you're not logged in allows you to watch videos without encountering ads. If you're concerned about losing your subscriptions, there's a workaround. Export your YouTube subscriptions (follow these instructions) and import that file to either Piped or Invidious. From there, you can watch videos or use these sites as an alternative YouTube homepage. Clicking on any video will reveal a 'Watch on YouTube' button under the player (if it's not visible, you can turn it on from Preferences). Opening the video in either a new container tab or a Private Window will play it without any ads.

Posted Nov 2, 2023, 1:18 AM UTC

208
Loading comments…