Easy offline | 一键离线下载

在种子或视频链接旁添加按钮离线下载至网盘 | Easy stream torrents or videos from cloud storage

当前为 2016-08-25 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Easy offline | 一键离线下载
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.4
  5. // @description 在种子或视频链接旁添加按钮离线下载至网盘 | Easy stream torrents or videos from cloud storage
  6. // @author Hoothin
  7. // @match http*://*/*
  8. // @grant GM_setValue
  9. // @grant GM_getValue
  10. // @require http://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.min.js
  11. // ==/UserScript==
  12.  
  13. function include(Things,obj) {
  14. for (var i = Things.length - 1; i >= 0; i--) {
  15. if ($(Things[i]).attr('href')===$(obj).attr('href')){
  16. return true;
  17. }
  18. }
  19. }
  20.  
  21. function setCss(){
  22. $('head').append('<style>a.wxz-a{ background-repeat: no-repeat;background-position: center; display: inline-block;margin-left:5px;height: 20px;width: 20px;background-size: 20px;border-radius: 50%;background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAZCAYAAADE6YVjAAAB/UlEQVRIS6WUDVEDQQyFWwVQBRQFFAetAkABRQGggFYBOKAoABRwDgAFFAWAA953s+nkMtn+wM5kus0leXn52X5vu7MvsyPJSML9W/ImeS/3tVH6GzCm+n5ZgtdMAbuTPNQMaiBk/CgZbke0tVpKzgrDjlsGQvb3OwSPphdSLLwygvwXwGJ3gDwIJXr9B4Poemyl8yDU9GAHkOcShMZTnr3gix6gnoH8pUyHpdnEmUlukgTbshkIqOwBh9kns6ZkyngyxvHMS3D07M5XYtOyASQaMO8wszPU5SMJwEIOnJ7EzhO7ASBjyYv7GJ355Jn6OH6KaslMALmS3IYM4qzDLNudVXOLf8bmGpCZJDatkW7igCnpUhInCJPVqOqesZnXmODsp4f/WZbo/QDwH9aIPaotk7HE98QIRGecYGhTiN2PhCWGZTwzKahQ25Pa+OEIG3+wJUsSsyXE7rQYPTlj7ieSdro4temhL02SZQRmxK1vgHKHITs32rTxcWciHgyYzGElkc7GY0MG8e1iZygZv5x1UxZxWhYot3mF487UnpkIkr7CGE0lceka6fzOUJrsmfEgncQ8EzPKgOLO2ORkrYjMO+XyDtSSQNYj2CwkS8lnYRxfCXpAgkxq52RMvAFOvG1+AWMMgtMnkkjPJhBzsrmHIXemjYwRm7waRu8XzEByGl4Ir08AAAAASUVORK5CYII=");vertical-align: middle;}</style>');
  23. }
  24.  
  25. function getAllEnableUrl() {
  26. var rawnodes;
  27. if (location.href.indexOf(".torrentkitty.") != -1){
  28. rawnodes = $('a[href^="magnet"],[href$=".torrent"]').get();
  29. }else{
  30. rawnodes = $('a[href^="magnet"],[href$=".torrent"],[href$=".mp4"],[href$=".rar"],[href$=".7z"],[href$=".zip"],[href$=".rmvb"],[href$=".mkv"]').get();
  31. }
  32. if(rawnodes.length>0){
  33. var nodes = [];
  34. var codeList = [];
  35. var listLen = 0;
  36. for (var i = 0; i <rawnodes.length; i++) {
  37. if(!include(nodes,rawnodes[i])){
  38. nodes.push(rawnodes[i]);
  39. }
  40. }
  41. listLen = nodes.length;
  42. setCss();
  43. if (listLen !== 0) {
  44. for (i = 0; i < listLen; i++) {
  45. var curNode = nodes[i];
  46. var url = $(curNode)[0]["href"];
  47. $(curNode).after($(curNode).clone().addClass('wxz-a').css("background-color","#5e5eff").empty().attr("target","_blank").attr("url",url).attr("title","115" ).attr("href", "http://115.com/?tab=offline&mode=wangpan").click(function (event) {GM_setValue("url",$(event.target).attr("url"));}));
  48. $(curNode).after($(curNode).clone().addClass('wxz-a').css("background-color","#3BEBFF").empty().attr("target","_blank").attr("url",url).attr("title","Furk" ).attr("href", "https://www.furk.net/users/files/add").click(function (event) {GM_setValue("url",$(event.target).attr("url"));}));
  49. $(curNode).after($(curNode).clone().addClass('wxz-a').css("background-color","#F44336").empty().attr("target","_blank").attr("url",url).attr("title","Seedr" ).attr("href", "https://www.seedr.cc/files").click(function (event) {GM_setValue("url",$(event.target).attr("url"));}));
  50. $(curNode).after($(curNode).clone().addClass('wxz-a').css("background-color","#ffffff").empty().attr("target","_blank").attr("url",url).attr("title","BaiduPan" ).attr("href", "http://pan.baidu.com/disk/home").click(function (event) {GM_setValue("url",$(event.target).attr("url"));}));
  51. }
  52. }
  53. $('.wxz-a').css('b','d');
  54. }
  55. }
  56.  
  57. var i=0;
  58. var t=window.setInterval(function() {
  59. var curlink;
  60. if (location.href.indexOf("furk.net/users/files/add") != -1){
  61. window.clearInterval(t);
  62. curlink = GM_getValue('url');
  63. if(curlink){
  64. setTimeout(function() {
  65. $('#url').val(curlink);
  66. GM_setValue('url', '');
  67. $(":submit[value='Add download']").click();
  68. }, 500);
  69. }
  70. }else if(location.href.indexOf("seedr.cc/files") != -1){
  71. if($('#upload-button').css("display") != "none"){
  72. window.clearInterval(t);
  73. curlink = GM_getValue('url');
  74. if(curlink){
  75. setTimeout(function() {
  76. $(':text[name="torrent"]').val(curlink);
  77. GM_setValue('url', '');
  78. $('#upload-button').click();
  79. }, 500);
  80. }
  81. }
  82. }else if(location.href.indexOf("pan.baidu.com/disk/home") != -1){
  83. window.clearInterval(t);
  84. curlink = GM_getValue('url');
  85. if(curlink){
  86. document.querySelector('.g-button[data-button-id=b13]').click();
  87. setTimeout(function() {
  88. document.querySelector('#_disk_id_2').click();
  89. setTimeout(function() {
  90. document.querySelector('#share-offline-link').value = curlink;
  91. document.querySelector('.g-button[data-button-id=b63]').click();
  92. }, 500);
  93. }, 1500);
  94. GM_setValue('url', '');
  95. }
  96. }else if(location.href.indexOf("115.com/?tab=offline&mode=wangpan") != -1){
  97. window.clearInterval(t);
  98. curlink = GM_getValue('url');
  99. if(curlink){
  100. var rsc = setInterval(function() {
  101. if (document.readyState == 'complete') {
  102. clearInterval(rsc);
  103. setTimeout(function() {
  104. Core['OFFL5Plug'].OpenLink();
  105. setTimeout(function() {
  106. $('#js_offline_new_add').val(curlink);
  107. }, 300);
  108. }, 1000);
  109. }
  110. }, 400);
  111. GM_setValue('url', '');
  112. }
  113. }else if((i===0 && $('a[href^="magnet"],[href$=".torrent"],[href$=".mp4"],[href$=".rar"],[href$=".7z"],[href$=".zip"],[href$=".rmvb"],[href$=".mkv"]').length>0)||i>20){
  114. window.clearInterval(t);
  115. getAllEnableUrl();
  116. }else{
  117. i++;
  118. }
  119. }, 500);

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址