Sleazy Fork is available in English.

pvcep_rules

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

27.05.2024 itibariyledir. En son verisyonu görün.

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