pvcep_rules

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

اعتبارا من 12-10-2023. شاهد أحدث إصدار.

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