Depositfiles Helper

Just a helper

  1. // ==UserScript==
  2. // @name Depositfiles Helper
  3. // @description Just a helper
  4. // @namespace x4_dhelper
  5. // @version 0.1
  6. // @author x4fab
  7. // @include http://dfiles.ru/files/*
  8. // @include http://depositfiles.com/files/*
  9. // @include https://depositfiles.com/files/*
  10. // @grant none
  11. // @run-at document-start
  12. // @license CC0
  13. // ==/UserScript==
  14.  
  15. document.title = 'Depositfiles';
  16.  
  17. window.onmessage = function(e){
  18. document.querySelector('#adcopy_response').value =
  19. document.querySelector('#adcopy-expanded-response').value = e.data;
  20. };
  21.  
  22. window.onload = function (c, p, d){
  23. c = p = d = t = b = nn = 1;
  24. setInterval(function() {
  25. c && Array.prototype.forEach.call(
  26. document.querySelectorAll('#free_btn'),
  27. function (e){
  28. c = e.click();
  29. });
  30. p && Array.prototype.forEach.call(
  31. document.querySelectorAll('[href="javascript:close_iframe_console();"]'),
  32. function (e){
  33. p = e.click();
  34. });
  35. d && Array.prototype.forEach.call(
  36. document.querySelectorAll('#downloader_file_form[onsubmit="download_started();show_begin_popup(0);"] a'),
  37. function (e){
  38. d = e.click();
  39. });
  40. t && Array.prototype.forEach.call(
  41. document.querySelectorAll('#adcopy_response'),
  42. function (e){
  43. t = 0;
  44. e.onkeydown = function (e){ if (e.keyCode == 13) document.querySelector('input[value="Continue"]').click() }
  45. });
  46. b && Array.prototype.forEach.call(
  47. document.querySelectorAll('.downloadblock.downloadblock_limit .ip .ipbg strong'),
  48. function (e){
  49. b = 0;
  50. var m = e.innerHTML.match(/\s{30}(\d+(?:\.\d+)?) s/);
  51. setTimeout(function(){ location.reload() }, m ? Math.min(+m[1] * 1e3, 30e3) : 60e3);
  52. });
  53. nn && Array.prototype.forEach.call(
  54. document.querySelectorAll('#adcopy_response'),
  55. function (e){
  56. nn = 0;
  57. var n = new Notification('Captcha Required', { icon: 'http://static.dfiles.ru/images/favicon.ico' });
  58. n.onclick = function(){ window.focus() };
  59. e.onchange = function(){ n.close(); };
  60. });
  61. }, 180);
  62. };