{ "strict_mode": true, "cache_path": "cache.sqlite", "docs": { "description": [ "The default config; Meant for general purpose every day URL Cleaning." ], "flags": { "assume-1-dot-2-is-redirect": "Treat all hosts that match the Regex `^.\\...$` as redirects. Let's be real, they all are.", "breezewiki": "Sets the domain of `fandom.com` and [BreezeWiki](https://breezewiki.com/) to the domain specified by the `breezewiki-domain` variable.", "bypass.vip": "Use [bypass.vip](https://bypass.vip) to expand linkvertise and some other links.", "discord-compatibility": "Sets the domain of twitter domiains (and supported twitter redirects like `vxtwitter.com`) to the variable `twitter-embed-domain` and `bsky.app` to the variable `bsky-embed-domain`.", "discord-unexternal": "Replace `images-ext-1.discordapp.net` with the original images they refer to.", "no-https-upgrade": "Disable replacing `http://` with `https://`.", "no-network": "Don't make any HTTP requests.", "no-unmangle-host-is-http-or-https": "Don't convert `https://https//example.com/abc` to `https://example.com/abc`.", "no-unmangle-path-is-url": "Don't convert `https://example1.com/https://example2.com/user` to `https://example2.com/abc`.", "no-unmangle-path-is-url-encoded-url": "Don't convert `https://example.com/https%3A%2F%2Fexample.com%2Fuser` to `https://example.com/user`.", "no-unmangle-second-path-segment-is-url": "Don't convert `https://example1.com/profile/https://example2.com/profile/user` to `https://example2.com/profile/user`.", "no-unmangle-subdomain-ends-in-not-subdomain": "Don't convert `https://profile.example.com.example.com` to `https://profile.example.com`.", "no-unmangle-subdomain-starting-with-www-segment": "Don't convert `https://www.username.example.com` to `https://username.example.com`.", "no-unmangle-twitter-first-path-segment-is-twitter-domain": "If a twitter domain's first path segment is a twitter domain, don't remove it.", "onion-location": "Replace hosts with results from the `Onion-Location` HTTP header if present. This makes an HTTP request one time per domain and caches it.", "tor2web": "Append the suffix specified by the `tor2web-suffix` variable to `.onion` domains.", "tor2web2tor": "Replace `**.onion.**` domains with `**.onion` domains.", "tumblr-unsubdomain-blog": "Changes `blog.tumblr.com` URLs to `tumblr.com/blog` URLs. Doesn't move `at` or `www` subdomains.", "unbreezewiki": "Turn [BreezeWiki](https://breezewiki.com/) into `fandom.com`. See the `breezewiki-hosts` set for which hosts are replaced.", "unmangle": "\"Unmangle\" certain \"invalid but I know what you mean\" URLs. Should not be used with untrusted URLs as malicious actors can use this to sneak malicuous URLs past, for example, email spam filters.", "unmobile": "Convert `https://m.example.com`, `https://mobile.example.com`, `https://abc.m.example.com`, and `https://abc.mobile.example.com` into `https://example.com` and `https://abc.example.com`.", "youtube-unlive": "Turns `https://youtube.com/live/abc` into `https://youtube.com/watch?v=abc`.", "youtube-unplaylist": "Removes the `list` query parameter from `https://youtube.com/watch` URLs.", "youtube-unshort": "Turns `https://youtube.com/shorts/abc` into `https://youtube.com/watch?v=abc`." }, "vars": { "SOURCE_URL": "Used by URL Cleaner Site to handle things wbesites do to links on their pages that's unsuitable to always remove.", "bluesky-embed-domain": "The domain to use for bluesky when the `discord-compatibility` flag is set. Defaults to `fxbsky.com`.", "breezewiki-domain": "The domain to use to turn `fandom.com` and BreezeWiki into [BreezeWiki](https://breezewiki.com/). Defaults to `breezewiki.com`", "bypass.vip-api-key": "The API key used for [bypass.vip](https://bypass.vip)'s premium backend. Overrides the `URL_CLEANER_BYPASS_VIP_API_KEY` environment variable.", "tor2web-suffix": "The suffix to append to the end of `.onion` domains if the flag `tor2web` is enabled. Should not start with `.` as that's added automatically. Left unset by default.", "twitter-embed-domain": "The domain to use for twitter when the `discord-compatibility` flag is set. Defaults to `vxtwitter.com`." }, "environment_vars": { "URL_CLEANER_BYPASS_VIP_API_KEY": "The API key used for [bypass.vip](https://bypass.vip)'s premium backend. Can be overridden with the `bypass.vip-api-key` variable." }, "sets": { "breezewiki-hosts": "Hosts to replace with the `breezewiki-domain` variable when the `breezewiki` flag is enabled. `fandom.com` is always replaced and is therefore not in this set.", "bypass.vip-host-without-www-dot-prefixes": "`HostWithoutWWWDotPrefix`es to use bypass.vip for.", "email-link-format-1-hosts": "(TEMPORARY NAME) Hosts that use unknown link format 1.", "https-upgrade-host-blacklist": "Hosts to not upgrade from `http` to `https` even when the `no-https-upgrade` flag isn't enabled.", "lmgtfy-hosts": "Hosts to replace with `google.com`.", "redirect-host-without-www-dot-prefixes": "Hosts that are considered redirects in the sense that they return HTTP 3xx status codes. URLs with hosts in this set (as well as URLs with hosts that are \"www.\" then a host in this set) will have the `ExpandRedirect` mapper applied.", "redirect-not-subdomains": "The `redirect-host-without-www-dot-prefixes` set but using the `NotSubdomain` of the URL.", "unmangle-path-is-url-blacklist": "Effectively the `no-unmangle-path-is-url` flag for the specified `Host`s.", "unmangle-subdomain-ends-in-not-subdomain-not-subdomain-whitelist": "Effectively the `no-unmangle-subdomain-ends-in-not-subdomain-not-subdomain-whitelist` flag for the specified `NotSubdomain`s.", "unmangle-subdomain-starting-with-www-segment-not-subdomain-whitelist": "Effectively the `no-unmangle-subdomain-starting-with-www-segment` flag for the specified `NotSubdomain`s.", "unmobile-not-subdomain-blacklist": "Effectively unsets the `unmobile` flag for the specified `NotSubdomain`s.", "utps": "The set of \"universal tracking parameters\" that are always removed for any URL with a host not in the `utp-host-whitelist` set. Please note that the `utps` common mapper in the default config also removes any parameter starting with any string in the `utp-prefixes` list and thus parameters starting with those can be omitted from this set.", "utps-host-whitelist": "Hosts to never remove universal tracking parameters from." }, "lists": { "utp-prefixes": "If a query parameter starts with any of the strings in this list (such as `utm_`) it is removed." } }, "params": { "vars": { "bluesky-embed-domain": "fxbsky.app", "breezewiki-domain": "breezewiki.com", "twitter-embed-domain": "vxtwitter.com" }, "sets": { "breezewiki-hosts": [ "antifandom.com", "breeze.hostux.net", "breeze.mint.lgbt", "breeze.nohost.network", "breeze.whateveritworks.org", "breezewiki.catsarch.com", "breezewiki.com", "breezewiki.frontendfriendly.xyz", "breezewiki.hyperreal.coffee", "breezewiki.nadeko.net", "breezewiki.nadekonfkhwlxwwk4ycbvq42zvcjmvo5iakl4tajojjwxd4a5dcetuyd.onion", "breezewiki.pussthecat.org", "breezewiki.woodland.cafe", "bw.artemislena.eu", "bw.hamstro.dev", "bw.projectsegfau.lt", "bw.skunky7dhv7nohsoalpwe3sxfz3fbkad7r3wk632riye25vqm3meqead.onion", "nerd.whatever.social", "z.opnxng.com" ], "redirect-host-without-www-dot-prefixes": [ "2kgam.es", "4.nbcla.com", "a.co", "ab.co", "abc7.la", "abc7ne.ws", "adobe.ly", "aje.io", "aje.io", "amzn.asia", "amzn.ew", "amzn.to", "apple.co", "b23.tv", "bbc.in", "bit.ly", "bitly.com", "bitly.com", "bityl.co", "blizz.ly", "blockclubchi.co", "bloom.bg", "boxd.it", "buff.ly", "bzfd.it", "cbsn.ws", "cfl.re", "chn.ge", "chng.it", "clckhl.co", "cnb.cx", "cnn.it", "cos.lv", "cutt.ly", "db.tt", "dcdr.me", "depop.app.link", "dis.gd", "dlvr.it", "econ.st", "etsy.me", "fal.cn", "fanga.me", "fb.me", "flip.it", "forms.gle", "g.co", "glo.bo", "go.bsky.app", "go.forbes.com", "go.microsoft.com", "go.nasa.gov", "gofund.me", "goo.gl", "goo.su", "gum.co", "hmstr.fr", "hulu.tv", "ift.tt", "intel.ly", "interc.pt", "is.gd", "iwe.one", "j.mp", "jbgm.es", "k00.fr", "katy.to", "kck.st", "kre.pe", "l.leparisien.fr", "link.animaapp.com", "linkr.it", "lnk.to", "loom.ly", "loom.ly", "lpc.ca", "msft.it", "mzl.la", "n.pr", "nas.cr", "ninten.do", "ntdo.co.uk", "nvda.ws", "ny.ti", "nyer.cm", "nyp.st", "nyti.ms", "nyto.ms", "on.forbes.com", "on.ft.com", "on.ft.com", "on.msnbc.com", "on.nyc.gov", "onl.bz", "onl.la", "onl.sc", "operagx.gg", "orlo.uk", "ow.ly", "peoplem.ag", "pin.it", "pixiv.me", "play.st", "politi.co", "prn.to", "propub.li", "pulse.ly", "py.pl", "qr1.be", "rb.gy", "rb.gy", "rblx.co", "rdbl.co", "redd.it", "reurl.cc", "reut.rs", "rzr.to", "s.goodsmile.link", "s.team", "s76.co", "shor.tf", "shorturl.at", "spoti.fi", "spr.ly", "spr.ly", "sqex.to", "t.co", "t.ly", "theatln.tc", "thecut.io", "thr.cm", "thrn.co", "tiny.cc", "tmz.me", "to.pbs.org", "tps.to", "tr.ee", "trib.al", "u.jd.com", "unes.co", "uni.cf", "visitlink.me", "w.wiki", "wlgrn.com", "wlo.link", "wn.nr", "wwdc.io", "x.gd", "xbx.ly", "xhslink.com", "yrp.ca", "nbc4i.co" ], "redirect-not-subdomains": [ "lnk.to", "visitlink.me", "goo.gl", "o93x.net" ], "utps": [ "Tcsack", "__hsfp", "__hssc", "__hstc", "__io_lv", "__s", "_branch_match_id", "_branch_referrer", "_clde", "_cldee", "_ga", "_gl", "_hsenc", "_io_session_id", "_kx", "_ope", "_openstat", "_sgm_action", "_sgm_campaign", "_sgm_source", "_trkparms", "_trksid", "_zucks_suid", "action_object_map", "action_ref_map", "action_type_map", "adfrom", "adjust_adgroup", "adjust_campaign", "adjust_creative", "adjust_referrer", "adjust_tracker", "adjust_tracker_limit", "admitad_uid", "af_ad", "af_adset", "af_click_lookback", "af_force_deeplink", "af_xp", "aiad_clid", "asgtbndr", "at_campaign", "at_campaign_type", "at_creation", "at_emailtype", "at_link", "at_link_id", "at_link_origin", "at_link_type", "at_medium", "at_ptr_name", "at_recipient_id", "at_recipient_list", "at_send_date", "awc", "bsft_aaid", "bsft_clkid", "bsft_eid", "bsft_ek", "bsft_mid", "bsft_uid", "cjdata", "cjevent", "click", "cm_cr", "cm_me", "cmpid", "cuid", "cx_click", "cx_recsOrder", "cx_recsWidget", "dclid", "dpg_campaign", "dpg_content", "dpg_medium", "dpg_source", "ebisAdID", "erid", "et_rid", "external_click_id", "famad_xuid", "fb_action_ids", "fb_action_types", "fb_comment_id", "fb_ref", "fb_source", "fbclid", "gad_source", "gbraid", "gci", "gclid", "gclsrc", "gps_adid", "guccounter", "guce_referrer", "guce_referrer_sig", "hsCtaTracking", "hsa_acc", "hsa_ad", "hsa_cam", "hsa_grp", "hsa_kw", "hsa_la", "hsa_mt", "hsa_net", "hsa_ol", "hsa_src", "hsa_tgt", "hsa_ver", "hsctatracking", "icid", "iclid", "intcmp", "ir_adid", "ir_campaignid", "ir_partnerid", "irclickid", "irgwc", "is_retargeting", "itm_campaign", "itm_content", "itm_medium", "itm_source", "itm_term", "jmtyClId", "maf", "mc_eid", "message", "mindbox", "mindbox-click-id", "mindbox-message-key", "mkt_tok", "ml_subscriber", "ml_subscriber_hash", "msclkid", "mt_link_id", "mtm_campaign", "mtm_cid", "mtm_content", "mtm_group", "mtm_keyword", "mtm_medium", "mtm_placement", "mtm_source", "nx_source", "oft_c", "oft_ck", "oft_d", "oft_id", "oft_ids", "oft_k", "oft_lk", "oft_sk", "oly_anon_id", "oly_enc_id", "oprtrack", "pk_campaign", "pk_cid", "pk_medium", "pk_source", "pk_vid", "rb_clickid", "ref", "referer", "rtkcid", "s_cid", "sms_click", "sms_source", "sms_uph", "source", "spot_im_redirect_source", "srsltid", "ss_email_id", "sscid", "tduid", "ttclid", "twclid", "unicorn_click_id", "user_email_address", "usqp", "vc_lpp", "vero_conv", "vero_id", "vgo_ee", "vsm_cid", "vsm_pid", "vsm_type", "wbraid", "wickedid", "wt_mc", "xtor", "yclid", "ymclid", "ymid", "ysclid" ], "utps-host-whitelist": ["bambulab.com", "www.bambulab.com"], "unmangle-path-is-url-blacklist": [], "unmangle-subdomain-ends-in-not-subdomain-not-subdomain-whitelist": [], "https-upgrade-host-blacklist": ["orteil.dashnet.org"], "unmobile-not-subdomain-blacklist": ["tumblr.com", "deviantart.com"], "unmangle-subdomain-starting-with-www-segment-not-subdomain-whitelist": ["uscourts.gov"], "lmgtfy-hosts": ["lmgtfy.com", "lmgtfy.app", "letmegooglethat.com", "lmgtfy.click", "letmegoogleforyou.com", "lmgt.org"], "bypass.vip-host-without-www-dot-prefixes": [ "adfoc.us", "admiregirls-byme.com", "all-fans.online", "badgirlsdrop.com", "bit.do", "bit.ly", "booo.st", "boost.ink", "bst.gg", "cemendemons.com", "depravityweb.co", "fansmega.com", "free-leaks.com", "goldmega.online", "hotstars-leaks.com", "is.gd", "leakutopia.site", "links-loot.com", "linksloot.net", "linkvertise.com", "loot-link.com", "loot-links.com", "lootdest.com", "lootdest.info", "lootdest.org", "lootlink.org", "lootlinks.co", "mboost.me", "mega-guy.com", "megadropz.com", "megadumpz.com", "newsociety0.co", "ofpacksmega.com", "only-fun.xyz", "onlymega.co", "paster.so", "pnp-drops.me", "premiumstashdrop.com", "rareofhub.com", "rebrand.ly", "rekonise.com", "secret-links.com", "secretpack-links.com", "socialwolvez.com", "sub2get.com", "sub2unlock.com", "sub2unlock.io", "sub2unlock.net", "sub4unlock.io", "t.co", "tavernleaks.com", "thepremium.online", "tiny.cc", "tinylink.onl", "tinyurl.com", "tomxcontent.com", "unlock.com", "unlocknow.net", "v.gd", "wc.wtf", "work.ink", "xprmpacks.com" ], "email-link-format-1-hosts": ["action.openmedia.org"] }, "lists": { "utp-prefixes": [ "__s", "at_custom", "cm_mmc", "utm_" ] }, "http_client_config": { "default_headers": { "user-agent": "curl/8.2.1", "sec-gpc": "1", "dnt": "1" }, "referer": false, "redirect_policy": "None" } }, "commons": { "mappers": { "utps-no-if": { "RemoveQueryParamsMatching": {"Any": [ {"InSet": "utps"}, {"ContainsAnyInList": {"where": "Start", "list": "utp-prefixes"}} ]} }, "utps": {"IfCondition": { "condition": {"Not": {"PartMatches": {"part": "Host", "matcher": {"InSet": "utps-host-whitelist"}}}}, "mapper": {"Common": "utps-no-if"} }}, "extract-from-page-no-if": {"All": [ {"Common": "utps"}, {"SetPart": { "part": "Whole", "value": {"Cache": { "category": "redirect", "key": {"Part": "Whole"}, "value": {"ExtractBetween": { "value": {"HttpRequest": {}}, "start": {"CommonVar": "start"}, "end": {"CommonVar": "end"} }} }} }} ]}, "extract-from-page": {"IfCondition": { "condition": {"Not": {"FlagIsSet": "no-network"}}, "mapper": {"Common": {"name": "extract-from-page-no-if", "args": {"vars": {"start": {"CommonVar": "start"}, "end": {"CommonVar": "end"}}}}} }} } }, "tests": [ { "expectations": [ {"job_config": "https://x.com?t=a&s=b", "result": "https://x.com/"}, {"job_config": "https://example.com?fb_action_ids&mc_eid&ml_subscriber_hash&oft_ck&s_cid&unicorn_click_id", "result": "https://example.com/"}, {"job_config": "https://www.amazon.ca/UGREEN-Charger-Compact-Adapter-MacBook/dp/B0C6DX66TN/ref=sr_1_5?crid=2CNEQ7A6QR5NM&keywords=ugreen&qid=1704364659&sprefix=ugreen%2Caps%2C139&sr=8-5&ufe=app_do%3Aamzn1.fos.b06bdbbe-20fd-4ebc-88cf-fa04f1ca0da8", "result": "https://www.amazon.ca/dp/B0C6DX66TN"}, {"job_config": "http://example.com", "result": "https://example.com/"}, {"job_config": "https://bsky.app", "result": "https://bsky.app/"}, {"job_config": "https://fxbsky.app", "result": "https://bsky.app/"}, {"job_config": "https://bsky.app/profile/user", "result": "https://bsky.app/profile/user.bsky.social"}, {"job_config": "https://bsky.app/profile/user.bsky", "result": "https://bsky.app/profile/user.bsky.social"}, {"job_config": "https://bsky.app/profile/user.com", "result": "https://bsky.app/profile/user.com"}, {"job_config": "https://127.0.0.1", "result": "https://127.0.0.1"}, {"job_config": "https://com" , "result": "https://com"}, {"job_config": "ftp://127.0.0.1" , "result": "ftp://127.0.0.1"}, {"job_config": "file://a/b/c" , "result": "file://a/b/c"} ] }, { "params_diff": {"flags": ["unmangle"]}, "expectations": [ {"job_config": "https://https//example1.com/example2.com/abc", "result": "https://example2.com/abc"}, {"job_config": "https://http//www.deviantart.com/user.deviantart.com/gallery", "result": "https://deviantart.com/user/gallery"}, {"job_config": "https://https//abc.tumblr.com.tumblr.com", "result": "https://abc.tumblr.com"}, {"job_config": "https://abc.deviantart.com.deviantart.com", "result": "https://deviantart.com/abc/"}, {"job_config": "https://https//example.com/abc", "result": "https://example.com/abc"}, {"job_config": "https://https//example1.com/example2.com/abc", "result": "https://example2.com/abc"}, {"job_config": "https://https//example1.com/user/example2.com/abc", "result": "https://example2.com/abc"}, {"job_config": "https://www.username.example.com", "result": "https://username.example.com"}, {"job_config": "https://twitter.com/twitter.com/user" , "result": "https://x.com/user"}, {"job_config": "https://twitter.com/x.com/user" , "result": "https://x.com/user"}, {"job_config": "https://twitter.com/www.twitter.com/user" , "result": "https://x.com/user"}, {"job_config": "https://twitter.com/www.x.com/user" , "result": "https://x.com/user"}, {"job_config": "https://x.com/twitter.com/user" , "result": "https://x.com/user"}, {"job_config": "https://x.com/x.com/user" , "result": "https://x.com/user"}, {"job_config": "https://x.com/www.twitter.com/user" , "result": "https://x.com/user"}, {"job_config": "https://x.com/www.x.com/user" , "result": "https://x.com/user"}, {"job_config": "https://www.twitter.com/twitter.com/user" , "result": "https://www.x.com/user"}, {"job_config": "https://www.twitter.com/x.com/user" , "result": "https://www.x.com/user"}, {"job_config": "https://www.twitter.com/www.twitter.com/user", "result": "https://www.x.com/user"}, {"job_config": "https://www.twitter.com/www.x.com/user" , "result": "https://www.x.com/user"}, {"job_config": "https://www.x.com/twitter.com/user" , "result": "https://www.x.com/user"}, {"job_config": "https://www.x.com/x.com/user" , "result": "https://www.x.com/user"}, {"job_config": "https://www.x.com/www.twitter.com/user" , "result": "https://www.x.com/user"}, {"job_config": "https://www.x.com/www.x.com/user" , "result": "https://www.x.com/user"} ] }, { "params_diff": {"vars": {"tor2web-suffix": "example"}, "flags": ["tor2web"]}, "expectations": [{"job_config": "https://example.onion", "result": "https://example.onion.example"}] }, { "params_diff": {"flags": ["tor2web2tor"]}, "expectations": [ {"job_config": "https://example.onion.com" , "result": "https://example.onion"}, {"job_config": "https://example.onion.co.uk", "result": "https://example.onion"} ] }, { "params_diff": {"flags": ["unbreezewiki"]}, "expectations": [{"job_config": "https://antifandom.com/tardis/wiki/Genocide", "result": "https://tardis.fandom.com/wiki/Genocide"}] }, { "params_diff": {"flags": ["breezewiki"]}, "expectations": [ {"job_config": "https://antifandom.com/tardis/wiki/Genocide", "result": "https://breezewiki.com/tardis/wiki/Genocide"}, {"job_config": "https://tardis.fandom.com/wiki/Genocide" , "result": "https://breezewiki.com/tardis/wiki/Genocide"} ] }, { "params_diff": {"flags": ["unmobile"]}, "expectations": [ {"job_config": "https://en.m.wikipedia.org/wiki/Self-immolation_of_Aaron_Bushnell", "result": "https://en.wikipedia.org/wiki/Self-immolation_of_Aaron_Bushnell"}, {"job_config": "https://en.m.wikipedia.org/wiki/Gaza_genocide", "result": "https://en.wikipedia.org/wiki/Gaza_genocide"} ] }, { "expectations": [ {"job_config": "https://tinyurl.com/wp-tinyurl", "result": "https://en.wikipedia.org/wiki/TinyURL"}, {"job_config": "https://tinyurl.com/preview/wp-tinyurl", "result": "https://en.wikipedia.org/wiki/TinyURL"}, {"job_config": "https://smarturl.it/irl_s05e04?IQid=eg", "result": "https://irlpodcast.org/season5/episode4/"}, {"job_config": "https://gprivate.com/6bi5b", "result": "https://google.com/search?q=Why+do+I+have+to+enter+a+link+to+post+a+request+for+research%3F"}, { "comment": "It was the only somewhat normal one I could find, okay?", "job_config": "http://bfy.tw/9ZSk", "result": "https://google.com/search?q=How+does+the+US+government+work" } ] }, { "params_diff": {"flags": ["bypass.vip"]}, "expectations": [{"job_config": "https://linkvertise.com/514008/hydrogen-gateway-1", "result": "https://api.hydrogen.sh/gateway/callback?stage=1"}] }, { "params_diff": {"flags": ["discord-compatibility"]}, "expectations": [ {"job_config": "https://bsky.app", "result": "https://fxbsky.app/"}, {"job_config": "https://fxbsky.app", "result": "https://fxbsky.app/"} ] } ], "rules": [ { "condition": {"Any": [ {"PartMatches": { "part": "HostWithoutWWWDotPrefix", "matcher": {"Any": [ {"InSet": "redirect-host-without-www-dot-prefixes"}, {"InSet": "bypass.vip-host-without-www-dot-prefixes"}, {"IsOneOf": [ "1link.club", "action.openmedia.org", "allmylinks.com", "api.linkr.bio", "api.pinterest.com", "awin1.com", "bfy.tw", "bugzil.la", "buymeacoff.ee", "buymeacoffee.com", "cach.me", "cash.app", "click.notification.elsevier.com", "deviantart.com", "duckduckgo.com", "duckduckgo.com", "duckduckgogg42xjoc72x3sjasowoarfbgcmvfimaftt6twagswzczad.onion", "e.emailalerts.cnn.com", "facebook.com", "gf.me", "gofundme.com", "gofundme.com", "goodreads.com", "google.com", "gprivate.com", "href.li", "instagr.am", "instagram.com", "l.instagram.com", "l.threads.com", "lmddgtfy.net", "lmgtfy2.com", "lnk.bio", "old.reddit.com", "open.substack.com", "out.reddit.com", "pawoo.net", "pixiv.net", "preview.tinyurl.com", "proxy.notsobot.com", "rd.goodreads.com", "reddit.com", "shareasale-analytics.com", "shareasale.com", "sketchfab.com", "sketchfab.com", "skfb.ly", "smarturl.it", "steamcommunity.com", "subscribestar.adult", "substack.com", "t.umblr.com", "tinyurl.com", "toyhou.se", "youtube.com", "carleton.ca" ]}, {"InSet": "lmgtfy-hosts"}, {"LengthIs": 4}, {"Contains": {"value": "google"}} ]} }}, {"TreatErrorAsFail": {"PartMatches": { "part": "NotSubdomain", "matcher": {"InSet": "redirect-not-subdomains"} }}} ]}, "mapper": {"Rule": { "Repeat": { "rules": [ {"DontTriggerLoop": { "condition": {"All": [ {"PartIs": {"part": "Scheme", "value": "http"}}, {"Not": {"FlagIsSet": "no-https-upgrade"}}, {"Not": {"PartMatches": { "part": "Host", "matcher": {"Any": [ {"InSet": "https-upgrade-host-blacklist"}, {"Regex": "^(\\d+\\.\\d+\\.\\d+\\.\\d+|localhost)$|:"} ]} }}} ]}, "mapper": {"SetPart": {"part": "Scheme", "value": "https"}} }}, { "condition": {"PartMap": { "part": "HostWithoutWWWDotPrefix", "map": { "pixiv.net" : {"PathIs": "/jump.php"}, "deviantart.com": {"PathIs": "/users/outgoing"}, "api.linkr.bio" : {"PathIs": "/callbacks/go"} } }}, "mapper": {"TryElse": { "try": {"SetPart": { "part": "Whole", "value": {"Modified": { "value": {"Part": {"QueryParam": "url"}}, "modification": {"IgnoreError": "UrlDecode"} }} }}, "else": { "SetPart": { "part": "Whole", "value": {"Modified": {"value": {"Part": "Query"}, "modification": "UrlDecode"}} }} }} }, { "PartMap": { "part": "HostWithoutWWWDotPrefix", "map": { "t.co": {"IfCondition": { "condition": {"Not": {"StringIs": {"value": {"ContextVar": "alt_text"}, "value": null}}}, "mapper": {"SetPart": {"part": "Whole", "value": {"ContextVar": "alt_text"}}} }}, "t.umblr.com": {"GetUrlFromQueryParam": "z"}, "skfb.ly": {"All": [ {"SetHost": "sketchfab.com"}, {"SetPart": {"part": {"BeforePathSegment": 0}, "value": "s"}} ]}, "smarturl.it": {"IfCondition": { "condition": {"Not": {"FlagIsSet": "no-network"}}, "mapper": {"All": [ {"Common": "utps"}, {"CacheUrl": { "category": "redirect", "mapper": {"SetPart": { "part": "Whole", "value": {"Modified": { "value": {"HttpRequest": {}}, "modification": {"All": [ {"ExtractBetween": { "start": "\"originalUrl\":\"", "end": "\"" }}, {"Replace": {"find": "\\/", "replace": "/"}} ]} }} }} }} ]} }}, "href.li": {"SetPart": { "part": "Whole", "value": {"Modified": { "value": {"Part": "Query"}, "modification": "UrlDecode" }} }}, "instagr.am": {"SetHost": "instagram.com"}, "bfy.tw": {"IfCondition": { "condition": {"Not": {"FlagIsSet": "no-network"}}, "mapper": {"All": [ {"Common": "utps"}, {"CacheUrl": { "category": "redirect", "mapper": {"SetPart": { "part": "Whole", "value": {"ExtractBetween": { "value": {"HttpRequest": { "http_client_config_diff": {"danger_accept_invalid_certs": true} }}, "start": "href=\"", "end": "\"" }} }} }} ]} }}, "gprivate.com": {"IfCondition": { "condition": {"Not": {"FlagIsSet": "no-network"}}, "mapper": {"All": [ {"Common": "utps"}, {"CacheUrl": { "category": "redirect", "mapper": {"SetPart": { "part": "Whole", "value": {"ExtractBetween": { "value": {"HttpRequest": { "http_client_config_diff": {"danger_accept_invalid_certs": true} }}, "start": "window.location = \"", "end": "\"" }} }} }} ]} }}, "lmddgtfy.net": {"SetHost": "duckduckgo.com"}, "buymeacoff.ee": {"SetHost": "buymeacoffee.com"}, "cach.me": {"SetHost": "cash.app"}, "l.instagram.com": {"GetUrlFromQueryParam": "u"}, "l.threads.com": {"GetUrlFromQueryParam": "u"}, "steamcommunity.com": {"IfCondition": { "condition": {"PartIs": {"part": {"PathSegment": 0}, "value": "linkfilter"}}, "mapper": {"GetUrlFromQueryParam": "u"} }}, "lnk.bio": {"IfCondition": { "condition": {"PathIs": "/go"}, "mapper": {"GetUrlFromQueryParam": "d"} }}, "toyhou.se": {"IfCondition": { "condition": {"PathIs": "/~r"}, "mapper": {"GetUrlFromQueryParam": "q"} }}, "duckduckgo.com": {"IfCondition": { "condition": {"PathIs": "/l/"}, "mapper": {"GetUrlFromQueryParam": "uddg"} }}, "duckduckgogg42xjoc72x3sjasowoarfbgcmvfimaftt6twagswzczad.onion": {"IfCondition": { "condition": {"PathIs": "/l/"}, "mapper": {"GetUrlFromQueryParam": "uddg"} }}, "subscribestar.adult": {"IfCondition": { "condition": {"PathIs": "/away"}, "mapper": {"SetPart": { "part": "Whole", "value": {"Modified": { "value": {"Part": {"QueryParam": "url"}}, "modification": {"All": [ {"Replace": {"find": "\n", "replace": ""}}, "Base64Decode" ]} }} }} }}, "preview.tinyurl.com": {"All": [ {"SetPart": {"part": "Subdomain", "value": null}}, {"SetPart": {"part": {"BeforePathSegment": 0}, "value": "preview"}} ]}, "youtube.com": {"IfCondition": { "condition": {"PathIs": "/redirect"}, "mapper": {"GetUrlFromQueryParam": "q"} }}, "out.reddit.com": {"GetUrlFromQueryParam": "url"}, "e.emailalerts.cnn.com": {"SetPart": { "part": "Whole", "value": {"Modified": { "value": {"Part": "Query"}, "modification": {"All": [ {"KeepNthSegment": {"split": "/", "n": 2}}, {"Remove": 0}, "Base64Decode", {"KeepNthSegment": {"split": ",", "n": -1}} ]} }} }}, "goodreads.com": {"IfCondition": { "condition": {"PathIs": "/gp/r.html"}, "mapper": {"GetUrlFromQueryParam": "U"} }}, "rd.goodreads.com": {"IfCondition": { "condition": {"PathIs": "/gp/r.html"}, "mapper": {"GetUrlFromQueryParam": "U"} }}, "substack.com": {"ConditionChain": [ { "condition": {"PartContains": {"part": "Path", "where": "Start", "value": "/redirect/2/"}}, "mapper": {"SetPart": { "part": "Whole", "value": {"Modified": { "value": {"Part": {"PathSegment": 2}}, "modification": {"All": [ {"KeepNthSegment": {"split": ".", "n": 0}}, "Base64Decode", {"JsonPointer": "/e"} ]} }} }} }, { "condition": {"PathIs": "/app-link/post"}, "mapper": {"AllowQueryParams": ["publication_id", "post_id", "submitLike", "action"]} }, { "condition": {"All": [ {"PartIs": {"part": {"PathSegment": 0}, "value": "redirect"}}, {"PartMatches": {"part": {"PathSegment": 1}, "matcher": {"LengthIs": 36}}} ]}, "mapper": "RemoveQuery" } ]}, "open.substack.com": {"IfCondition": { "condition": {"PartIs": {"part": {"PathSegment": 0}, "value": "pub"}}, "mapper": {"All": [ {"CopyPart": {"from": {"PathSegment": 1}, "to": "Subdomain"}}, {"SetPart": {"part": {"PathSegment": 0}, "value": null}}, {"SetPart": {"part": {"PathSegment": 0}, "value": null}} ]} }}, "click.notification.elsevier.com": {"IfCondition": { "condition": {"PartIs": {"part": {"PathSegment": 0}, "value": "CL0"}}, "mapper": {"SetPart": { "part": "Whole", "value": {"Modified": { "value": {"Part": "Path"}, "modification": {"All": [ {"KeepSegmentRange": {"split": "/", "start": 2}}, "UrlDecode" ]} }} }} }}, "gf.me": {"All": [ {"SetHost": "gofundme.com"}, {"SetPart": {"part": {"BeforePathSegment": 0}, "value": "url_shortener"}} ]}, "action.openmedia.org": {"IfCondition": { "condition": {"PartContains": {"part": "Path", "value": "/page/email/click", "where": "Start"}}, "mapper": "RemoveQuery" }}, "1link.club": {"All": [ {"SetPart": {"part": "Scheme", "value": "https"}}, {"Common": { "name": "extract-from-page", "args": { "vars": { "start": " https://example.com/abc", "comment-2": "https://https//example1.com/example2.com/abc unchanged", "comment-3": "https://https//example1.com/user/example2.com/abc unchanged", "condition": {"TreatErrorAsFail": {"All": [ {"PartContains": {"part": {"PathSegment": 1}, "value": "."}}, {"Not": {"PartContains": {"part": {"NoneToEmptyString": {"PathSegment": 2}}, "value": "."}}}, {"Not": {"PartContains": {"part": {"NoneToEmptyString": {"PathSegment": 3}}, "value": "."}}} ]}}, "mapper": {"All": [ {"CopyPart": {"from": {"PathSegment": 1}, "to": "Host"}}, {"CopyPart": {"from": {"NoneToEmptyString": {"PartSegments": {"part": "Path", "split": "/", "start": 3}}}, "to": "Path"}} ]} }, { "comment-1": "https://https//example1.com/example2.com/abc -> https://example2.com/abc", "comment-2": "https://https//example1.com/user/example2.com/abc unchanged", "condition": {"TreatErrorAsFail": {"PartContains": {"part": {"PathSegment": 2}, "value": "."}}}, "mapper": {"All": [ {"CopyPart": {"from": {"PathSegment": 2}, "to": "Host"}}, {"CopyPart": {"from": {"NoneToEmptyString": {"PartSegments": {"part": "Path", "split": "/", "start": 4}}}, "to": "Path"}} ]} }, { "comment-1": "https://https//example1.com/user/example2.com/abc -> https://example2.com/abc", "condition": {"TreatErrorAsFail": {"All": [ {"Not": {"PartContains": {"part": {"PathSegment": 2}, "value": "."}}}, {"PartContains": {"part": {"PathSegment": 3}, "value": "."}} ]}}, "mapper": {"All": [ {"CopyPart": {"from": {"PathSegment": 3}, "to": "Host"}}, {"CopyPart": {"from": {"PartSegments": {"part": "Path", "split": "/", "start": 5}}, "to": {"NoneToEmptyString": "Path"}}} ]} } ] } }, { "comment": "https://example1.com/https://example2.com/user -> https://example2.com/abc", "condition": {"All": [ {"Not": {"FlagIsSet": "no-unmangle-path-is-url"}}, {"Not": {"PartMatches": {"part": "Host", "matcher": {"InSet": "unmangle-path-is-url-blacklist"}}}}, {"Any": [ {"PartContains": {"part": "Path", "where": "Start", "value": "/http:"}}, {"PartContains": {"part": "Path", "where": "Start", "value": "/https:"}} ]} ]}, "mapper": {"SetPart": { "part": "Whole", "value": {"Modified": {"value": {"Part": "Path"}, "modification": {"StripPrefix": "/"}}} }} }, { "condition": {"All": [ {"Not": {"FlagIsSet": "no-unmangle-path-is-url-encoded-url"}}, {"TreatErrorAsFail": {"PartIs": { "part": "NotSubdomain", "value": {"ExtractPart": { "part": "NotSubdomain", "value": {"Modified": { "value": {"Part": "Path"}, "modification": {"All": ["UrlDecode", {"StripPrefix": "/"}]} }} }} }}} ]}, "mapper": {"SetPart": { "part": "Whole", "value": {"Modified": {"value": {"Part": "Path"}, "modification": {"All": ["UrlDecode", {"StripPrefix": "/"}]}}} }} }, { "comment": "https://example1.com/profile/https://example2.com/profile/user -> https://example2.com/profile/user", "comment2": "The general case requires conditions and mappers to talk to each other and would break the WayBack machine.", "condition": {"All": [ {"Not": {"FlagIsSet": "no-unmangle-second-path-segment-is-url"}}, {"Any": [ {"PartContains": {"part": "Path", "where": "Start", "value": "/http:"}}, {"PartContains": {"part": "Path", "where": "Start", "value": "/https:"}} ]} ]}, "mapper": { "SetPart": { "part": "Whole", "value": {"Part": {"PartSegments": {"part": "Path", "split": "/", "start": 2, "end": null}}} } } }, { "comment": "https://profile.example.com.example.com -> https://profile.example.com", "condition": {"All": [ {"Not": {"FlagIsSet": "no-unmangle-subdomain-ends-in-not-subdomain"}}, {"TreatErrorAsFail": {"Not": {"PartMatches": {"part": "NotSubdomain", "matcher": {"InSet": "unmangle-subdomain-ends-in-not-subdomain-not-subdomain-whitelist"}}}}}, {"TreatErrorAsFail": {"PartContains": { "part": {"PartSegments": {"part": "Domain", "split": ".", "start": 1, "end": null}}, "where": "Start", "value": {"Join": {"sources": [{"Part": "NotSubdomain"}, {"String": "."}]}} }}} ]}, "mapper": {"SetPart": {"part": "NotSubdomain", "value": null}} }, { "comment": "https://www.username.example.com -> https://username.example.com", "condition": {"All": [ {"Not": {"FlagIsSet": "no-unmangle-subdomain-starting-with-www-segment"}}, {"TreatErrorAsFail": {"Not": {"PartMatches": {"part": "NotSubdomain", "matcher": {"InSet": "unmangle-subdomain-starting-with-www-segment-not-subdomain-whitelist"}}}}}, {"TreatErrorAsFail": {"PartContains": {"part": "Subdomain", "where": "Start", "value": "www."}}} ]}, "mapper": {"ModifyPart": {"part": "Subdomain", "modification": {"StripPrefix": "www."}}} } ] } }, { "condition": {"All": [ {"PartIs": {"part": "Scheme", "value": "http"}}, {"Not": {"FlagIsSet": "no-https-upgrade"}}, {"Not": {"PartMatches": {"part": "Host", "matcher": {"Any": [ {"InSet": "https-upgrade-host-blacklist"}, {"Regex": "^(\\d+\\.\\d+\\.\\d+\\.\\d+|localhost)$|:"} ]}}}} ]}, "mapper": {"SetPart": {"part": "Scheme", "value": "https"}} }, { "SharedCondition": { "condition": {"FlagIsSet": "unmobile"}, "rules": [ { "condition": {"All": [ {"Any": [ {"PartIs": {"part": {"DomainSegment": 0}, "value": "m"}}, {"PartIs": {"part": {"DomainSegment": 0}, "value": "mobile"}} ]}, {"Not": { "PartMatches": { "part": "NotSubdomain", "matcher": {"InSet": "unmobile-not-subdomain-blacklist"} } }} ]}, "mapper": {"SetPart": {"part": {"DomainSegment": 0}, "value": null}} }, { "condition": {"Any": [ {"PartIs": {"part": {"DomainSegment": 1}, "value": "m"}}, {"PartIs": {"part": {"DomainSegment": 1}, "value": "mobile"}} ]}, "mapper": {"SetPart": {"part": {"DomainSegment": 1}, "value": null}} } ] } }, { "PartMap": { "comment-1": "If you can't get a certain domain to work here, it may be because Mozilla's Public Suffix List, therefore the psl crate, and therefore UrlPart consideres it a suffix.", "comment-2": "There's another PartMap below this one for UrlPart::Suffix.", "part": "NotSubdomain", "map": { "theonion.com" : "RemoveQuery", "teespring.com": "RemoveQuery", "twitter.com" : {"SetPart": {"part": "NotSubdomain", "value": "x.com"}}, "vxtwitter.com": {"SetHost": "x.com"}, "fixvx.com" : {"SetHost": "x.com"}, "fxtwitter.com": {"SetHost": "x.com"}, "stupidpenisx.com": {"SetHost": "x.com"}, "fxbsky.app": {"IfCondition": { "condition": {"Not": {"FlagIsSet": "discord-compatibility"}}, "mapper": {"SetPart": {"part": "NotSubdomain", "value": "bsky.app"}} }}, "bsky.social": {"IfCondition": { "condition": {"PartMatches": {"part": {"NoneToEmptyString": "Subdomain"}, "matcher": {"Not": {"IsOneOf": ["", "www"]}}}}, "mapper": {"All": [ {"SetPart": {"part": "Path", "value": {"Join": {"sources": ["/profile/", {"Part": "Subdomain"}, ".bsky.social"]}}}}, {"SetHost": "bsky.app"} ]} }}, "youtube.com" : {"All": [ {"RemoveQueryParams": ["si", "feature", "pp"]}, {"IfCondition": { "condition": {"Any": [ {"All": [ {"FlagIsSet": "youtube-unshort"}, {"PartIs": {"part": {"PathSegment": 0}, "value": "shorts"}} ]}, {"All": [ {"FlagIsSet": "youtube-unlive"}, {"PartIs": {"part": {"PathSegment": 0}, "value": "live"}} ]} ]}, "mapper": {"All": [ {"CopyPart": {"from": {"PathSegment": 1}, "to": {"QueryParam": "v"}}}, {"SetPart": {"part": "Path", "value": "watch"}} ]} }}, {"IfCondition": { "condition": {"All": [ {"FlagIsSet": "youtube-unplaylist"}, {"PartIs": {"part": {"PathSegment": 0}, "value": "watch"}} ]}, "mapper": {"RemoveQueryParams": ["list"]} }} ]}, "youtu.be" : {"All": [ {"SetHost" : "youtube.com"}, {"CopyPart": {"from": {"PathSegment": 0}, "to": {"QueryParam": "v"}}}, {"SetPart" : {"part": "Path", "value": "watch"}}, {"RemoveQueryParams": ["si", "feature", "pp"]} ]}, "instagram.com": {"RemoveQueryParams": ["igshid", "igsh", "xmt", "ig_mid", "e", "g"]}, "threads.net" : {"RemoveQueryParams": ["igshid", "igsh", "xmt", "ig_mid", "e", "g"]}, "stackoverflow.com" : {"RemoveQueryParams": ["so_medium", "so_source", "c"]}, "duckduckgo.com" : {"RemoveQueryParams": ["t", "atb", "ia"]}, "duckduckgogg42xjoc72x3sjasowoarfbgcmvfimaftt6twagswzczad.onion": {"RemoveQueryParams": ["t", "atb", "ia"]}, "washingtonpost.com": {"All": [ {"RemoveQueryParams": ["itid", "nid", "arcId", "account_location", "tid", "oscode", "s_l", "acqEntType", "p", "s_ct"]}, {"IfCondition": { "condition": {"TreatErrorAsFail": {"PartContains": {"part": "Fragment", "value": "link", "where": "Start"}}}, "mapper": {"SetPart": {"part": "Fragment", "value": null}} }} ]}, "cnn.com": {"RemoveQueryParams": ["bt_ee", "bt_ts"]}, "facebook.com": {"All": [ {"IfCondition": { "condition": {"PartIs": {"part": {"PathSegment": 0}, "value": "reel"}}, "mapper": "RemoveQuery" }}, {"RemoveQueryParams": ["fs", "s", "mibextid"]} ]}, "bbc.com": {"RemoveQueryParamsMatching": {"Contains": {"where": "Start", "value": "at_"}}}, "linktr.ee": {"RemoveQueryParams": ["ltsid"]}, "theguardian.com": {"RemoveQueryParams": ["CMP"]}, "roblox.com": {"AllowQueryParams": ["keyword", "Keyword"]}, "hp.com": {"RemoveQueryParams": ["jumpid"]}, "lenovo.com": {"RemoveQueryParams": ["IPromoID"]}, "loblaws.ca": {"RemoveQueryParams": ["navid", "icid", "icta"]}, "acer.com": {"RemoveQueryParamsMatching": {"Contains": {"where": "Start", "value": "internal_"}}}, "steampowered.com": {"RemoveQueryParams": ["snr"]}, "yahoo.com": {"RemoveQueryParams": ["p", "src", "pspid", "activity", ".src", "specId", "y"]}, "bell.ca": {"RemoveQueryParams": ["INT"]}, "fxdeviantart.com": {"SetPart": {"part": "NotSubdomain", "value": "deviantart.com"}}, "hulu.com": {"RemoveQueryParams": ["from"]}, "thrn.co": {"All": [ {"SetHost": "throne.com"}, {"SetPart": {"part": {"PathSegment": 0}, "value": null}} ]}, "addons.mozilla.org": {"RemoveQueryParams": ["platform", "appver"]}, "amtrak.com": {"RemoveQueryParams": ["atv", "cmp"]}, "support.google.com": {"AllowQueryParams": ["q"]}, "reddit.com": {"All": [ {"RemoveQueryParams": ["share_id"]}, {"IfCondition": { "condition": {"Not": {"PathIs": "/search"}}, "mapper": {"AllowQueryParams": ["f"]} }} ]}, "cnn.com" : {"IfCondition": { "condition": {"PartContains": {"part": {"PathSegment": -1}, "value": "h_", "where": "Start"}}, "mapper": {"SetPart": {"part": {"PathSegment": -1}, "value": null}} }}, "bell.ca" : {"IfCondition": { "condition": {"TreatErrorAsFail": {"PartContains": {"part": "Fragment", "where": "Start", "value": "INT="}}}, "mapper": {"SetPart": {"part": "Fragment", "value": null}} }}, "pixiv.net": {"IfCondition": { "condition": {"PathIs": "/member.php"}, "mapper": {"All": [ {"SetPart": {"part": "Path", "value": "/users"}}, {"CopyPart": {"from": {"QueryParam": "id"}, "to": "NextPathSegment"}}, "RemoveQuery" ]} }}, "gelbooru.com": {"IfCondition": { "condition": {"PartIs": {"part": {"QueryParam": "page"}, "value": "post"}}, "mapper": {"RemoveQueryParams": ["tags"]} }}, "inkbunny.net": {"IfCondition": { "condition": {"PathIs": "/submissionsviewall.php"}, "mapper": {"RemoveQueryParams": ["rid"]} }}, "go.com": {"RemoveQueryParams": ["cid", "cmp", "att", "t", "DISCID", "r"]}, "marvel.com": {"RemoveQueryParams": ["cid", "cmp", "att", "t", "DISCID", "r"]}, "deviantart.com": {"IfCondition": { "condition": {"All": [ {"Not": {"PartIs": {"part": "Subdomain", "value": "www"}}}, {"Not": {"PartIs": {"part": "Subdomain", "value": ""}}} ]}, "mapper": {"MovePart": {"from": "Subdomain", "to": {"BeforePathSegment": 0}}} }}, "tumblr.com": {"Rules": [ { "condition": {"QueryHasParam": "redirect_to"}, "mapper": {"All": [ {"GetPathFromQueryParam": "redirect_to"}, "RemoveQuery" ]} }, { "condition": {"PathIs": "/safe-mode"}, "mapper": {"GetUrlFromQueryParam": "url"} }, { "condition": {"Not": {"PartIs": {"part": {"PathSegment": 0}, "value": "search"}}}, "mapper": "RemoveQuery" }, { "condition": {"PartIs": {"part": {"PathSegment": 0}, "value": "login_required"}}, "mapper": {"SetPart": {"part": {"PathSegment": 0}, "value": null}} }, { "condition": {"All": [ {"FlagIsSet": "tumblr-unsubdomain-blog"}, {"TreatErrorAsFail": {"PartMatches": {"part": "Subdomain", "matcher": {"Not": {"IsOneOf": ["at", "www"]}}}}} ]}, "mapper": {"All": [ {"IfCondition": { "condition": {"PartIs": {"part": {"PathSegment": 0}, "value": "post"}}, "mapper": {"SetPart": {"part": {"PathSegment": 0}, "value": null}} }}, {"MovePart": {"from": "Subdomain", "to": {"BeforePathSegment": 0}}} ]} } ]}, "goodreads.com": {"All": [ {"RemoveQueryParams": ["ref_"]}, {"IfCondition": { "condition": {"PartContains": {"part": "Path", "where": "Start", "value": "/book/show/"}}, "mapper": "RemoveQuery" }} ]}, "thelancet.com": {"IfCondition": { "condition": {"PartMatches": {"part": {"PathSegment": 0}, "matcher": {"IsOneOf": ["commissions", "journals"]}}}, "mapper": "RemoveQuery" }}, "alibaba.com": {"RemoveQueryParams": ["spm", "selectedCarrierCode", "fsb", "tracelog", "wx_navbar_tramsparent"]}, "fori.io": {"SetHost": "foriio.com"}, "pawoo.net": {"RemoveQueryParams": ["provider"]}, "snapchat.com": {"RemoveQueryParams": ["purpose", "sp"]} } } }, { "PartMap": { "comment": "Some things that look like domains are actually considered suffixes by Mozilla's Public Suffix List, therefore the psl crate, and therefore UrlPart.", "part": "DomainSuffix", "map": { "blogspot.com": {"RemoveQueryParams": ["zx"]} } } }, { "PartMap": { "part": "HostWithoutWWWDotPrefix", "map": { "at.tumblr.com": {"All": [ {"SetHost": "tumblr.com"}, {"SetPart": {"part": {"PathSegment": 1}, "value": null}}, "RemoveQuery" ]}, "danbooru.donmai.us": {"IfCondition": { "condition": {"PartIs": {"part": {"PathSegment": 0}, "value": "posts"}}, "mapper": {"RemoveQueryParams": ["q"]} }}, "x.com": {"Rules": [ { "comment": "https://(www\\.)?(twitter|x).com/(www\\.)?(twitter|x).com -> x.com", "condition": {"All": [ {"FlagIsSet": "unmangle"}, {"Not": {"FlagIsSet": "no-unmangle-twitter-first-path-segment-is-twitter-domain"}}, {"PartMatches": {"part": {"PathSegment": 0}, "matcher": {"IsOneOf": ["x.com", "www.x.com", "twitter.com", "www.twitter.com"]}}} ]}, "mapper": {"SetPart": {"part": {"PathSegment": 0}, "value": null}} }, { "condition": {"PathIs": "/i/flow/login"}, "mapper": {"SetPart": { "part": "Whole", "value": {"Join": {"sources": ["https://x.com", {"Part": {"QueryParam": "redirect_after_login"}}]}} }} }, { "condition": "Always", "mapper": {"AllowQueryParams": ["q", "f", "pf", "lf"]} }, { "condition": {"All": [ {"FlagIsSet": "discord-compatibility"}, {"PartIs": {"part": {"PathSegment": 1}, "value": "status"}} ]}, "mapper": {"SetPart": {"part": "Host", "value": {"Var": "twitter-embed-domain"}}} } ]}, "overview.mail.yahoo.com": "RemoveQuery", "bsky.app": {"Rules": [ { "condition": {"All": [ {"PartIs": {"part": {"PathSegment": 0}, "value": "profile"}}, {"PartContains": {"part": {"PathSegment": 1}, "where": "End", "value": ".bsky"}} ]}, "mapper": {"ModifyPart": {"part": "Path", "modification": {"Append": ".social"}}} }, { "condition": {"All": [ {"PartIs": {"part": {"PathSegment": 0}, "value": "profile"}}, {"Not": {"PartContains": {"part": {"PathSegment": 1}, "value": "."}}}, {"Not": {"PartContains": {"part": {"PathSegment": 1}, "value": ":"}}} ]}, "mapper": {"ModifyPart": {"part": {"PathSegment": 1}, "modification": {"Append": ".bsky.social"}}} }, { "condition": {"FlagIsSet": "discord-compatibility"}, "mapper": {"SetPart": {"part": "NotSubdomain", "value": "fxbsky.app"}} } ]}, "apps.apple.com": {"RemoveQueryParams": ["pt", "ct", "mt"]}, "play.google.com": {"RemoveQueryParams": ["referrer"]}, "sale.alibaba.com": {"IfCondition": { "condition": {"PartIs": {"part": {"PathSegment": 0}, "value": "p"}}, "mapper": {"RemoveQueryParams": ["wx_navbar_transparent", "path", "ncms_spm", "prefetchKey", "wx_xpage", "spm", "cardType"]} }} } } }, { "PartRuleMap": { "part": "DomainMiddle", "map": { "ebay": { "condition": {"PartIs": {"part": {"PathSegment": 0}, "value": "itm"}}, "mapper": "RemoveQuery" }, "pinterest": { "condition": {"Not": {"PartIs": {"part": {"PathSegment": 0}, "value": "search"}}}, "mapper": "RemoveQuery" }, "walmart": { "condition": {"PartIs": {"part": {"PathSegment": 1}, "value": "ip"}}, "mapper": {"SetPart": {"part": {"PathSegment": 2}, "value": null}} }, "bestbuy": { "condition": "Always", "mapper": {"RemoveQueryParams": ["icmp"]} }, "amazon": {"Rules": [ { "condition": {"PartContains": {"part": "Path", "where": "Start", "value": "/gp/offer-listing/"}}, "mapper": {"All": [ {"SetPart": {"part": {"PathSegment": 0}, "value": "dp"}}, {"SetPart": {"part": {"PathSegment": 1}, "value": null}}, {"SetPart": {"part": {"QueryParam": "aod"}, "value": "1"}} ]} }, { "condition": {"PartIs": {"part": {"PathSegment": 1}, "value": "dp"}}, "mapper": {"SetPart": {"part": {"PathSegment": 0}, "value": null}} }, { "condition": {"PartIs": {"part": {"PathSegment": 3}, "value": "dp"}}, "mapper": {"SetPart": {"part": {"PathSegment": 2}, "value": null}} }, { "condition": {"PartContains": {"part": "Path", "value": "/dp/"}}, "mapper": {"AllowQueryParams": ["aod"]} }, { "condition": {"Any": [ {"PartContains": {"part": {"PathSegment": -1}, "where": "Start", "value": "ref="}}, {"All": [ {"PartContains": {"part": "Path", "value": "/dp/"}}, {"Any": [ {"PartContains": {"part": {"PathSegment": -1}, "where": "Anywhere", "value": "-"}}, {"PartMatches" : {"part": {"PathSegment": -1}, "matcher": {"OnlyTheseChars": ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "-"]}}} ]} ]} ]}, "mapper": {"SetPart": {"part": {"PathSegment": -1}, "value": null}} }, { "PartMap": { "part": "Path", "map": { "/s": {"AllowQueryParams": ["k", "i", "rh", "bbn"]}, "/gp/buyagain": {"AllowQueryParams": ["ats"]}, "/gp/customer-reviews": "RemoveQuery", "/amazonprime": "RemoveQuery" } } }, { "condition": {"PartIs": {"part": {"PathSegment": 0}, "value": "product-reviews"}}, "mapper": "RemoveQuery" }, { "condition": "Always", "mapper": {"RemoveQueryParamsMatching": {"Any": [ {"IsOneOf": ["ref", "ref_", "ie", "_encoding", "content-id", "store_ref"]}, {"Contains": {"value": "pd_", "where": "Start"}}, {"Contains": {"value": "pf_", "where": "Start"}} ]}} } ]}, "google": {"Rules": [ { "PartMap": { "part": "Path", "map": { "/search": {"AllowQueryParams": ["hl", "q", "tbm", "p", "udm", "filter"]}, "/setprefs": {"RemoveQueryParams": ["sa", "ved"]} } } }, { "condition": "Always", "mapper": {"RemoveQueryParams": ["sca_esv"]} } ]} } } }, { "StringMap": { "value": {"ExtractPart": {"value": {"Var": "SOURCE_URL"}, "part": "NotSubdomain"}}, "map": { "alibaba.com": {"RemoveQueryParams": ["spm", "file"]}, "aliexpress.com": {"RemoveQueryParams": ["spm", "file"]} } } }, { "condition": {"TreatErrorAsFail": {"PartContains": { "part": "DomainMiddle", "value": "disney" }}}, "mapper": {"RemoveQueryParams": ["cid", "cmp", "att", "t", "DISCID", "r"]} }, { "SharedCondition": { "condition": "AnyFlagIsSet", "rules": [ { "comment": "Discord embeds images using dedicated \"external images\" server(s). This gets the original image.", "condition": {"All": [ {"FlagIsSet": "discord-unexternal"}, {"HostIsOneOf": [ "images-ext-1.discordapp.net", "images-ext-2.discordapp.net", "images-ext-3.discordapp.net" ]} ]}, "mapper": {"All": [ {"CopyPart": {"from": {"PathSegment": 2}, "to": "Scheme"}}, {"CopyPart": {"from": {"PathSegment": 3}, "to": "Host"}}, {"CopyPart": {"from": {"PartSegments": {"part": "Path", "split": "/", "start": 5}}, "to": "Path"}}, "RemoveQuery" ]} }, { "condition": {"All": [ {"Any": [ {"FlagIsSet": "breezewiki"}, {"FlagIsSet": "unbreezewiki"} ]}, {"PartMatches": {"part": "Host", "matcher": {"InSet": "breezewiki-hosts"}}}, {"Not": {"PathIs": "/"}} ]}, "mapper": {"All": [ {"SetHost": "fandom.com"}, {"MovePart": {"from": {"PathSegment": 0}, "to": "Subdomain"}} ]} }, { "condition": {"All": [ {"FlagIsSet": "breezewiki"}, {"UnqualifiedDomain": "fandom.com"} ]}, "mapper": {"All": [ {"CopyPart": {"from": "Subdomain", "to": {"BeforePathSegment": 0}}}, {"SetPart": {"part": "Host", "value": {"Var": "breezewiki-domain"}}} ]} }, { "condition": {"All": [ {"FlagIsSet": "onion-location"}, {"Not": {"FlagIsSet": "no-network"}}, {"PartIs": {"part": "Scheme", "value": "https"}} ]}, "mapper": {"All": [ {"Common": "utps"}, {"IgnoreError": { "SetPart": { "part": "Origin", "value": {"Cache": { "category": "onion-location", "key": {"Part": "Origin"}, "value": {"ExtractPart": { "part": "Origin", "value": {"HttpRequest": {"response_handler": {"Header": "Onion-Location"}}} }} }} } }} ]} }, { "condition": {"All": [ {"Any": [ {"FlagIsSet": "tor2web"}, {"FlagIsSet": "tor2web2tor"} ]}, {"PartIs": {"part": "DomainMiddle", "value": "onion"}} ]}, "mapper": {"SetPart": {"part": "DomainSuffix", "value": null}} }, { "condition": {"All": [ {"FlagIsSet": "tor2web"}, {"PartIs": {"part": {"DomainSegment": -1}, "value": "onion"}} ]}, "mapper": {"SetPart": {"part": "NextDomainSegment", "value": {"Var": "tor2web-suffix"}}} } ] } }, { "comment": "The query paramaters to always remove.", "condition": {"Not": {"PartMatches": {"part": "Host", "matcher": {"InSet": "utps-host-whitelist"}}}}, "mapper": {"Common": "utps-no-if"} } ] }