Sleazy Fork is available in English.

ImageHost Picture Viewer

Redirects Imagehost Pages to the hosted Image

  1. // ==UserScript==
  2. // @name ImageHost Picture Viewer
  3. // @namespace http://greasyfork.org/users/175593-yich-lin
  4. // @author Yich
  5. // @version 7.4
  6. // @description Redirects Imagehost Pages to the hosted Image
  7. // @icon http://i.imgur.com/eLGmXwE.png
  8. // @icon64 http://i.imgur.com/EkKNXD8.png
  9. // @include *://rule34.paheal.net/post/view/*
  10. // @include *://g.e-hentai.org/s/*/*
  11. // @include *://www.quickmeme.com/meme/*
  12. // @include *://www.quickmeme.com/p/*
  13. // @include *://*deviantart.com/art/*
  14. // @include *://adf.ly/*/banner/*
  15. // @include *://www.linkbucks.com/*/url/*
  16. // @include *://imgchili.net/show/*/*
  17. // @include *://imagetwist.com/*
  18. // @include *://imgdino.com/viewer.php?file=*
  19. // @include *://imgtiger.com/viewer.php?file=*
  20. // @include *://*imgspice.com/*/*
  21. // @include *://www.imgboc.com/share.php?id=*
  22. // @include *://imagecurl.org/viewer.php?file=*
  23. // @include *://imagecurl.org/v/*
  24. // @include *://imageshack.com/i/*
  25. // @include *://postimg.org/image/*
  26. // @include *://xxxhost.me/viewer.php?file=*
  27. // @include *://www.euro-pic.eu/share-*.html
  28. // @include *://www.pixsor.com/share-*.html
  29. // @include *://imgboxxx.com/viewer.php?file=*
  30. // @include *://picturescream.com/x/clean/*
  31. // @include *://www.fastpics.net/?v=*
  32. // @include *://www.imgnip.com/viewer.php?file=*
  33. // @include *://tinypic.com/view.php*pic=*
  34. // @include *://www.imagefap.com/photo/*/*
  35. // @include *://imageshimage.com/*
  36. // @include *://*imagevenue.com/img.php?image=*
  37. // @include *://www.imagesnake.org/show/*/*
  38. // @include *://imagenimage.com/*/*
  39. // @include *://img.i7m.de/show/*
  40. // @include *://imgbox.com/*
  41. // @include *://picturevip.com/x/clean/*
  42. // @include *://imgdone.com/viewer.php?file=*
  43. // @include *://www.imglooks.com/viewer.php?file=*
  44. // @include *://www.uploadica.com/?v=*
  45. // @include *://you-logo.ru/show-image.php?id=*
  46. // @include *://imgreserve.com/?v=*
  47. // @include *://www.imgflare.com/*/*
  48. // @include *://picexposed.com/*/*
  49. // @include *://imgseeds.com/image/*
  50. // @include *://imgserve.net/*
  51. // @include *://imgcandy.net/*
  52. // @include *://imgmega.com/*/*
  53. // @include *://08lkk.com/*/*
  54. // @include *://imgpaying.com/*/*
  55. // @include *://imgtab.net/v/i/*
  56. // @include *://imgtube.net/*
  57. // @include *://www.imgblow.com/*
  58. // @include *://img-zone.com/*
  59. // @include *://img.yt/*
  60. // @include *://pic.re/*
  61. // @include *://www.imgbabes.com/*/*
  62. // @include *://www.imglemon.com/*
  63. // @include *://pixsor.com/share-*.html
  64. // @include *://imgdetop.com/img-*.html
  65. // @include *://imgtrex.com/*/*
  66. // @include *://picturescream.asia/*
  67. // @include *://damimage.com/img-*.html
  68. // @include *://www.imagebam.com/image/*
  69. // @include *://pictures.mrstiff.com/view/picture/full/*
  70. // @include *://*.photobucket.com/user/*/media/*.htm*
  71. // @include *://imgadult.com/*
  72. // @include *://imgrock.pw/*
  73. // @include *://www.imgsee.net/*
  74. // @include *://picbaron.com/*
  75. // @include *://ecoimages.xyz/*
  76. // @include *://kvador.com/*
  77.  
  78. // ============== yich 新增================================
  79. // @include *://imagexport.com/*.jpg
  80. // @include *://picmoza.com//*.html
  81. // @include *://imgtaxi.com/*.html
  82. // @include *://www.imgfile.net/site/v/*
  83. // @include *://imgdrive.net/*.html
  84. // @include *://hdmoza.com/*.html
  85. // @include *://imgbaron.com/*
  86. // @grant window.close
  87. // @require https://code.jquery.com/jquery-3.3.1.min.js
  88. // @updateVersion 1
  89. // @run-at document-end
  90. // ==/UserScript==
  91.  
  92. // ===============================add by Yich==========================================
  93. if(true && UrlContains("imagexport.com")){
  94. imageContainClass("pic");
  95. document.getElementById("popupOverlay").remove();
  96. }
  97. if(true && UrlContains("imgsee.net")){
  98. var html = $("html").html();
  99. var url = html.match(/(https?:\/\/.*\.(?:png|jpg))/i);
  100. window.location.assign(url[0]);
  101. }
  102. if(true && UrlContains("picbaron")){
  103. FormRedirect();
  104. imageContainClass("pic");
  105. }
  106. if(true && UrlContains("imgbaron")){
  107. FormRedirect();
  108. imageContainClass("pic");
  109. }
  110. if(true && UrlContains("picmoza.com")){
  111. InputRedirect();
  112. imageHasClass("centred");
  113. }
  114. if(true && UrlContains("kvador.com")){
  115. document.getElementsByName('next')[0].click();
  116. imageHasClass("pic");
  117. }
  118. if(true && UrlContains("ecoimages.xyz")){
  119. InputRedirect();
  120. imageHasClass("centred_resized");
  121. imageHasClass("centred");
  122. }
  123. if(true && UrlContains("hdmoza.com")){
  124. InputRedirect();
  125. imageHasClass("centred");
  126. imageHasClass("centred_resized");
  127. }
  128.  
  129. if(true && (UrlContains("imgtaxi.com")||
  130. UrlContains("imgdrive.net")||
  131. UrlContains("imgadult.com"))){
  132. var img = document.querySelector('meta[property="og:image"], meta[name="og:image"]');
  133. img = img ? img.getAttribute('content') : 0;console.log(img);
  134. if (img) {
  135. img = smallToBig(img);
  136. location.replace(img);
  137. }
  138. }
  139. if(true && UrlContains("imgfile.net")){
  140. $("#interstitialPageText").remove();
  141. setTimeout(function(){
  142. loadAllContentImages();
  143. },0);
  144.  
  145. }
  146.  
  147. if(true && UrlContains("iceimg.net")){
  148. $("#interstitialPageText").remove();
  149. setTimeout(function(){
  150. loadAllContentImages();
  151. },0);
  152.  
  153. }
  154.  
  155. if(true && UrlContains("imgrock")){
  156. //InputRedirect();
  157. }
  158.  
  159. // =========================================================================
  160. if(false && UrlContains("rule34.paheal.net")){
  161. imageHasId("main_image");
  162. }
  163. if(false && UrlContains("g.e-hentai.org")){
  164. imageHasId("img");
  165. }
  166. if(false && UrlContains("www.quickmeme.com")){
  167. if(UrlContains("/meme/")) { imageHasId("post-image-" + document.URL.split("/meme/")[1].split("?")[0]); }
  168. else if(UrlContains("/p/")) { imageHasId("post-image-" + document.URL.split("/p/")[1].split("?")[0]); }
  169. }
  170. if(false && UrlContains("deviantart.com")){
  171. imageHasClass("dev-content-full");
  172. }
  173. // =========================================================================
  174. if(true && UrlContains("adf.ly")){
  175. setTimeout(function(){
  176. window.location.assign(document.URL.split("/banner/")[1]);
  177. }, 100);
  178. }
  179. if(true && UrlContains("www.linkbucks.com")){
  180. window.location.assign(document.URL.split("/url/")[1]);
  181. }
  182.  
  183.  
  184. // =========================================================================
  185. if(true && UrlContains("imgchili.net")){
  186. imageHasId('show_image');
  187. }
  188. if(true && UrlContains("imagetwist.com")){
  189. imageContainClass("pic");
  190. }
  191. if(true && UrlContains("imgdino.com")){
  192. imageHasId('cursor_lupa');
  193. }
  194. if(true && UrlContains("imgtiger.com")){
  195. imageHasId('cursor_lupa');
  196. }
  197. if(true && UrlContains("imgspice.com")){
  198. imageHasId('knjdycbs87nbd');
  199. }
  200. if(true && UrlContains("imgboc.com") && !UrlContains("&")){
  201. window.location.assign(document.URL.replace("share.php", "image.php") + "&jpg");
  202. }
  203. if(true && UrlContains("imagecurl.org")){
  204. if(UrlContains("/viewer.php?file=")){
  205. window.location.assign(document.URL.replace("viewer.php?file=", "images/"));
  206. }else{
  207. var links = document.getElementsByTagName("a");
  208. for (var i = 0; i < links.length; i++){
  209. if(links[i].href.indexOf("cdn.imagecurl.org/images/") != -1){
  210. window.location.assign(links[i].href);
  211. break;
  212. }
  213. }
  214. }
  215. }
  216. if(true && UrlContains("imageshack.com")){
  217. var imgDivs = document.getElementsByTagName("img");
  218. for (var i = 0; i < imgDivs.length; i++){
  219. if(imgDivs[i].hasAttribute("onerror")){
  220. window.location.assign(imgDivs[i].src);
  221. break;
  222. }
  223. }
  224. }
  225. if(true && UrlContains("postimg.org")){
  226. var anc = document.getElementsByTagName("a");
  227. for (var i = 0; i < anc.length; i++){
  228. if(anc[i].href.indexOf("/full/")){
  229. window.location.assign(anc[i].getElementsByTagName("img")[0].src);
  230. break;
  231. }
  232. }
  233. }
  234. if(true && UrlContains("xxxhost.me")){
  235. window.location.assign(document.URL.replace("viewer.php?file=", "files/"));
  236. }
  237. if(true && UrlContains("www.euro-pic.eu")){
  238. window.location.assign(document.URL.replace("share-", "image.php?id=").replace(".html", ""));
  239. }
  240. if(true && UrlContains("www.pixsor.com")){
  241. window.location.assign(document.URL.replace("share-", "image.php?id=").replace(".html", ""));
  242. }
  243. if(true && UrlContains("imgboxxx.com")){
  244. window.location.assign(document.URL.replace("viewer.php?file=", "images/"));
  245. }
  246. if(true && UrlContains("picturescream.com")){
  247. var div = document.getElementById("shortURL-content");
  248. var url = div.getElementsByTagName("a")[0].getElementsByTagName("img")[0].src;
  249. window.location.assign(url);
  250. }
  251. if(true && UrlContains("www.fastpics.net")){
  252. window.location.assign(document.URL.replace("?v=", "images/"));
  253. }
  254. if(true && UrlContains("www.imgnip.com")){
  255. window.location.assign(document.URL.replace("viewer.php?file=", "images/"));
  256. }
  257. if(true && UrlContains("www.imagefap.com")){
  258. imageHasId('mainPhoto');
  259. }
  260. if(true && UrlContains("imageshimage.com")){
  261. imageHasClass("pic");
  262. }
  263. if(true && UrlContains("imagevenue.com")){
  264. imageHasId("thepic");
  265. }
  266. if(true && UrlContains("imagenimage.com")){
  267. imageHasClass("pic");
  268. }
  269. if(true && UrlContains("img.i7m.de")){
  270. imageHasId('mainImage');
  271. }
  272. if(true && UrlContains("imgbox.com")){
  273. imageHasId('img');
  274. }
  275. if(true && UrlContains("picturevip.com")){
  276. window.location.assign(document.getElementById("shortURL-content").getElementsByTagName("a")[0].getElementsByTagName("img")[0].src);
  277. }
  278. if(true && UrlContains("imgdone.com")){
  279. window.location.assign(document.URL.replace("viewer.php?file=", "images/"));
  280. }
  281. if(true && UrlContains("www.uploadica.com")){
  282. imageHasId('full_image');
  283. }
  284. if(true && UrlContains("you-logo.ru")){
  285. nthImageOnPage(0);
  286. }
  287. if(true && UrlContains("imgreserve.com")){
  288. window.location.assign(document.URL.replace("?v=", "images/") + ".jpg");
  289. }
  290. if(true && UrlContains("www.imgflare.com")){
  291. if(UrlContains("attempt")){
  292. imageHasId('this_image');
  293. }else{
  294. Decode();
  295. }
  296. }
  297. if(true && UrlContains("picexposed.com")){
  298. imageHasClass('pic');
  299. }
  300. if(true && UrlContains("imgserve.net")){
  301. imageHasClass('centred');
  302. }
  303. if(true && UrlContains("imgpaying.com")){
  304. imageHasClass('pic');
  305. }
  306. if(true && UrlContains("imgcandy.net")){
  307. InputRedirect();
  308. imageHasClass('centred');
  309. imageHasClass('centred_resized');
  310. }
  311. if(true && UrlContains("imgmega.com")){
  312. FormRedirect();
  313. imageHasClass('pic');
  314. }
  315. if(true && UrlContains("pixsor.com")){
  316. window.location.assign(document.URL.replace("share-", "image.php?id=").replace(".html", ""));
  317. }
  318. if(true && UrlContains("imgdetop.com")){
  319. InputRedirect();
  320. imageHasClass('centred');
  321. imageHasClass('centred_resized');
  322. }
  323. if(true && UrlContains("imgtrex.com")){
  324. imageHasClass('pic');
  325. }
  326. if(true && UrlContains("picturescream.asia")){
  327. var link = document.getElementById("direct-link");
  328. if(link != null){
  329. window.location.assign(link.href);
  330. }
  331. }
  332. if(true && UrlContains("damimage.com")){
  333. imageHasClass('centred');
  334. imageHasClass('centred_resized');
  335. }
  336. if(true && UrlContains("pictures.mrstiff.com")){
  337. imageHasId('img');
  338. }
  339. // Untested =====================================================
  340. if(true && UrlContains("www.imglooks.com")){
  341. window.location.assign(document.URL.replace("viewer.php?file=", "images/"));
  342. }
  343. if(true && UrlContains("imgseeds.com")){
  344. imageHasId('img1');
  345. }
  346. if(true && UrlContains("08lkk.com")){
  347. InputRedirect();
  348. imageHasClass('centred');
  349. imageHasClass('centred_resized');
  350. }
  351. if(true && UrlContains("img.yt")){
  352. InputRedirect();
  353. imageHasClass('centred');
  354. imageHasClass('centred_resized');
  355. }
  356. if(true && UrlContains("imgtab.net")){
  357. imageHasId('main_image')
  358. }
  359. if(true && UrlContains("imgtube.net")){
  360. imageHasId('image');
  361. }
  362. if(true && UrlContains("www.imgblow.com")){
  363. imageHasClass('centred');
  364. imageHasClass('centred_resized');
  365. }
  366. if(true && UrlContains("img-zone.com")){
  367. imageHasClass('centred');
  368. imageHasClass('centred_resized');
  369. }
  370. if(true && UrlContains("pic.re")){
  371. FormRedirect();
  372. imageHasClass('pic');
  373. }
  374. if(true && UrlContains("www.imgbabes.com")){
  375. if(document.getElementById("sys_message"))
  376. window.location.reload();
  377. InputRedirect();
  378. imageHasClass('pic');
  379. }
  380.  
  381. if(true && UrlContains("photobucket.com")){
  382. img = document.querySelector('meta[property="og:image"], meta[name="og:image"]');
  383. img = img ? img.getAttribute('content') : 0;console.log(img);
  384. if (img) { location.replace(img); }
  385. }
  386. // =========================================================================
  387. if(true && UrlContains("www.imagesnake.org")){
  388. antiHotLinkingId("img_obj", "imagesnake.org");
  389. }
  390. if(true && UrlContains("tinypic.com")){
  391. antiHotLinkingId("imgElement", "tinypic.com");
  392. }
  393. if(true && UrlContains("imagebam.com")){
  394. antiHotLinkingNth(5, "imagebam.com");
  395. }
  396. // =========================================================================
  397. function imageHasId(imageid){
  398. var image = document.getElementById(imageid);
  399. if(image != null){
  400. window.location.assign(image.src);
  401. }
  402. }
  403. function imageHasClass(imageclass){
  404. var imgs = document.getElementsByTagName("img");
  405. for (var i = 0; i < imgs.length; i++){
  406. if(imgs[i].className == imageclass){
  407. window.location.assign(imgs[i].src);
  408. break;
  409. }
  410. }
  411. }
  412.  
  413. function imageContainClass(className) {
  414. var imgs = document.getElementsByTagName("img");
  415. for (var i = 0; i < imgs.length; i++){
  416. if(imgs[i].classList.contains(className)){
  417. window.location.assign(imgs[i].src);
  418. break;
  419. }
  420. }
  421. return (' ' + element.className + ' ').indexOf(' ' + className+ ' ') > -1;
  422. }
  423.  
  424. function nthImageOnPage(numb){
  425. var imgs = document.getElementsByTagName("img");
  426. if(imgs.length > numb){
  427. window.location.assign(imgs[numb].src);
  428. }
  429. }
  430. function antiHotLinkingNth(numb, imageHost){
  431. var imgs = document.getElementsByTagName("img");
  432. if(imgs.length > numb){
  433. antiHotLinkingBuild(imgs[numb].src, imageHost);
  434. }
  435. }
  436. function antiHotLinkingId(imageId, imageHost){
  437. antiHotLinkingBuild(document.getElementById(imageId).src, imageHost);
  438. }
  439. function antiHotLinkingBuild(imageLink, imageHost){
  440. var html = document.createElement('html');
  441. var body = document.createElement('body');
  442. var div = document.createElement('div');
  443. div.setAttribute('align', 'center');
  444. var link = document.createElement('a');
  445. link.setAttribute('href', imageLink);
  446. link.appendChild(document.createTextNode("click here for the image"));
  447. link.style.fontSize = "2em";
  448. div.appendChild(link);
  449. div.appendChild(document.createElement('br'));
  450. div.appendChild(document.createElement('br'));
  451. div.appendChild(document.createTextNode(imageHost + " prevents \"hotlinking\", so you need to click the link"));
  452. div.appendChild(document.createElement('br'));
  453. div.appendChild(document.createTextNode("this page made by Imagehost Redirect"));
  454. body.appendChild(div);
  455. html.appendChild(body);
  456. document.replaceChild(html, document.documentElement);
  457. }
  458. function UrlContains(urlfragment){
  459. return document.URL.indexOf(urlfragment) != -1;
  460. }
  461. // Added by doge {
  462. // https://greasyfork.org/forum/discussion/899
  463. function FormRedirect(){
  464. var continueForm = document.getElementsByTagName('form')[0];
  465. if(continueForm != null) {
  466. continueForm.submit();
  467. }
  468. }
  469. function InputRedirect(){
  470. var continueButton = document.getElementsByTagName('input')[0];
  471. if(continueButton != null) {
  472. continueButton.click();
  473. }
  474. }
  475. function smallToBig(url){
  476. return url.replace("small", "big");
  477. }
  478.  
  479. //刪除dom 用法 document.getElementById("my-element").remove();
  480. Element.prototype.remove = function() {
  481. this.parentElement.removeChild(this);
  482. }
  483. NodeList.prototype.remove = HTMLCollection.prototype.remove = function() {
  484. for(var i = this.length - 1; i >= 0; i--) {
  485. if(this[i] && this[i].parentElement) {
  486. this[i].parentElement.removeChild(this[i]);
  487. }
  488. }
  489. }
  490.  
  491.  
  492.