pvcep_rules

Rules for /scripts/24204-Picviewer-CE-plus

Ekde 2024/05/15. Vidu La ĝisdata versio.

This script should not be not be installed directly. It is a library for other scripts to include with the meta directive // @require https://update.sleazyfork.org/scripts/438080/1376656/pvcep_rules.js

  1. /*
  2. PVCEP - Rules for Picviewer CE+
  3. <https://github.com/hoothin/UserScripts/blob/master/Picviewer%20CE%2B/pvcep_rules.js>
  4.  
  5. (c) 2021-2024 Hoothin <rixixi [at] gmail.com>
  6. Licenced under the MIT license.
  7.  
  8. 最少僅需
  9. {
  10. name: 站點名
  11. r: 圖片地址正則或者待替換字符串,如果是陣列則代表多個替換規則
  12. s: 替換目標字符串
  13. }
  14. 或者
  15. {
  16. name: 站點名
  17. getImage(a, p): 指向圖片時的地址替換函數,a 為第一個父級A元素,p 為所有父級元素的陣列,詳情見下方例子
  18. }
  19. 其他參數項按需添加即可。
  20. 需要注意 css/ext/xhr/lazyAttr(懶加載的原圖 URL 屬性名)/description(收藏圖片時的描述,支持選擇器或 xpath)/clickToOpen 在指定 url 之後方可使用
  21. xhr 為內頁圖片獲取屬性。
  22. 1. 首先使用 xhr.url() 篩選並返回父級 a 標籤的 url,然後腳本會自動抓取該 url 指向的網頁。
  23. 2. 透過 xhr 獲取圖片。
  24. 2.1 其中 xhr.q 為圖片(可以為多張,多張將添加到圖庫)的選擇器或者函數
  25. 2.2 xhr.c 為圖片的文字描述,抓取方式同上
  26. 如果鼠標指向對象非圖片,可使用 getExtSrc 生成想要的圖片地址,詳情見下方 youtube 例子
  27. ext 為滑鼠指向非圖片元素時抓取附近圖片元素的方式,"previous" 代表檢測上一個兄弟節點,"previous-2" 代表檢測前數第二個兄弟節點,"next" 代表檢測下一個兄弟節點
  28. getExtSrc 為根據非圖片元素直接獲取圖片 URL 的方法
  29.  
  30. #####################################################################################
  31.  
  32. minimum
  33. {
  34. name: site name
  35. r: regular image url or string to be replaced
  36. s: replacement target string
  37. }
  38. or
  39. {
  40. name: site name
  41. getImage(a, p): Replace the image URL when pointing to an image, 'a' refers to the first parent A element, and 'p' is an array of all parent elements, see the example below for details
  42. }
  43. Other parameter items can be added as needed.
  44. Note that css/ext/xhr/lazyAttr (lazy loaded original image URL attribute name)/description (description when collecting images, support selector or xpath)/clickToOpen should only be used after specifying the url.
  45. xhr is used to obtain the attributes of the pictures on the inner pages.
  46. 1. First, use xhr.url() to filter and return the url of the parent a tag, and then the script will automatically grab the webpage pointed to by the url.
  47. 2. And get pictures through xhr.
  48. 2.1 xhr.q is the picture (you can For multiple, multiple will be added to the gallery) selector or function
  49. 2.2 xhr.c is the description of picture
  50. If the mouse points to an object other than a picture, you can use getExtSrc to generate the desired picture url, see the youtube example below for details
  51. ext is the method for capturing nearby image elements when the mouse hovers over a non-image element. "previous" indicates detecting the previous sibling node, "previous-2" indicates detecting the second sibling node in reverse order, and "next" indicates detecting the next sibling node.
  52. getExtSrc is the method for directly obtaining the image URL based on a non-image element.
  53. */
  54. var siteInfo = [
  55. {
  56. name: "google 图片搜索",
  57.  
  58. //網址例子 ( 方便測試和查看 )
  59. example: "http://www.google.com.hk/search?q=firefox&tbm=isch",
  60.  
  61. //是否啟用
  62. enabled: true,
  63.  
  64. //站點正則,匹配站點url該條規則才會生效
  65. url: /https?:\/\/www.google(\.\w{1,3}){1,3}\/search\?.*&(tbm=isch|udm=2)/,
  66.  
  67. //鼠標點擊直接打開(僅當高級規則的getImage()或者r/s替換有返回值的時候生效)
  68. clickToOpen: {
  69. enabled: false,
  70. preventDefault: true,//是否嘗試阻止點擊的默認行為(比如如果是你點的是一個鏈接,默認行為是打開這個鏈接,如果是true,js會嘗試阻止鏈接的打開(如果想臨時打開這個鏈接,請使用右鍵的打開命令))
  71. button: 0,//0:鼠標左鍵 1:滾輪按鈕或中間按鈕(如果有) 2:鼠標右鍵。默認為 0
  72. alt: false,//是否需要按下alt鍵
  73. ctrl: false,//是否需要按下ctrl鍵
  74. shift: false,//是否需要按下shift鍵
  75. meta: false,//是否需要按下meta鍵
  76. type: 'actual',//默認的打開方式: 'actual'(彈出,原始圖片) 'magnifier'(放大鏡) 'current'(彈出,當前圖片)
  77. },
  78.  
  79. //獲取圖片實際地址的處理函數,
  80. //this 為當前鼠標懸浮圖片的引用,
  81. //第一個參數為當前圖片的父元素中第一個a元素(可能不存在)
  82. //第二個參數為保存當前圖片所有父元素的數組
  83. getImage: function(a) {
  84. if(!a) return;
  85. let jsaction = a.getAttribute("jsaction");
  86. if (a.href.match(/imgurl=(.*?)&/i)) {
  87. return decodeURIComponent(RegExp.$1);
  88. } else if (jsaction && jsaction.indexOf('touchstart') !== -1) {
  89. const touchList = [new Touch({
  90. identifier: 1,
  91. target: document.documentElement,
  92. clientX: 0,
  93. clientY: 0
  94. })];
  95. var fakeEvent = new TouchEvent('touchstart', {bubbles: true, touches: touchList});
  96. a.dispatchEvent(fakeEvent);
  97. fakeEvent = new TouchEvent('touchend', {bubbles: true});
  98. a.dispatchEvent(fakeEvent);
  99. if (a.href.match(/imgurl=(.*?)&/i)) {
  100. return decodeURIComponent(RegExp.$1);
  101. }
  102. }
  103. }
  104.  
  105. // 自定義樣式
  106. // css: '',
  107.  
  108. // 如果圖片藏在非img標籤後面,使用此項獲取被遮擋的img元素。
  109. // 其中previous代表前面一個元素,previous-2代表前面第二個元素,next代表後面一個元素。
  110. // 或者直接用函數獲取,傳入當前元素,返回查找到的元素或是null。
  111. // ext: 'previous-2',
  112.  
  113. // 排除的圖片正則
  114. // exclude: /weixin_code\.png$/i,
  115.  
  116. // 需要替換的圖片正則,匹配上圖片url該條規則才生效
  117. // src: /avatar/i,
  118.  
  119. // 正則或字符串檢測內容,可以為含有多組規則的數組,若為字符串則只進行字符串替換
  120. // r: /\?.*$/i,
  121.  
  122. // 正則或字符串替換內容,可以與上一條一一對應,也可以以數組對應檢測正則的其中一條,比如希望有多個結果嘗試顯示原圖
  123. // s: ''
  124. },
  125. {
  126. name: "123rf",
  127. url: /123rf\.com/,
  128. r: /us\.123rf\.com\/\d+wm\//i,
  129. s: "previews.123rf.com/images/"
  130. },
  131. {
  132. name: "126",
  133. src: /\.126\.net/i,
  134. r: /\/\d+\.\d+x\d+\.\d+\.([^\.]+)$/i,
  135. s: '/5.5000x5000.100.$1'
  136. },
  137. {
  138. name:"178.com",
  139. enabled:true,
  140. url:/^https?:\/\/(?:\w+\.)+178\.com\//i,
  141. clickToOpen:{
  142. enabled:true,
  143. preventDefault:true,
  144. type:'actual',
  145. },
  146. getImage:function(a){
  147. if(!a)return;
  148. var reg=/^https?:\/\/(?:\w+\.)+178\.com\/.+?(https?:\/\/img\d*.178.com\/[^.]+\.(?:jpg|jpeg|png|gif|bmp))/i;
  149. return (a.href.match(reg) || [])[1];
  150. }
  151. },
  152. {
  153. name: "24meitu",
  154. url: /24meitu\.com|25meinv\.com|aisimeinv\.com|24tupian\.com|24meinv\.|24mntp\.|24cos\.|24fh\.|24shipin\.|24mn\./,
  155. r: [/\/m([^\/]+)$/i,
  156. /imgs\./i],
  157. s: ["/$1","bimg."]
  158. },
  159. {
  160. name: "bing 图片搜索",
  161. example:"http://cn.bing.com/images/search?q=%E7%BE%8E%E5%A5%B3",
  162. enabled:true,
  163. url: /^https?:\/\/[^.]*\.bing\.com\/images\//i,
  164. getImage:function(a){
  165. if (!a) return;
  166. var oldsrc=this.src;
  167. var $ = /,imgurl:"([^"]+)/.exec(a.getAttribute('m'));
  168. var newsrc= $ ? $[1] : '';
  169. if(newsrc!=oldsrc)return newsrc;
  170. }
  171. },
  172. {
  173. name:"百度贴吧",
  174. enabled:true,
  175. url:/^https?:\/\/tieba\.baidu\.[^\/]+\//i,
  176. r: [/\/sys\/portrait/i,
  177. /^(http:\/\/tiebapic\.baidu\.com\/forum\/)ab(pic\/item\/[\w.]+)/i],
  178. s: ["/sys/portraitl", "$1$2"],
  179. getImage: function(a, p) {
  180. let bsrc = this.getAttribute('bpic');
  181. return bsrc || null;
  182. },
  183. xhr: {
  184. url: function(a, p) {
  185. let pid = this.src.match(/\.baidu\.com\/forum\/w.*\/(\w+)\./);
  186. if (!pid) return null;
  187. pid = pid[1];
  188. let tid = 0;
  189. let tidm = location.href.match(/\/p\/(\d+)/);
  190. if (tidm) tid = tidm[1];
  191. if (tid) {
  192. let kw = document.querySelector(`#wd2`);
  193. if (kw && kw.value) {
  194. return `https://tieba.baidu.com/photo/bw/picture/guide?kw=${kw.value}&tid=${tid}&pic_id=${pid}&see_lz=0&from_page=0&alt=jview`;
  195. }
  196. }
  197. return null;
  198. },
  199. query: function(html, doc, url) {
  200. let data = JSON.parse(html);
  201. if (!data) return null;
  202. let pid = url.match(/&pic_id=(\w+)/)[1];
  203. for (let key in data.data.pic_list) {
  204. let pic = data.data.pic_list[key];
  205. if (pic.img.screen.id == pid) return pic.img.screen.waterurl;
  206. }
  207. return null;
  208. }
  209. }
  210. },
  211. {
  212. name: "百度图片搜索",
  213. example: "http://image.baidu.com/i?ie=utf-8&word=%E9%A3%8E%E6%99%AF&oq=%E9%A3%8E%E6%99",
  214. enabled: true,
  215. url: /^https?:\/\/image\.baidu\.com\/.*&word=/i,
  216. getImage: function(a) {
  217. if (!a) return;
  218. var reg = /&objurl=(http.*?\.(?:jpg|jpeg|png|gif|bmp))/i;
  219. if (a.href.match(reg)) {
  220. return decodeURIComponent(RegExp.$1);
  221. }
  222. }
  223. },
  224. {
  225. name:"豆瓣",
  226. example:"http://movie.douban.com/photos/photo/1000656155/",
  227. enabled: true,
  228. url:/^https?:\/\/[^.]*\.douban\.com/i,
  229. getImage:function(){
  230. var oldsrc = this.src,
  231. newsrc = oldsrc;
  232. var pic = /\/view\/photo\/(?:photo|albumcover|albumicon|thumb|sqxs)\/public\//i;
  233. var movieCover = /\/view\/movie_poster_cover\/[si]pst\/public\//i;
  234. var bookCover = /\/view\/ark_article_cover\/cut\/public\//i;
  235. var spic = /(img\d+.douban.com)\/[sm]pic\//i;
  236. var ratio = /s_ratio_poster/i;
  237. if(/\/subject\/\d+\/discussion/.test(location.href)){
  238. } else if (pic.test(oldsrc)) {
  239. newsrc = oldsrc.replace(pic, '/view/photo/raw/public/');
  240. } else if (movieCover.test(oldsrc)) {
  241. newsrc = oldsrc.replace(movieCover, '/view/photo/raw/public/');
  242. } else if (bookCover.test(oldsrc)) {
  243. newsrc = oldsrc.replace(bookCover, '/view/ark_article_cover/retina/public/');
  244. } else if (spic.test(oldsrc)) {
  245. newsrc = oldsrc.replace(spic, '$1/lpic/');
  246. } else if (ratio.test(oldsrc)) {
  247. newsrc = oldsrc.replace(ratio, 'l');
  248. }
  249. return newsrc == oldsrc ? null : [newsrc,newsrc.replace(/photo\/raw/,"photo/photo")];
  250. }
  251. },
  252. {
  253. name:"bilibili",
  254. enabled:true,
  255. url:/^https?:\/\/[^.]+\.bilibili.com/i,
  256. ext: function(target) {
  257. if(target && target.parentNode){
  258. return target.parentNode.querySelector("img");
  259. }
  260. },
  261. r: /\d+_\d+\/|\d+_x\d+\.jpg$|@\d+w_\d+h.*\.webp$|_\d+x\d+\.jpg$/i,
  262. s: ""
  263. },
  264. /*{
  265. name: "deviantart",
  266. example: "http://www.deviantart.com",
  267. enabled:true,
  268. url:/^https?:\/\/[^.]*\.deviantart\.com/i,
  269. getImage:function(a, p){
  270. let id,self=this;
  271. if(p[1] && p[1].dataset.hook=="deviation_link"){
  272. id=p[1].href.replace(/.*?(\d+)$/,"$1");
  273. }else if(p[2] && p[2].dataset.hook=="deviation_link"){
  274. id=p[2].href.replace(/.*?(\d+)$/,"$1");
  275. }
  276. if(/\?token/.test(this.src)){
  277. if(!this.dataset.pvsrc && id){
  278. this.dataset.pvsrc="t";
  279. GM_xmlhttpRequest({
  280. method: 'get',
  281. responseType: "json",
  282. url: '/_napi/shared_api/deviation/extended_fetch?deviationid='+id+'&type=art&include_session=false',
  283. onload: function(d) {
  284. var media = (d.response && d.response.deviation)?d.response.deviation.media:null;
  285. var fullview = media && media.types && media.types.find(t=>{return t.t=='fullview'});
  286. if(media && media.baseUri && fullview && media.token){
  287. var resultUrl=media.baseUri+(fullview.c?fullview.c.replace("<prettyName>",media.prettyName).replace(/,q_\d+/,",q_100"):"")+"?token="+media.token[0];
  288. self.dataset.pvsrc=resultUrl;
  289. if(floatBar){
  290. floatBar.update(self, self.dataset.pvsrc);
  291. }
  292. }
  293. }
  294. });
  295. }else if(this.dataset.pvsrc!="t" && id){
  296. return this.dataset.pvsrc;
  297. }
  298. }
  299. return null;
  300. },
  301. },
  302. {
  303. name:"deviantart",
  304. url:/^https?:\/\/[^.]*\.deviantart\.com/i,
  305. xhr: {
  306. url: 'a[data-hook = "deviation_link"]',
  307. query: '[property="contentUrl"]'
  308. }
  309. },*/
  310. {
  311. name:"deviantart",
  312. url:/^https?:\/\/[^.]*\.deviantart\.com/i,
  313. getImage: function(a, p) {
  314. if (!a) return;
  315. let media =Object.keys(a).filter(prop => prop.indexOf("__reactProps") === 0);
  316. if (!media || !a[media] || !a[media].children || !a[media].children.props || !a[media].children.props.deviation) return;
  317. media = a[media].children.props.deviation.media;
  318. let fullview = media.types.filter(d => d.t === "fullview");
  319. let ext = media.baseUri.match(/\.\w+$/);
  320. if (!fullview || !ext) return;
  321. fullview = fullview[0];
  322. ext = ext[0];
  323. return media.baseUri + `/v1/fill/w_${fullview.w},h_${fullview.h}/${media.prettyName}-fullview${ext}?token=` + media.token[0];
  324. }
  325. },
  326. {
  327. name: '花瓣网',
  328. enabled: true,
  329. url: /^https?:\/\/huaban\.com\//i,
  330. ext: 'previous-2',
  331. r: /(.*img.hb.aicdn.com\/.*)_fw(?:236|320)$/i,
  332. s: '$1_fw658',
  333. description: './../following-sibling::p[@class="description"]',
  334. // css: '.pin a.img .cover { display: none; }',
  335. exclude: /weixin_code\.png$/i,
  336. },
  337. {
  338. name: "wikipedia",
  339. enabled:true,
  340. url:/^https?:\/\/.+\.wikipedia\.org\//i,
  341. r: /(https?:\/\/.*)\/thumb(\/.*)\/\d+px-.*/i,
  342. s: "$1$2"
  343. },
  344. {
  345. name:"沪江碎碎",
  346. enabled:true,
  347. url:/^https?:\/\/([^.]+\.)*(?:yeshj\.com|hjenglish\.com|hujiang\.com)/i,
  348. r: /^(https?:\/\/(?:[^.]+\.)*hjfile.cn\/.+)(_(?:s|m))(\.\w+)$/i,
  349. s: '$1$3'
  350. },
  351. {
  352. name: '大众点评',
  353. example: 'http://www.dianping.com/shop/17873296/photos',
  354. url: /^https?:\/\/www.dianping.com\/shop/i,
  355. r: /(.+?dpfile\.com\/.+)\(240c180\)\/(thumb\..+)/i,
  356. s: '$1(700x700)/$2'
  357. },
  358. {
  359. name: 'trakt.tv',
  360. url: /^http:\/\/trakt\.tv\//i,
  361. example: 'http://trakt.tv/shows',
  362. r: /(.*\/images\/posters\/\d+)-(?:300|138)\.jpg\?(\d+)$/i,
  363. s: "$1.jpg?$2"
  364. },
  365. {
  366. name: '网易云音乐',
  367. url: 'http://music.163.com/*',
  368. ext: 'previous',
  369. getImage: function() {
  370. var oldsrc = this.src;
  371. if(this.data){
  372. var newsrc = this.data('src');
  373. if (oldsrc != newsrc) {
  374. return newsrc;
  375. }
  376. }
  377. if (oldsrc.match(/(.*)\?param=\d+y\d+$/)) {
  378. return RegExp.$1;
  379. }
  380. }
  381. },
  382. {
  383. name: "美女薄情馆",
  384. url: /^http:\/\/boqingguan\.com\//i,
  385. example: 'http://boqingguan.com/Picture/31637',
  386. lazyAttr: 'data-original',
  387. getImage: function(a) {
  388. var oldsrc = this.getAttribute('data-original') || this.src;
  389. if (oldsrc) {
  390. var newsrc = oldsrc.replace(/![a-z\d]+$/, '');
  391. return newsrc == oldsrc ? '' : newsrc;
  392. }
  393. }
  394. },
  395. {
  396. name:"极限主题社区",
  397. enabled:true,
  398. url:/^https?:\/\/bbs\.themex\.net\/.+/i,
  399. clickToOpen:{
  400. enabled:true,
  401. preventDefault:true,
  402. type:'actual',
  403. },
  404. r: /^(https?:\/\/bbs\.themex\.net\/attachment\.php\?.+)&thumb=1(.+)/i,
  405. s: '$1$2'
  406. },
  407. {
  408. name:"opera官方论坛",
  409. example:"http://bbs.operachina.com",
  410. enabled:true,
  411. url:/^http:\/\/bbs\.operachina\.com/i,
  412. src: /file.php\?id=\d+$/i,
  413. r: /.*/,
  414. s: "$1&mode=view"
  415. },
  416. {
  417. name: 'github 修正',
  418. url: /^https?:\/\/github\.com\//i,
  419. clickToOpen: {
  420. enabled: false,
  421. preventDefault: true,
  422. type: 'actual',
  423. },
  424. getImage: function(a) {
  425. if (a && a.href.indexOf('/blob/master/') > 0) {
  426. return this.src;
  427. }
  428. }
  429. },
  430. {
  431. name: '优美图',
  432. url: /http:\/\/(?:www\.)?topit\.me\//,
  433. lazyAttr: 'data-original',
  434. xhr: {
  435. url: /topit\.me\/item\/\d+/,
  436. query: ['a[download]', 'a#item-tip'],
  437. }
  438. },
  439. {
  440. name: '半次元',
  441. url: /^https?:\/\/bcy\.net\//,
  442. r: [/\/\dX\d$|\/w\d+$/i,
  443. "/cover/",
  444. /\/(middle|small)\.jpg/i],
  445. s: ["", "/post/", "/big.jpg"]
  446. },
  447. {
  448. name: 'Steampowered',
  449. url: /\.steampowered\.com/,
  450. r: /\.\d+x\d+\.jpg/i,
  451. s: ".jpg"
  452. },
  453. {
  454. name: 'Steamcommunity',
  455. url: /steamcommunity\.com/,
  456. r: /output\-quality=\d+&fit=inside\|\d+\:\d+/i,
  457. s: "output-quality=100&fit=inside|0:0"
  458. },
  459. {
  460. name: '知乎',
  461. url: /(zhihu|zhimg)\.com/,
  462. r: /_(b|xs|s|l|\d+x\d+)\./i,
  463. s: "."
  464. },
  465. {
  466. name: '500px',
  467. url: /500px\./,
  468. r: [/\/w%3D\d+_h%3D\d+\/v2.*/i,
  469. /^((?:(?:pp?cdn|s\\d\\.amazonaws\\.com\/photos|gp\\d+\\.wac\\.edgecastcdn\\.net\/806614\/photos\/photos)\\.500px|djlhggipcyllo\\.cloudfront)\\.(?:net|org)\/\\d+\/[\\da-f]{40}\/)\\d+\\./],
  470. s: ["/m%3D2048_k%3D1_of%3D1/v2",
  471. "$12048.jpg"]
  472. },
  473. {
  474. name: 'Nyaa',
  475. url: /nyaa\.se/,
  476. r: /upload\/small\//i,
  477. s: "upload/big/"
  478. },
  479. {
  480. name: "itunes",
  481. url: /itunes\.apple\.com/,
  482. r: /\d+x\d+bb\./i,
  483. s: "1400x1400bb."
  484. },
  485. {
  486. name: "汽车之家",
  487. url: /\.autohome\.com\.cn/,
  488. r: /(\?imageView.*|\d+x\d+_\d+_|f_m_|t_|s_)/i,
  489. s: ""
  490. },
  491. {
  492. name: "易车",
  493. url: /\.bitauto\.com/,
  494. r: /_\d+\.jpg$/i,
  495. s: "_12.jpg"
  496. },
  497. {
  498. name: "爱卡",
  499. url: /\.xcar\.com\.cn/,
  500. r: /\-\d+x\d+\.jpg/i,
  501. s: ""
  502. },
  503. {
  504. name: "太平洋汽车",
  505. url: /\.pcauto\.com\.cn/,
  506. r: /_\d+x\d+\.jpg$/i,
  507. s: ".jpg"
  508. },
  509. {
  510. name: "新浪汽车",
  511. url: /\.auto\.sina\.com\.cn/,
  512. r: /_\d+\.jpg$/i,
  513. s: "_src.jpg"
  514. },
  515. {
  516. name: "greasyfork",
  517. url: /(greasyfork|sleazyfork)\.org/,
  518. getImage: function() {
  519. if(this.parentNode.nodeName=="A" && /amazonaws\.com/.test(this.parentNode.href)){
  520. return this.parentNode.href;
  521. }
  522. return this.src.replace(/\/thumb\//i,"/original/").replace(/\/thumbnails\//i,"/").replace(/(\/forum\/uploads\/userpics\/.*\/)n([^\/]+)$/,"$1p$2");
  523. }
  524. },
  525. {
  526. name: "dribbble",
  527. url: /dribbble\.com/,
  528. r: [/_teaser(.[^\.]+)$/i,
  529. /_1x\./i,
  530. /\?compress=.*/],
  531. s: ["$1",".",""]
  532. },
  533. {
  534. name: "百度百科",
  535. url: /baike\.baidu\.com/,
  536. r: [/.*bdstatic\.com.*\/([^\/]+)\.jpg/i,
  537. /(.*bkimg\.cdn\.bcebos\.com.*\?x-bce-process=image).*/i],
  538. s: ["http://imgsrc.baidu.com/baike/pic/item/$1.jpg",
  539. "$1"]
  540. },
  541. {
  542. name: "nvshens",
  543. url: /nvshens\.com|onvshen\.com/,
  544. r: /(\img\.onvshen\.com.*)(?:thumb\/|_s)(.*)/i,
  545. s: "$1$2"
  546. },
  547. {
  548. name: "Tumblr",
  549. url: /tumblr\.com/,
  550. exclude: /\/avatar_/i,
  551. r: /[^\/]*(media\.tumblr\.com.*_)\d+(\.[^\.]+)$/i,
  552. s: "$1raw$2"
  553. },
  554. {
  555. name: "Tumblr",
  556. url: /tumblr\.com/,
  557. src: /\/avatar_/i,
  558. r: /(media\.tumblr\.com.*_)[^_]+(\.[^\.]+)$/i,
  559. s: "$1512$2"
  560. },
  561. {
  562. name: "Acgget",
  563. url: /acg18\.us|acgget\./,
  564. r: /(pic\.acgget\.com\/thumb\/)w\d+_h\d+\//i,
  565. s: "$1w9999_h9999/"
  566. },
  567. {
  568. name: "Pixiv",
  569. url: /pixiv\.net|pximg\.net/,
  570. src: /pximg\.net\/c\/\d+x\d+/i,
  571. r: /pximg\.net\/c\/\d+x\d+.*\/img\/(.*)_.*$/i,
  572. s: ["pximg.net/img-original/img/$1.jpg","pximg.net/img-original/img/$1.png"]
  573. },
  574. {
  575. name: "Wallhaven",
  576. url: /wallhaven\./,
  577. src: /wallpapers\/thumb\/small\/th|th\.wallhaven\.cc\/(small|lg)\//i,
  578. r: [/wallpapers\/thumb\/small\/th(.*)\./i,
  579. /th\.wallhaven\.cc\/(small|lg)\/(.*)?\/(.*)\..*/i],
  580. s: [["wallpapers/full/wallhaven$1.jpg","wallpapers/full/wallhaven$1.png"],
  581. ["w.wallhaven.cc/full/$2/wallhaven-$3.jpg","w.wallhaven.cc/full/$2/wallhaven-$3.png"]],
  582. getImage() {
  583. let srcReg1 = /wallpapers\/thumb\/small\/th(.*)\./i;
  584. let srcReg2 = /th\.wallhaven\.cc\/(small|lg)\/(.*)?\/(.*)\..*/i;
  585. let res1 = "wallpapers/full/wallhaven$1.";
  586. let res2 = "w.wallhaven.cc/full/$2/wallhaven-$3.";
  587. let png, ne;
  588. if (this.nextElementSibling && this.nextElementSibling.nextElementSibling) {
  589. ne = this.nextElementSibling.nextElementSibling;
  590. if (ne.className != "thumb-info") ne = null;
  591. else png = !!ne.querySelector('.png');
  592. }
  593. if (srcReg1.test(this.src)) {
  594. return ne ? this.src.replace(srcReg1, res1 + (png ? "png" : "jpg")) : [this.src.replace(srcReg1, res1 + "jpg"), this.src.replace(srcReg1, res1 + "png")];
  595. }
  596. if (srcReg2.test(this.src)) {
  597. return ne ? this.src.replace(srcReg2, res2 + (png ? "png" : "jpg")) : [this.src.replace(srcReg2, res2 + "jpg"), this.src.replace(srcReg2, res2 + "png")];
  598. }
  599. }
  600. },
  601. {
  602. name: "lofter",
  603. url: /lofter\./,
  604. getImage: function(a) {
  605. if(a && a.href && a.hasAttribute("bigimgsrc")){
  606. return a.getAttribute("bigimgsrc");
  607. }
  608. return this.src.replace(/\?.*/i,"");
  609. }
  610. },
  611. {
  612. name: "sohu",
  613. url: /(sohu|sohucs)\.com/,
  614. r: /(sohucs\.com\/).*\/(images\/|os\/)/i,
  615. s: "$1$2"
  616. },
  617. {
  618. name: "moegirl",
  619. url: /(moegirl|mengniang)\.org/,
  620. r: /(common)\/thumb(.*)\/[^\/]+/i,
  621. s: "$1$2"
  622. },
  623. {
  624. name: "fanfou",
  625. url: /fanfou\.com/,
  626. r: /@.+/i,
  627. s: ""
  628. },
  629. {
  630. name: "meitudata",
  631. url: /meipai\.com/,
  632. r: /!thumb.+/i,
  633. s: ""
  634. },
  635. {
  636. name: "mafengwo",
  637. url: /mafengwo\.cn/,
  638. r: /\?imageMogr.*/i,
  639. s: ""
  640. },
  641. {
  642. name: "discordapp",
  643. url: /(discordapp\.|discord\.)(com|net)/,
  644. r: /\?width=\d+&height=\d+$/i,
  645. s: ""
  646. },
  647. {
  648. name: "推特",
  649. url: /twitter\.com|pbs\.twimg\.com/,
  650. getImage: function(a, p){
  651. let newsrc = this.src.replace("_normal.",".").replace("_200x200.",".").replace("_mini.",".");
  652. if (newsrc != this.src)return newsrc;
  653. newsrc=newsrc.replace(/\?format=/i, ".").replace(/\&name=/i, ":").replace(/\.(?=[^.]*$)/, "?format=").replace( /(:large|:medium|:small|:orig|:thumb|:[\dx]+)/i, "");
  654. if (newsrc != this.src) {
  655. if (a && a.role == 'link') {
  656. let match = a.href.match(/\/([^\/]+)\/status\/([^\/]+)\/photo\/(\d+)/);
  657. if (match) {
  658. let time = p[14] && p[14].querySelector('time');
  659. if (time) {
  660. this.alt = match[1] + " - " + time.innerText + "_" + match[3];
  661. }
  662. }
  663. }
  664. return newsrc+"&name=orig";
  665. }
  666. },
  667. ext: function(target) {
  668. if(target.parentNode && target.parentNode.previousElementSibling){
  669. let imgs=target.parentNode.previousElementSibling.querySelectorAll("img");
  670. if(imgs.length==1)return imgs[0];
  671. }
  672. return null;
  673. }
  674. },
  675. {
  676. name: "Fandom",
  677. url: /fandom\.com/,
  678. r: [/scale\-to\-width\-down\/\d+/i,
  679. /smart\/width\/\d+\/height\/\d+/i],
  680. s: ["",""]
  681. },
  682. {
  683. name: "yande",
  684. url: /yande\.re|konachan\.(net|com)/,
  685. getImage: function(a, p) {
  686. if(p[1] && p[1].nextSibling && p[1].nextSibling.classList &&
  687. p[1].nextSibling.classList.contains("largeimg")){
  688. return p[1].nextSibling.href.replace(/\/(preview|jpeg|sample)\/(.*\.)jpg$/, "/image/$2png");
  689. }
  690. return this.src.replace(/\/(preview|jpeg|sample)\/(.*\.)jpg$/, "/image/$2png");
  691. }
  692. },
  693. {
  694. name:"绅士漫画",
  695. url:/^https?:\/\/(www\.)?wnacg\./,
  696. src: /\/\/t(\w\.qy.*data\/)t\//,
  697. r: /\/\/t(\w\.qy.*data\/)t\//,
  698. s: "//img$1",
  699. xhr: {
  700. url: function(a, p) {
  701. if (p && p[1] && p[1].className === 'pic_box tb' && a && a.href) {
  702. return a.href;
  703. }
  704. },
  705. query: '#picarea'
  706. }
  707. },
  708. {
  709. name:"xlysauc",
  710. url:/^https?:\/\/xlysauc\.com\//,
  711. r: /\/x\/(\d+\.jpg)/,
  712. s: "/d/$1",
  713. ext: function(target) {
  714. if (target.parentNode.className === 'imgbg' || target.className === 'pp_hoverContainer'){
  715. let img = target.parentNode.querySelector("img");
  716. if (img) return img;
  717. }
  718. return null;
  719. }
  720. },
  721. {
  722. name: "E621",
  723. url: /e621\.net/,
  724. getImage: function(a, p) {
  725. if(p[2] && p[2].dataset.fileUrl){
  726. return p[2].dataset.fileUrl;
  727. }
  728. return this.src;
  729. }
  730. },
  731. {
  732. name: "Pinterest",
  733. url: /pinterest\.com/,
  734. getImage: function(a, p) {
  735. if(this.srcset){
  736. var srcs=this.srcset.split(","),minSize=0,newSrc;
  737. srcs.forEach(srci=>{
  738. let srcInfo=srci.trim().split(" "),curSize=parseInt(srcInfo[1]);
  739. if(srcInfo[1] && (curSize>minSize || minSize==0)){
  740. minSize=curSize;
  741. newSrc=srcInfo[0];
  742. }
  743. });
  744. if(newSrc)return newSrc;
  745. }
  746. return this.src.replace(/\/\d+x\//i, "/736x/");
  747. }
  748. },
  749. {
  750. name: "Zhisheji",
  751. url: /zhisheji\.com/,
  752. r: /thumbnail\/.*/i,
  753. s: ""
  754. },
  755. {
  756. name: "imgbox",
  757. src: /imgbox\.com/,
  758. r: /thumbs(\d\.imgbox.*)_t\./i,
  759. s: "images$1_o."
  760. },
  761. {
  762. name: "Reddit",
  763. url: /reddit\.com|redd\.it/,
  764. r: /https?:\/\/preview\.redd.it\/([^\?]+)?.*/i,
  765. s: "https://i.redd.it/$1",
  766. xhr: {
  767. url: function(a, p) {
  768. if (a) {
  769. if (a.href.indexOf("//v.redd.it/") != -1) {
  770. return a.href + '/DASHPlaylist.mpd';
  771. }
  772. }
  773. },
  774. query: function(html, doc, url) {
  775. try {
  776. var xmlDoc = (new DOMParser()).parseFromString(html, 'application/xml');
  777. var highestRes = [].slice.call(xmlDoc.querySelectorAll('Representation[frameRate]'))
  778. .sort(function (r1, r2) {
  779. var w1 = parseInt(r1.getAttribute('width')), w2 = parseInt(r2.getAttribute('width'));
  780. return w1 > w2 ? -1 : (w1 < w2 ? 1 : 0);
  781. })
  782. .find(function (repr) { return !!repr.querySelector('BaseURL'); });
  783.  
  784. if (highestRes) {
  785. var baseUrl = highestRes.querySelector('BaseURL').textContent.trim();
  786. return baseUrl.indexOf('//') !== -1 ? baseUrl : url.replace('DASHPlaylist.mpd', baseUrl);
  787. }
  788. } catch (err) {
  789. console.log(err);
  790. }
  791. }
  792. }
  793. },
  794. {
  795. name: "Rule34hentai",
  796. url: /rule34hentai\.net/,
  797. r: "/_thumbs/",
  798. s: "/_images/"
  799. },
  800. {
  801. name: "Rule34",
  802. url: /rule34\.xxx/,
  803. src: /\/(thumbnails|samples)\/(.*)\/(thumbnail|sample)_/i,
  804. r: /\/(thumbnails|samples)\/(.*)\/(thumbnail|sample)_(.*)\..*/i,
  805. s: ["/images/$2/$4.jpeg","/images/$2/$4.png","/images/$2/$4.jpg"]
  806. },
  807. {
  808. name: "Photosight",
  809. url: /photosight\.ru/,
  810. r: /(cdny\.de.*\/)t\//i,
  811. s: "$1x/"
  812. },
  813. {
  814. name: "Xiaohongshu",
  815. url: /xiaohongshu\.com/,
  816. ext: function(target) {
  817. if (target.className == 'change-pic') {
  818. var imgs=target.previousElementSibling.querySelectorAll('li'),i=0;
  819. for(i=0;i<imgs.length;i++){
  820. if(imgs[i].style.display!="none")
  821. return imgs[i].childNodes[0];
  822. }
  823. }
  824. return target;
  825. },
  826. r: [/\/w\/\d+\/(h\/\d+\/)?(q\/\d+\/)?/i, /.*\.xhscdn\.com.*\/(\w+)(!.*|$)/i],
  827. s: ["/w/1080/", "https://sns-img-bd.xhscdn.com/$1"]
  828. },
  829. {
  830. name: "Youtube",
  831. url: /youtube\.com/,
  832. ext: function(target) {
  833. if (target.tagName == "ytd-thumbnail") {
  834. return target.querySelector("img");
  835. }
  836. },
  837. getExtSrc: function() {
  838. let newsrc = "";
  839. if (this.id == "thumbnail-container" && this.children[0].hasAttribute("loaded")) {
  840. let img = this.querySelector('img');
  841. if (!img) return;
  842. newsrc = img.src;
  843. }
  844. return newsrc.replace(/\?.*$/i,"");
  845. },
  846. getImage: function(a, p) {
  847. var newsrc=this.src;
  848. if(p[2] && this.classList.contains('ytd-moving-thumbnail-renderer')){
  849. newsrc = p[2].querySelector("img").src;
  850. }
  851. if(!newsrc || newsrc.indexOf("i.ytimg.com") == -1) return;
  852. return newsrc.replace(/\?.*$/i,"");
  853. }
  854. },
  855. {
  856. name: "588ku",
  857. url: /588ku\.com/,
  858. r: /!\/fw.*/,
  859. s: ""
  860. },
  861. {
  862. name: "ibaotu",
  863. url: /ibaotu\.com/,
  864. ext: 'previous',
  865. r: "!fwc238",
  866. s: "!ww7002"
  867. },
  868. {
  869. name: "58pic",
  870. url: /58pic\.com/,
  871. ext: function(target){
  872. if(target.className=="no-login" && target.style.opacity==""){
  873. target.style.opacity=0.99;
  874. setTimeout(()=>{target.style.display="none";},1000);
  875. }
  876. return null;
  877. },
  878. r: /!.*/i,
  879. s: "!w1024"
  880. },
  881. {
  882. name: "gelbooru",
  883. url: /gelbooru\.com/,
  884. src: /(thumbnails|samples)\/(.*)\/(thumbnail|sample)_/i,
  885. r: /.*\/(thumbnails|samples)\/(.*)\/(thumbnail|sample)_(.*)\..*/i,
  886. s: ["https://img3.gelbooru.com/images/$2/$4.png","https://img3.gelbooru.com/images/$2/$4.jpg"]
  887. },
  888. {
  889. name: "donmai",
  890. url: /donmai\.us/,
  891. src: /(thumbnails|sample)\/(.*)\/(thumbnail|sample)_|\/\d+x\d+\//i,
  892. r: [/\/(thumbnails|sample)\/(.*)\/(thumbnail|sample)_(.*)/i,
  893. /\/\d+x\d+\//i
  894. ],
  895. s: ["/original/$2/$4","/original/"]
  896. },
  897. {
  898. name: "erosberry",
  899. url: /erosberry\.com/,
  900. r: /(\/\d+\/)tn_(\d+\.[^\/]+)$/i,
  901. s: "$1$2"
  902. },
  903. {
  904. name: "javdb",
  905. url: /javdb/,
  906. r: "/thumbs/",
  907. s: "/covers/"
  908. },
  909. {
  910. name: "javbus",
  911. url: /javbus\.|busjav\./,
  912. r: /\/thumbs?(\/\w+)\.jpg$/i,
  913. s: "/cover$1_b.jpg"
  914. },
  915. {
  916. name: "avmoo",
  917. url: /avmoo\./,
  918. r: "ps.jpg",
  919. s: "pl.jpg"
  920. },
  921. {
  922. name: "asiansister",
  923. url: /asiansister\.com/,
  924. r: "_t.",
  925. s: "."
  926. },
  927. {
  928. name: "jianshu",
  929. url: /jianshu\.com/,
  930. r: /(upload-images\.jianshu\.io\/.*)\?.*/i,
  931. s: "$1"
  932. },
  933. {
  934. name: "artstation",
  935. ext: 'next',
  936. url: /artstation\.com/,
  937. r: /\/(\d{14}\/)?smaller_square\//i,
  938. s: "/large/",
  939. xhr: {
  940. url: function(a, p) {
  941. if (a && a.href.match('/artwork/')) return a.href.replace('/artwork/', '/projects/') + '.json';
  942. },
  943. query: function(html) {
  944. let datas = JSON.parse(html);
  945. let urls = [];
  946. datas.assets.forEach(d => {
  947. urls.push(d.image_url)
  948. });
  949. return urls;
  950. }
  951. }
  952. },
  953. {
  954. name: "flickr",
  955. url: /flickr\.com/,
  956. ext: function(target){
  957. if(target.nodeName=="A" && target.className=="overlay" && target.parentNode && target.parentNode.parentNode && target.parentNode.parentNode.parentNode){
  958. return target.parentNode.parentNode.parentNode;
  959. }else if(target.nodeName=="DIV" && target.classList.contains("photo-notes-scrappy-view")){
  960. return target.previousElementSibling.querySelector(".main-photo");
  961. }else if(target.classList.contains("context-thumb")){
  962. return target;
  963. }
  964. return null;
  965. },
  966. r: /_\w\./i,
  967. s: "_c."
  968. },
  969. {
  970. name: "wikiart",
  971. url: /wikiart\.org/,
  972. r: /!.*/i,
  973. s: ''
  974. },
  975. {
  976. name: "discuz",
  977. r: [/(.+\/attachments?\/.+)\.thumb\.\w{2,5}$/i,
  978. /((wp-content|moecdn\.org)\/uploads\/.*)\-\d+x\d+(-c)?/i,
  979. /.*(?:url|src)=(https?:\/\/.*\.(?:jpg|jpeg|png|gif|bmp)).*/i,
  980. /.*thumb\.php\?src=([^&]*).*/i],
  981. s: '$1'
  982. },
  983. {
  984. name: "weibo",
  985. r: /(\.sinaimg\.(cn|com)\/)(?:bmiddle|orj360|mw\d+)/i,
  986. s: '$1large'
  987. },
  988. {
  989. name: "weibo2",
  990. r: /(\.sinaimg\.(cn|com)\/)(?:square|thumbnail)/i,
  991. s: '$1mw1024'
  992. },
  993. {
  994. name: "sina head",
  995. r: /(\.sinaimg\.(cn|com)\/\d+)\/50\//i,
  996. s: '$1/180/'
  997. },
  998. {
  999. name: "新浪相册",
  1000. src: /\.sinaimg\.(cn|com)\/thumb\d+\/\w+/i,
  1001. r: /thumb\d+/,
  1002. s: 'mw690'
  1003. },
  1004. {
  1005. name: "sina sports",
  1006. src: /k\.sinaimg\.cn\/n\//i,
  1007. r: /k\.sinaimg\.cn\/n\/(.*)\/(w\d+)?h\d+[^\/]+$/,
  1008. s: 'n.sinaimg.cn/$1'
  1009. },
  1010. {
  1011. name: "gravatar",
  1012. src: /gravatar\.com\/avatar\/|\/gravatar\//i,
  1013. r: /(avatar\/.*[\?&]s=).*/,
  1014. s: '$11920'
  1015. },
  1016. {
  1017. name: "ucServerAvatar",
  1018. src: /uc_server\/avatar\.php/i,
  1019. r: /(uc_server\/avatar\.php\?uid=\d+&size=).*/,
  1020. s: '$1big'
  1021. },
  1022. {
  1023. name: "md",
  1024. src: /\.md\./i,
  1025. r: /\.md(\.[^\.]+)$/i,
  1026. s: '$1'
  1027. },
  1028. {
  1029. name: "ytimg",
  1030. src: /i\.ytimg\.com/i,
  1031. exclude: /mqdefault_6s/i,
  1032. r: /\?.*$/i,
  1033. s: ''
  1034. },
  1035. {
  1036. name: "meituan",
  1037. url: /\.meituan\.net/i,
  1038. r: /\/avatar\/\w{2}/i,
  1039. s: '/avatar/o0'
  1040. },
  1041. {
  1042. name: "hdslb",
  1043. src: /hdslb\.com\//i,
  1044. r: /@.*/i,
  1045. s: ''
  1046. },
  1047. {
  1048. name: "coolapk",
  1049. url: /\.coolapk\.com\//i,
  1050. r: /\.s\.\w+$/i,
  1051. s: ''
  1052. },
  1053. {
  1054. name: "aicdn",
  1055. src: /\.aicdn\.com\//i,
  1056. r: /_fw\d+$/i,
  1057. s: ''
  1058. },
  1059. {
  1060. name: "duitang",
  1061. url: /duitang\.com\//i,
  1062. r: /.thumb.(\d+_)?\d*(_c)?\./i,
  1063. s: '.'
  1064. },
  1065. {
  1066. name: "imgur",
  1067. src: /imgur\.com\//i,
  1068. r: [/h(\.[^\/]+)$/i,/maxwidth=\d+/i],
  1069. s: ["$1","maxwidth=99999"]
  1070. },
  1071. {
  1072. name: "dmm",
  1073. src: /pics\.dmm\.co\.jp/i,
  1074. r: "ps.jpg",
  1075. s: "pl.jpg"
  1076. },
  1077. {
  1078. name: "whd",
  1079. src: /\/w\/\d+\/h\/\d+($|\/|\?)/i,
  1080. r: /\/w\/\d+\/h\/\d+/i,
  1081. s: ""
  1082. },
  1083. {
  1084. name: "百度图片、贴吧等",
  1085. src: /(hiphotos|imgsrc)\.baidu\.com/i,
  1086. r: /(hiphotos|imgsrc)\.baidu\.com\/(.+?)\/.+?([0-9a-f]{40})/i,
  1087. s: "$1.baidu.com/$2/pic/item/$3"
  1088. },
  1089. {
  1090. name: "GoogleContent",
  1091. src: /\/w\/\d+\/h\/\d+($|\/|\?)/i,
  1092. getImage:function(){
  1093. var $ = /^((?:(?:lh|gp|yt)\d+\.g(?:oogleuserconten|gph)|\d\.bp\.blogspo)t\.com\/)(?:([_-](?:[\w\-]{11}\/){4})[^\/]+(\/[^?#]+)?|([^=]+)).*/i.exec(this.src);
  1094. var newsrc= $ ? ('http://' + $[1] + ($[4] ? $[4] + '=' : $[2]) + 's2634' + ($[3] || '')) : '';
  1095. if(newsrc!=this.src)return newsrc;
  1096. }
  1097. },
  1098. {
  1099. name: "pixiv",
  1100. src: /pixiv\.net/i,
  1101. r: /(pixiv.net\/img\d+\/img\/.+\/\d+)_[ms]\.(\w{2,5})$/i,
  1102. s: "$1.$2"
  1103. },
  1104. {
  1105. name: "douban",
  1106. url: /douban\.com/i,
  1107. getImage:function(){
  1108. var $ = /(img\d+\.douban\.com\/)(?:(view\/)(?:photo|movie_poster_cover)\/(?!large)[^\/]+|(icon\/u(?=\d))|[sm](?=pic\/))(.*)/i.exec(this.src);
  1109. var newsrc= $ ? ('http://' + $[1] + ($[2] ? $[2] + 'photo/photo' : (($[3]||'') + 'l')) + $[4]) : '';
  1110. if(newsrc!=this.src)return newsrc;
  1111. }
  1112. },
  1113. {
  1114. name: "taobaocdn",
  1115. src: /(taobaocdn|alicdn)\.com/i,
  1116. r: [/.*((?:img\d\d\.taobaocdn|img(?:[^.]*\.?){1,2}?\.alicdn)\.com\/)(?:img\/|tps\/http:\/\/img\d\d+\.taobaocdn\.com\/)?((?:imgextra|bao\/uploaded)\/.+\.(?:jpe?g|png|gif|bmp))_.+\.jpg$/i,
  1117. /(.*\.alicdn\.com\/.*?)((.jpg|.png)(\.|_)\d+x\d+.*)\.jpg(_\.webp)?$/i,
  1118. /(.*\.alicdn\.com\/.*?)((\.|_)\d+x\d+.*|\.search|\.summ)\.jpg(_\.webp)?$/i],
  1119. s: ["http://$1$2",
  1120. "$1$3",
  1121. "$1.jpg"]
  1122. },
  1123. {
  1124. name: "taobao",
  1125. url: /item\.taobao\.com/i,
  1126. r: [/.*((?:img\d\d\.taobaocdn|img(?:[^.]*\.?){1,2}?\.alicdn)\.com\/)(?:img\/|tps\/http:\/\/img\d\d+\.taobaocdn\.com\/)?((?:imgextra|bao\/uploaded)\/.+\.(?:jpe?g|png|gif|bmp))_.+\.jpg$/i,
  1127. /(.*\.alicdn\.com\/.*?)((.jpg|.png)(\.|_)\d+x\d+.*)\.jpg(_\.webp)?$/i,
  1128. /(.*\.alicdn\.com\/.*?)((\.|_)\d+x\d+.*|\.search|\.summ)\.jpg(_\.webp)?$/i],
  1129. s: ["http://$1$2",
  1130. "$1$3",
  1131. "$1.jpg"],
  1132. getExtSrc:function(){
  1133. if(this.tagName=='A' && this.style.background){
  1134. return this.style.background.replace(/.*url\(['"](https?:)?(.*)['"]\).*/,"https:$2").replace(/_\d+x\d+\.\w+$/,"")
  1135. }
  1136. }
  1137. },
  1138. {
  1139. name: "yihaodianimg",
  1140. url: /yhd\.com/i,
  1141. src: /yihaodianimg\.com/i,
  1142. r: /(.*\.yihaodianimg\.com\/.*)_\d+x\d+\.jpg$/i,
  1143. s: "$1.jpg"
  1144. },
  1145. {
  1146. name: "jd",
  1147. url: /jd\.com/i,
  1148. src: /360buyimg\.com/i,
  1149. r: [/(.*360buyimg\.com\/)n\d\/.+?\_(.*)/i,
  1150. /(.*360buyimg\.com\/)n\d\/(.*)/i,
  1151. /(.*360buyimg\.com\/.*)s\d+x\d+_(.*)/i],
  1152. s: ["$1imgzone/$2","$1n0/$2","$1$2"]
  1153. },
  1154. {
  1155. name: "dangdang",
  1156. url: /dangdang\.com/i,
  1157. src: /ddimg\.cn/i,
  1158. r: /(.*ddimg.cn\/.*?)_[bw]_(\d+\.jpg$)/i,
  1159. s: "$1_e_$2"
  1160. },
  1161. {
  1162. name: "duokan",
  1163. url: /duokan\.com/i,
  1164. r: /(cover.read.duokan.com.*?\.jpg)!\w+$/i,
  1165. s: "$1"
  1166. },
  1167. {
  1168. name: "yyets",
  1169. url: /yyets\.com/i,
  1170. r: /^(res\.yyets\.com.*?\/ftp\/(?:attachment\/)?\d+\/\d+)\/[ms]_(.*)/i,
  1171. s: "http://$1/$2"
  1172. },
  1173. {
  1174. name: "mozilla",
  1175. url: /addons\.mozilla\.org/i,
  1176. r: "addons.cdn.mozilla.net/user-media/previews/thumbs/",
  1177. s: "/thumbs/full/"
  1178. },
  1179. {
  1180. name: "firefox",
  1181. url: /firefox\.net\.cn/i,
  1182. r: "www.firefox.net.cn/attachment/thumb/",
  1183. s: "www.firefox.net.cn/attachment/"
  1184. },
  1185. {
  1186. name: "crsky",
  1187. url: /\.crsky\.com/i,
  1188. r: /pic\.crsky\.com.*_s\.gif$/i,
  1189. s: "/_s././",
  1190. example: "http://www.crsky.com/soft/5357.html"
  1191. },
  1192. {
  1193. name: "zol",
  1194. url: /\.zol\.com/i,
  1195. r: /(\w+\.zol-img\.com\.cn\/product\/\d+)_\d+x\d+\/(.*\.jpg)/i,
  1196. s: "$1/$2",
  1197. example: "http://detail.zol.com.cn/240/239857/pic.shtml"
  1198. },
  1199. {
  1200. name: "yesky",
  1201. url: /\.yesky\.com/i,
  1202. r: /_\d+x\d+\.([a-z]+)$/i,
  1203. s: ".$1",
  1204. example: "http://game.yesky.com/tupian/165/37968665.shtml"
  1205. },
  1206. {
  1207. name:"巴哈姆特",
  1208. url:/^https:\/\/\w+\.gamer\.com\.tw/,
  1209. src: /bahamut\.com\.tw/,
  1210. r: "/S/",
  1211. s: "/B/"
  1212. },
  1213. {
  1214. name: "sgamer",
  1215. url: /\.sgamer\.com/i,
  1216. r: /\/s([^\.\/]+\.[a-z]+$)/i,
  1217. s: "/$1",
  1218. example: "http://dota2.sgamer.com/albums/201407/8263_330866.html"
  1219. },
  1220. {
  1221. name: "nhentai",
  1222. url: /nhentai\.net/i,
  1223. r: /\/\/\w+(\..*\/)(\d+)t(\.[a-z]+)$/i,
  1224. s: "//i$1$2$3",
  1225. example: "http://nhentai.net/g/113475/"
  1226. },
  1227. {
  1228. name: "GithubAvatars",
  1229. url: /github\.com/i,
  1230. r: /(avatars\d*\.githubusercontent\.com.*)\?.*$/i,
  1231. s: "$1",
  1232. example: "https://avatars2.githubusercontent.com/u/3233275/"
  1233. },
  1234. {
  1235. name: "ggpht",
  1236. src: /ggpht\.com/i,
  1237. r: /=s\d+.*/i,
  1238. s: "=s9999"
  1239. },
  1240. {
  1241. name: "kodansha",
  1242. url: /kodansha\.co\.jp/i,
  1243. src: /kodansha\.co\.jp/i,
  1244. r: 't_og_image_center',
  1245. s: 'c_limit'
  1246. },
  1247. {
  1248. name: "fanseven",
  1249. url: /fanseven\.com/i,
  1250. src: /fanseven\.com/i,
  1251. r: /w=\d+&h=\d+/i,
  1252. s: 'w=9999&h=9999'
  1253. },
  1254. {
  1255. name: "appstore",
  1256. url: /^https:\/\/apps\.apple\.com\//i,
  1257. getImage:function(){
  1258. if(this.parentNode.nodeName=="PICTURE"){
  1259. let source=this.parentNode.querySelector("source:last-of-type");
  1260. let maxSize=0;
  1261. let result="";
  1262. source.srcset.split(", ").forEach(srcset=>{
  1263. let srcArr=srcset.split(" ");
  1264. let curSize=parseInt(srcArr[1]);
  1265. if(curSize>maxSize){
  1266. maxSize=curSize;
  1267. result=srcArr[0];
  1268. }
  1269. });
  1270. return result;
  1271. }
  1272. return null;
  1273. }
  1274. },
  1275. {
  1276. name:"coomer.party & kemono.party",
  1277. url:/^https:\/\/(coomer|kemono)\.party\/.*\/post\//,
  1278. getImage:function(a){
  1279. if(a) return a.href;
  1280. }
  1281. },
  1282. {
  1283. name:"instagram",
  1284. url:/^https?:\/\/[^.]+\.instagram\.com/i,
  1285. ext: function(target) {
  1286. if(target && target.previousElementSibling){
  1287. let imgs=target.previousElementSibling.querySelectorAll("img");
  1288. if(imgs && imgs.length==1)return imgs[0];
  1289. }else if(target.tagName=='UL' && target.parentNode && target.parentNode.parentNode && target.parentNode.parentNode.tagName=='A'){
  1290. return target.parentNode.parentNode.querySelector('img');
  1291. }
  1292. },
  1293. xhr: {
  1294. url: function(a, p) {
  1295. if (!a) return;
  1296. const re = /\/(p|reel)\/([^/]{1,})/
  1297. const m = a.href.match(re);
  1298. if (m && a.querySelector('svg')) {
  1299. const shortcode = m[2];
  1300. const lower = 'abcdefghijklmnopqrstuvwxyz';
  1301. const upper = lower.toUpperCase();
  1302. const numbers = '0123456789';
  1303. const ig_alphabet = upper + lower + numbers + '-_';
  1304. const o = shortcode.replace(/\S/g, m => (ig_alphabet.indexOf(m) >>> 0).toString(2).padStart(6, '0'));
  1305. let mediaId = BigInt('0b' + o).toString(10);
  1306. return `https://www.instagram.com/api/v1/media/${mediaId}/info/`;
  1307. }
  1308. },
  1309. headers: {"X-IG-App-ID":"936619743392459"},
  1310. cacheNum: 20,
  1311. query: function(html) {
  1312. try {
  1313. const o = JSON.parse(html);
  1314. const items0 = o.items[0];
  1315. const images = items0.image_versions2;
  1316. const carousel = items0.carousel_media;
  1317. if (carousel) {
  1318. let gallery = [];
  1319. const caption = (items0.caption ? items0.caption.text : (items0.accessibility_caption ? items0.accessibility_caption : items0.user.full_name));
  1320. carousel.map(c => { gallery.push(c.video_versions ? c.video_versions[0].url : c.image_versions2.candidates[0].url); });
  1321. return {url: gallery, cap: caption};
  1322. } else if (images) {
  1323. const imagesUrl = images.candidates[0].url;
  1324. return imagesUrl;
  1325. }
  1326. } catch { }
  1327. }
  1328. }
  1329. },
  1330. {
  1331. name: "hentai-cosplays",
  1332. url: /^https:\/\/(.*\.)?(hentai\-cosplays|porn\-images\-xxx)\.com/,
  1333. r: /\/p=[\dx]+(\/\d+\.\w+)$/i,
  1334. s: '$1'
  1335. },
  1336. {
  1337. name:"beta.kemono.party",
  1338. url:/^https:\/\/(\w+\.)?kemono\.party\/.*\/post\//,
  1339. getImage:function(a){
  1340. if(a) return a.href;
  1341. }
  1342. },
  1343. {
  1344. name:"imdb",
  1345. url:/^https?:\/\/www\.imdb\.com/,
  1346. src: /media\-amazon/,
  1347. r: /@.*(\.\w)/i,
  1348. s: '@$1'
  1349. },
  1350. {
  1351. name:"nsfw.xxx",
  1352. url:/^https?:\/\/nsfw\.xxx/,
  1353. src: /thumbnails/,
  1354. xhr: {
  1355. url: function(a,p) {
  1356. if (a && a.className==='slider_init_href' && a.href && !this.nextElementSibling) {
  1357. return a.href;
  1358. }
  1359. },
  1360. query: '.sh-section__image>img',
  1361. }
  1362. },
  1363. {
  1364. name: "雪球",
  1365. url: /^https?:\/\/xueqiu\.com\//,
  1366. src: /^https?:\/\/xqimg\.imedao\.com\//i,
  1367. r: /!\d+(x\d+[a-z]?)?\.\w+$/,
  1368. s: ''
  1369. },
  1370. {
  1371. name: "小众论坛",
  1372. url: /^https?:\/\/meta\.appinn\.net/,
  1373. src: /meta\-cdn/,
  1374. r: /\/optimized\/(.*)_\d+_\d+x\d+(\.\w+)$/,
  1375. s: "/original/$1$2"
  1376. },
  1377. {
  1378. name: "诱惑福利图",
  1379. url: /www\.yhflt\.com/,
  1380. src: /imgs\.yhflt\.com/,
  1381. r: /imgs(\..*\/)q/,
  1382. s: "pic$1"
  1383. },
  1384. {
  1385. name: "Sankaku Complex",
  1386. url:/sankakucomplex\.com/,
  1387. src:/\/data\/preview\//,
  1388. xhr:{
  1389. url: "a",
  1390. query: "img#image"
  1391. }
  1392. },
  1393. {
  1394. name:"极简壁纸",
  1395. url:/https:\/\/bz\.zzzmh\.cn\//i,
  1396. getImage: function(a,p){
  1397. if(p&&p[1]&&p[1].classList.contains("img-box")){
  1398. let saveEle=p[1].querySelector("a");
  1399. if(saveEle) return saveEle.href;
  1400. }
  1401. }
  1402. },
  1403. {
  1404. name: "blogger",
  1405. src: /blogger\.googleusercontent\.com\/img/,
  1406. r: /\/[sw]\d+\/.*/,
  1407. s: "/s0"
  1408. },
  1409. {
  1410. name: "煎蛋",
  1411. url: /^https:\/\/jandan\.net\//,
  1412. r: [/\/(thumb\d+|mw\d+)\//, /!square/],
  1413. s: ["/large/", ""]
  1414. },
  1415. {
  1416. name:"辉夜白兔",
  1417. url:/47\.101\.137\.235/,
  1418. r:"thumb",
  1419. s:"regular"
  1420. },
  1421. {
  1422. name: "Civitai",
  1423. url: /^https:\/\/civitai\.com\//,
  1424. r: /\/width=\d+\//,
  1425. s: "/"
  1426. },
  1427. {
  1428. name: "網易雲音樂",
  1429. url: /^https:\/\/music\.163\.com\//,
  1430. getExtSrc:function() {
  1431. if (this.tagName === 'A' && this.className === "msk") {
  1432. return this.previousElementSibling.src.replace(/\?param=\d+y\d+/, "");
  1433. }
  1434. },
  1435. r: /\?param=\d+y\d+/,
  1436. s: ""
  1437. },
  1438. {
  1439. name: "Dlsite",
  1440. src: /^https:\/\/img\.dlsite\.jp\//,
  1441. r: /\/resize\/(.*)_\d+x\d+/,
  1442. s: "/modpub/$1"
  1443. },
  1444. {
  1445. name: "postype",
  1446. url: /^https:\/\/www\.postype\.com\//,
  1447. r: [/\/resize(\/.*\/)\d+x\d+x\d+\/\w+?\//, /\?w=.*/],
  1448. s: ["$1", ""]
  1449. },
  1450. {
  1451. name: "piccoma jp",
  1452. url: /^https:\/\/piccoma\.com\//,
  1453. r: [/(thumbnail|cover)_x\d/, /x\d$/],
  1454. s: ["cover_x3", "x3"],
  1455. getExtSrc: function() {
  1456. if (this.children[0] && this.children[0].nodeName === "IMG") {
  1457. return this.children[0].src.replace(/(thumbnail|cover)_x\d/, "cover_x3").replace(/x\d$/, "x3");
  1458. }
  1459. }
  1460. },
  1461. {
  1462. name: "bunkr",
  1463. url: /bunkr\.si/,
  1464. r: /\/thumbs(\/.*)png/,
  1465. s: "$1jpg"
  1466. },
  1467. {
  1468. name:"vk",
  1469. url:/vk\.com/,
  1470. xhr:{
  1471. url: function() {
  1472. if (this.classList.contains("photos_row")) {
  1473. return this.firstElementChild && this.firstElementChild.href;
  1474. }
  1475. },
  1476. query: function(html, doc) {
  1477. let r = doc.querySelector('meta[name="og:image"]');
  1478. if (!r) return;
  1479. r = r.getAttribute("value");
  1480. if (!r) return;
  1481. r = r.match(/\/([\w\-]+)\.(jpg|png)/);
  1482. if (!r) return;
  1483. r = r[1];
  1484. r = html.match(new RegExp(`"z_src":"([^"]*?${r}[^"]*?)","z_"`));
  1485. return r && r[1];
  1486. }
  1487. }
  1488. },
  1489. {
  1490. name: "sspai",
  1491. url: /^https?:\/\/sspai\.com\//,
  1492. r: /\?imageMogr.*/,
  1493. s: ""
  1494. },
  1495. {
  1496. name: "la-croix",
  1497. url: /^https?:\/\/www\.la\-croix\.com\//,
  1498. r: /\/\d+x\d+\//,
  1499. s: "/x/"
  1500. },
  1501. {
  1502. name:"e-hentai",
  1503. url:/^https?:\/\/(e\-|ex)hentai\.org\//i,
  1504. xhr: {
  1505. url: function(a, p) {
  1506. if (!a || !/blank\.gif$/.test(this.src)) return;
  1507. const re = /\/s\//i;
  1508. const m = a.href.match(re);
  1509. return m && a.href;
  1510. },
  1511. query: function(html, doc) {
  1512. let img = doc.querySelector("#img");
  1513. return img && img.src;
  1514. }
  1515. }
  1516. },
  1517. {
  1518. name:"turboimagehost",
  1519. url:/^https?:\/\/www\.turboimagehost\.com\//i,
  1520. xhr: {
  1521. url: ".bbc_link",
  1522. query: "#imageid"
  1523. }
  1524. }
  1525. ];