Skip to content

Commit b2f34da

Browse files
committed
fix for wallhaven
1 parent deea2aa commit b2f34da

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

Picviewer CE+/Picviewer CE+.user.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
// @description Powerful picture viewing tool online, which can popup/scale/rotate/batch save pictures automatically
77
// @description:zh-CN 在线看图工具,支持图片翻转、旋转、缩放、弹出大图、批量保存
88
// @description:zh-TW 線上看圖工具,支援圖片翻轉、旋轉、縮放、彈出大圖、批量儲存
9-
// @version 2020.4.23.1
9+
// @version 2020.4.25.1
1010
// @created 2011-6-15
1111
// @namespace http://userscripts.org/users/NLF
1212
// @homepage http://hoothin.com
@@ -1187,7 +1187,9 @@
11871187
{name: "Wallhaven",
11881188
url: /wallhaven\./,
11891189
getImage: function() {
1190-
return this.src.replace(/wallpapers\/thumb\/small\/th/i,"wallpapers/full/wallhaven").replace(/th\.wallhaven\.cc\/small\/(.*)?\//i,"w.wallhaven.cc/full/$1/wallhaven-");
1190+
var preStr=this.src.replace(/wallpapers\/thumb\/small\/th(.*)\./i,"wallpapers/full/wallhaven$1").replace(/th\.wallhaven\.cc\/(small|lg)\/(.*)?\/(.*)\..*/i,"w.wallhaven.cc/full/$2/wallhaven-$3");
1191+
if(preStr!=this.src)
1192+
return [preStr+".jpg",preStr+".png"];
11911193
}
11921194
},
11931195
{name: "lofter",

0 commit comments

Comments
 (0)