From b2e4b345a043b4b9005407572211fc1186e5eb81 Mon Sep 17 00:00:00 2001 From: Tuxedo Takodachi Date: Sat, 18 Mar 2023 10:25:58 +0100 Subject: [PATCH] Port: Replace Google image search link with Google Lens. And: Switch Google image search back to old version, thanks to https://boards.4channel.org/g/thread/91737566#p91789527 from f3f03f5e79fb5f26c0fd4406b2ab6796851ea471 and c68a8afbdf30e3cbb35f0834b364f20600151adf --- src/General/Settings.tsx | 13 +++++++++++++ src/config/Config.js | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/General/Settings.tsx b/src/General/Settings.tsx index 424932954..986e612bd 100644 --- a/src/General/Settings.tsx +++ b/src/General/Settings.tsx @@ -798,6 +798,19 @@ vp-replace set('archiveLists', data['archiveLists'].replace('https://nstepien.github.io/archives.json/archives.json', 'https://4chenz.github.io/archives.json/archives.json')); } } + if (compareString < '00001.00014.00022.00002') { + if (data['sauces']) { + set('sauces', data['sauces'].replace(/^#?\s*https:\/\/www\.google\.com\/searchbyimage\?image_url=%(IMG|T?URL)&safe=off(?=$|;)/mg, 'https://lens.google.com/uploadbyurl?url=%$1')); + } + } + if (compareString < '00001.00014.00022.00003') { + if (data['sauces']) { + set('sauces', data['sauces'].replace(/^#?\s*https:\/\/lens\.google\.com\/uploadbyurl\?url=%(IMG|T?URL)(?=$|;)/mg, 'https://www.google.com/searchbyimage?sbisrc=4chanx&image_url=%$1&safe=off')); + addSauces([ + '#https://lens.google.com/uploadbyurl?url=%IMG;text:lens' + ]); + } + } return changes; }, diff --git a/src/config/Config.js b/src/config/Config.js index f148e2030..1f1d6d4d3 100644 --- a/src/config/Config.js +++ b/src/config/Config.js @@ -791,7 +791,7 @@ https://flickr.com/photo.gne?id=%$1;regexp:/^(\\d+)_[\\da-f]{10}(?:_\\w)*\\b/ https://www.facebook.com/photo.php?fbid=%$1;regexp:/^\\d+_(\\d+)_\\d+_[no]\\b/ # Reverse image search: -https://www.google.com/searchbyimage?image_url=%IMG&safe=off +https://www.google.com/searchbyimage?sbisrc=4chanx&image_url=%IMG&safe=off https://yandex.com/images/search?rpt=imageview&url=%IMG #//tineye.com/search?url=%IMG #//www.bing.com/images/search?q=imgurl:%IMG&view=detailv2&iss=sbi#enterInsights