All Projects → kssytsrk → nx-freestance-handler

kssytsrk / nx-freestance-handler

Licence: GPL-3.0 license
nx-freestance-handler, a redirector from the mainstream sites (Youtube, Twittter, Instagram, Reddit) to their privacy-supporting mirrors

Programming Languages

common lisp
692 projects

Projects that are alternatives of or similar to nx-freestance-handler

nyxt-config
My configuration files for Nyxt browser.
Stars: ✭ 66 (+200%)
Mutual labels:  nyxt
rc
Structured system configuration (I moved from NixOS to GuixSD)
Stars: ✭ 97 (+340.91%)
Mutual labels:  nyxt

nx-freestance-handler

nx-freestance-handler is a redirector from mainstream websites to their privacy-supporting mirrors for the Nyxt browser. The code was inspired by this issue.

It is currently able to redirect from Youtube to Invidious, from Reddit to Teddit, from Instagram to Bibliogram, from Medium to Scribe and from Twitter to Nitter.

Installation

Clone this repository to ~/common-lisp with:

$ git clone https://github.com/kssytsrk/nx-freestance-handler

Usage

To turn the handler on, add something like this to your Nyxt init.lisp file:

(defvar *my-request-resource-handlers* '())

(load-after-system :nx-freestance-handler
                   (nyxt-init-file "freestance.lisp"))

(define-configuration web-buffer
  ((request-resource-hook
    (reduce #'hooks:add-hook
            (mapcar #'make-handler-resource
		    *my-request-resource-handlers*)
            :initial-value %slot-default%))))

Then, create freestance.lisp file in ~/.config/nyxt with these contents:

;; to add all handlers/redirectors (youtube to invidious, reddit to teddit,
;; instagram to bibliogram, medium to scribe, twitter to nitter)
(setq *my-request-resource-handlers*
      (nconc *my-request-resource-handlers*
             nx-freestance-handler:*freestance-handlers*))

;; alternatively, you may add each separately
;; (push #'nx-freestance-handler:invidious-handler *my-request-resource-handlers*)
;; (push #'nx-freestance-handler:nitter-handler *my-request-resource-handlers*)
;; (push #'nx-freestance-handler:bibliogram-handler *my-request-resource-handlers*)
;; (push #'nx-freestance-handler:teddit-handler *my-request-resource-handlers*)
;; (push #'nx-freestance-handler:scribe-handler *my-request-resource-handlers*)

;; to set your preferred instance, either invoke SET-PREFERRED-[name of website]-INSTANCE
;; command in Nyxt (the effect lasts until you close Nyxt), or write something like this:
;; (setf nx-freestance-handler:*preferred-invidious-instance* "https://invidious.snopyta.org")

By default, for Invidious this handler redirects to the healthiest (i.e, with best uptime) instance available. For Teddit it redirects to the official teddit.net instance, for Scribe - to scribe.rip, for Nitter - to nitter.net and for Bibliogram - to bibliogram.art.

FYI, right now direct links to posts on Instagram are not redirected, as Bibliogram doesn't seem to support them (yet?).

Notes

All ideas, suggestions and bugreports are welcome in the "issues" section. Don't hesitate to open an issue if something's not working.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].