Homelab, Linux, JS & ABAP (~˘▾˘)~
 

[YouTube] Combine Metube & SponsorBlock

I have been using MeTube for some time to occasionally download YouTube videos. Now I’ve been looking for a way to combine MeTube with SponsorBlock to get rid of the ads when downloading a file. And it turned out to be possible. You can either use SponsorBlock to add a chapter for an ad segment, or you can use it to remove the ad or any other segment using the remove_sponsor_segments parameter. Currently, it is not possible to do both things (create segment chapters + remove segments). Here the solution to remove ads while downloading:

Create the following JSON File:

{
  "postprocessors": [
    {
      "api": "https://sponsor.ajay.app/",
      "categories": [
        "intro",
        "outro",
        "poi_highlight",
        "selfpromo",
        "sponsor",
        "interaction" 
      ],
      "key": "SponsorBlock",
      "when": "after_filter"
    },
    {
      "force_keyframes": false,
      "key": "ModifyChapters",
      "remove_chapters_patterns": [],
      "remove_ranges": [],
      ""remove_sponsor_segments": ["sponsor","interaction","selfpromo"],
      "sponsorblock_chapter_title": "'[SponsorBlock]: ''%(category_names)l'"
    },
    {
      "add_chapters": true,
      "add_infojson": "none",
      "add_metadata": false,
      "key": "FFmpegMetadata"
    }
  ]
}

The relevant parts here are the categories:

  • intro — video intro segments
  • outro — video endings or credits
  • sponsor — sponsored ads/segments to skip
  • selfpromo — creator self-promotion clips
  • interaction — calls to action (like “subscribe” asks)
  • poi_highlight — important highlights or notable moments (Points of Interest)

And the remove_sponsor_segments parameter. Here you can provide all sections you want to have removed during a download.

The last step is to mount the JSON File into the Container:

version: '3'

services:
  metube:
    image: alexta69/metube
    ports:
      - "8081:8081"
    volumes:
      - ./downloads:/downloads
      - ./ytdl_options.json:/config/ytdl_options.json:ro # the first part must be the path/place of your new created json file
    environment:
      - YTDL_OPTIONS_FILE=/config/ytdl_options.json

To add video links to MeTube you can also use this handy Browser Add-on: MeTube Downloader

[YouTube] Ad-free consumption and other helpful add-ons

When I was at a friend’s house the other day and a YouTube playlist was playing on the TV, I was really shocked. After every video, there were one or two ads (and some of them even in between). I was not aware how extremely many ads you get when using YouTube without an ad blocker. Therefore, a small collection of apps, add-ons and links that help to make YouTube a bit more enjoyable:

Browser

AndroidTV / FireTV

Android

HTPC

DNS Blocking (i.e. with PiHole)


Update 15.01.2024: When using YouTube in a Browser in combination with uBlock, you likely receive the following message right now: “Ad blockers are not allowed on YouTube”. The only working solutions to prevent this message and to continue watching ad-free is disabling uBlock on YouTube and use this Script with Tampermonkey (at least for me).

Update 25.01.2025: I found Chrome Mask very helpful, as I continue to experience problems when using uBlock in combination with Firefox on YouTube.


Update 23.07.2025: To stop the super annoying AI translations, you can use the browser Add-on YouTube No Translation (GitHub).
When using ReVanced, you can force the App to use the original Audio. Got to the ReVanced Settings:
– Miscellaneous → Spoof Video Streams → Standard-Client → iOS TV
– Video → Force original audio → turn on