From 84e65107449076f7c6e778969f944184c9093d66 Mon Sep 17 00:00:00 2001 From: ccd0 Date: Sat, 28 Mar 2020 21:17:24 -0700 Subject: [PATCH] Sauce: Update DeviantArt URL format. #2563 --- src/General/Settings.coffee | 6 ++++++ src/config/Config.coffee | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/General/Settings.coffee b/src/General/Settings.coffee index 1d61bd555..5b28d6d65 100644 --- a/src/General/Settings.coffee +++ b/src/General/Settings.coffee @@ -530,6 +530,12 @@ Settings = if compareString < '00001.00014.00016.00001' if data['archiveLists']? set 'archiveLists', data['archiveLists'].replace('https://mayhemydg.github.io/archives.json/archives.json', 'https://nstepien.github.io/archives.json/archives.json') + if compareString < '00001.00014.00016.00007' + if data['sauces']? + set 'sauces', data['sauces'].replace( + /https:\/\/www\.deviantart\.com\/gallery\/#\/d%\$1%\$2;regexp:\/\^\\w\+_by_\\w\+\[_-\]d\(\[\\da-z\]\{6\}\)\\b\|\^d\(\[\\da-z\]\{6\}\)-\[\\da-z\]\{8\}-\//g, + 'javascript:void(open("https://www.deviantart.com/"+%$1.replace(/_/g,"-")+"/art/"+parseInt(%$2,36)));regexp:/^\\w+_by_(\\w+)[_-]d([\\da-z]{6})\\b/' + ) changes loadSettings: (data, cb) -> diff --git a/src/config/Config.coffee b/src/config/Config.coffee index 901fec6b1..28b05e61b 100644 --- a/src/config/Config.coffee +++ b/src/config/Config.coffee @@ -772,7 +772,7 @@ Config = sauces: """ # Known filename formats: https://www.pixiv.net/member_illust.php?mode=medium&illust_id=%$1;regexp:/^(\\d+)_p\\d+/ - https://www.deviantart.com/gallery/#/d%$1%$2;regexp:/^\\w+_by_\\w+[_-]d([\\da-z]{6})\\b|^d([\\da-z]{6})-[\\da-z]{8}-/ + javascript:void(open("https://www.deviantart.com/"+%$1.replace(/_/g,"-")+"/art/"+parseInt(%$2,36)));regexp:/^\\w+_by_(\\w+)[_-]d([\\da-z]{6})\\b/ https://imgur.com/%$1;regexp:/^(?![a-zA-Z][a-z]{6})(?![A-Z]{7})(?!\\d{7})([\\da-zA-Z]{7})(?: \\(\\d+\\))?\\.\\w+$/ 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/