The Official Power User Tips, Tricks & Productivity Thread

Macallik86

Superstar
Supporter
Joined
Dec 4, 2016
Messages
6,841
Reputation
1,642
Daps
22,585

How to Redirect DuckDuckGo !iv Searches to Invidious using Redirector Extension​


1. Open Redirector Extension Settings​

Go to your browser’s extensions page, locate and open Redirector, and click “Add new redirect” or “Create new rule”.

2. Fill in the Rule Template​


  • Example URL:
    Code:
    https://duckduckgo.com/?q=https://www.youtube.com/watch?v=IrzhdyGy8tU!iv
  • Include Pattern (Regular Expression):
    Code:
    (?:https?://)(?:.*\.)?duckduckgo\.com/(?:\?(?:[^&]*&)*q=|(?:\?|&)q=)(?:.*?(?:youtube\.com/watch\?v=|youtu\.be/))([a-zA-Z0-9_-]{11})(?:.*?)(?:(?:%21|!)iv)(?:\W|$)
  • Redirect To:
    Code:
    https://inv.nadeko.net/watch?v=$1
  • Pattern Type: Regular Expression

3. Explanation of Each Field​

  • Include Pattern:
    This regex matches DuckDuckGo search URLs where the q parameter contains a YouTube link with a video ID, followed by !iv.
    It captures the video ID as $1.
  • Redirect To:
    Inserts the captured YouTube ID into the Invidious template:
    https://inv.nadeko.net/watch?v=$1
    This converts any matched DuckDuckGo search to an Invidious video page.
  • Pattern Type:
    Choose Regular Expression to allow for regex capture groups.

4. Example in Redirector UI​

Code:
Name:         DuckDuckGo !iv to Invidious
Example URL:  https://duckduckgo.com/?q=https://www.youtube.com/watch?v=IrzhdyGy8tU!iv
Include Pattern: (?:https?://)(?:.*\.)?duckduckgo\.com/(?:\?(?:[^&]*&)*q=|(?:\?|&)q=)(?:.*?(?:youtube\.com/watch\?v=|youtu\.be/))([a-zA-Z0-9_-]{11})(?:.*?)(?:(?:%21|!)iv)(?:\W|$)
Redirect to:  https://inv.nadeko.net/watch?v=$1
Pattern type: Regular Expression

5. Save and Test​

  • Click Save.
  • Try searching on DuckDuckGo for:
    Code:
    https://www.youtube.com/watch?v=IrzhdyGy8tU!iv
  • When you visit the search result URL, it will immediately redirect to:
    Code:
    https://inv.nadeko.net/watch?v=IrzhdyGy8tU

Notes​

  • This rule is specific: It only triggers when the URL pattern is matched (YouTube in the q param and !iv present).
  • For additional YouTube formats (like youtu.be shortlinks), you may want to further enhance the pattern. The given pattern covers both full and short YouTube video URLs.



Result:
You can now use any DuckDuckGo search with a YouTube URL and the !iv bang to land on the equivalent Invidious video automatically!
Interesting. I use the nadeko instance when my personal Invidious instance goes down...

Is there a benefit to searching DDG and redirecting to nadeko vs just using `insertQueryHere - Invidious` and/or adding nadeko as a search engine in your browser?
 

bnew

Veteran
Joined
Nov 1, 2015
Messages
64,419
Reputation
9,862
Daps
175,089
Interesting. I use the nadeko instance when my personal Invidious instance goes down...

Is there a benefit to searching DDG and redirecting to nadeko vs just using `insertQueryHere - Invidious` and/or adding nadeko as a search engine in your browser?

some youtube links require login now so since duckduckgo is my default search engine I'm use to using bangs and i've hijacked existing ones with redirector for my own queries. so if i have a youtube link in clipboard I don't want to manually change the domain to a invidious instance i can just do !iv + https://www.youtube.com/watch?v=IrzhdyGy8tU and it'll redirect to that instance. i'll still have the option of searching duckduckgo with a youtube url, going directly to youtube and using a bang to go to an indivdious instance.

I posted the wrong instructions before.


```

How to Redirect DuckDuckGo !iv Searches to Invidious using Redirector Extension​


1. Open Redirector Extension Settings​

Go to your browser’s extensions page, locate and open Redirector, and click “Add new redirect” or “Create new rule”.

2. Fill in the Rule Template​


  • Example URL:
    Code:
    https://duckduckgo.com/?q=%21iv+https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DIrzhdyGy8tU&t=ffab
    https://duckduckgo.com/?t=ffab&q=!iv+https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DIrzhdyGy8tU
    https://duckduckgo.com/?t=ffab&q=!iv+https://www.youtube.com/watch?v=IrzhdyGy8tU
  • Include Pattern (Regular Expression):
    Code:
    (?:https?://)(?:.*\.)?duckduckgo\.com/(?:\?(?:[^&]*&)*q=|(?:\?|&)q=)(?:%21iv|!iv)(?:\+|%20| )+(?:https(?:%3A%2F%2F|://)www\.youtube\.com(?:%2Fwatch%3Fv%3D|/watch\?v=)|https(?:%3A%2F%2F|://)youtu\.be(?:%2F|/))([a-zA-Z0-9_-]{11})
  • Redirect To:
    Code:
    https://inv.nadeko.net/watch?v=$1
  • Pattern Type: Regular Expression

3. Explanation of Each Field​

  • Include Pattern:
    This regex matches DuckDuckGo URLs where the q parameter starts with !iv (or %21iv), followed by a separator (+, space, or %20), and a YouTube watch URL (in either encoded or plain format).
    It captures the YouTube video ID as $1.
  • Redirect To:
    The captured YouTube ID ($1) is inserted into your preferred Invidious instance:
    https://inv.nadeko.net/watch?v=$1
  • Pattern Type:
    Choose Regular Expression so the rule captures the video ID dynamically.

4. Example in Redirector UI​

Code:
Name:         DuckDuckGo !iv to Invidious
Example URL:  https://duckduckgo.com/?q=%21iv+https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DIrzhdyGy8tU
Include Pattern: (?:https?://)(?:.*\.)?duckduckgo\.com/(?:\?(?:[^&]*&)*q=|(?:\?|&)q=)(?:%21iv|!iv)(?:\+|%20| )+(?:https(?:%3A%2F%2F|://)www\.youtube\.com(?:%2Fwatch%3Fv%3D|/watch\?v=)|https(?:%3A%2F%2F|://)youtu\.be(?:%2F|/))([a-zA-Z0-9_-]{11})
Redirect to:  https://inv.nadeko.net/watch?v=$1
Pattern type: Regular Expression

5. Save and Test​

  • Click Save.
  • Test with:
    Code:
    https://duckduckgo.com/?q=%21iv+https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DIrzhdyGy8tU
    https://duckduckgo.com/?t=ffab&q=!iv+https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DIrzhdyGy8tU
    https://duckduckgo.com/?t=ffab&q=!iv+https://www.youtube.com/watch?v=IrzhdyGy8tU
  • Each will redirect to:
    Code:
    https://inv.nadeko.net/watch?v=IrzhdyGy8tU

Notes​

  • This rule is specific: It triggers only when !iv comes before a YouTube video URL, in encoded or unencoded forms.
  • It supports both full YouTube URLs and youtu.be shortlinks, whether encoded or not.
  • You can further extend the pattern for additional URL/format support if needed.



Result:
Now you can search DuckDuckGo for any YouTube URL prefixed with !iv and be taken instantly to that video on Invidious!
```
 
Top