Bypass Wait, Code, & Login For Chrome

Remove verify code, login requirement, counting down... and more!

נכון ליום 06-03-2014. ראה הגרסה האחרונה.

  1. // ==UserScript==
  2. // @grant GM_getValue
  3. // @grant GM_setValue
  4. // @grant GM_xmlhttpRequest
  5. // @run-at document-start
  6.  
  7. // @name Bypass Wait, Code, & Login For Chrome
  8. //// Based on [Crack Url Wait Code Login] By Yulei
  9.  
  10. // @author jixun66
  11. // @namespace http://jixun.org/
  12. // @description Remove verify code, login requirement, counting down... and more!
  13. // @version Mod-v60
  14. // @create 2012-01-26
  15. // @lastmodified 2014.03.06
  16.  
  17. // 通用网盘域名匹配
  18. // @include /\/\/([a-z0-9-]+\.|)((azpan|xddisk|dxrr|87pan|sufile|360disk|nyhx|yimuhe|79pan|sudupan|colafile)\.com|bpan\.net|supan\.la)\//
  19.  
  20. // 数据银行
  21. // @include /\/\/dl\.(vmall|dbank)\.com\//
  22. // 盛大网盘 & 119g
  23. // @include /\/\/(([a-z0-9-]+\.|)everbox|d\.119g)\.com\/f\//
  24.  
  25. // 度娘盘
  26. // @include /\/\/(pan|yun)\.baidu\.com\/s(hare\/link|\/)/
  27.  
  28. // CSDN (NOT WORKING)
  29. //// @include /\/\/download\.csdn\.net\/download\//
  30.  
  31. // it168
  32. // @include /\/\/([a-z-]+\.|)down\.it168\.com\//
  33.  
  34. // 基于 phpDisk 的网盘
  35. // @include /\/\/([a-z0-9-]+\.|)((qjwm|7958|2kuai|32666)\.com)\/(view|down|download)(file|-|\/|\.|_)/
  36.  
  37. // 飞速盘
  38. // @include /\/\/([a-z0-9-]+\.|)rayfile\.com\/(.+)\/files\//
  39.  
  40. // 威盘
  41. // @include /\/\/([a-z0-9-]+\.|)vdisk\.cn\/down\/index\//
  42.  
  43. // YunFile
  44. //// NOT WORKING @include /\/\/([a-z0-9-]+\.|)yunfile\.com\/f(ile|s)\//
  45.  
  46. // 讯载网盘
  47. // @include /\/\/u\.xunzai\.com\/fileview_/
  48.  
  49. // VeryCD
  50. // @include /\/\/([a-z-]+\.|)verycd\.com\/(topics|files)\//
  51.  
  52. // 华军
  53. // @include /\/\/([a-z-]+\.|)onlinedown\.net\/softdown\//
  54.  
  55. // 城通系列 & howfile & fileIm
  56. // @include /\/\/([a-z-]+\.|)((pipipan|ctdisk|400gb|howfile|fileim)\.com|bego\.cc)\/(file|downhtml)\//
  57.  
  58. // 快盘
  59. // @include /\/\/([a-z-]+\.|)kuaipan\.cn\/file\/id_/
  60.  
  61. // 短链接
  62. // @include /\/\/(dc2\.us|dd\.ma|(ref|upan)\.so|t00y\.com)\//
  63.  
  64.  
  65. // 音乐放这边 >.>
  66. // @include /\/\/([a-z0-9-]+\.|)((jing|5sing|zy\.51gugu|duole)\.com|(douban|moe|kxt)\.fm)\//
  67. // SongTaste
  68. // @include /\/\/([a-z0-9-]+\.|)songtaste\.com\/(song|album|playmusic\.php)/
  69. // 虾米音乐
  70. // @include /\/\/([a-z-]+\.|)xiami\.com\/song\/play$/
  71. // 565656
  72. // @include /\/\/([a-z0-9-]+\.|)565656\.com\/plus\/player\.ashx/
  73. // djcc & djye
  74. // @include /\/\/([a-z0-9-]+\.|)(djcc|djye)\.com\/play\.(php|html)/
  75. // djkk
  76. // @include /\/\/([a-z0-9-]+\.|)djkk\.com\/dance\/play\//
  77. // 9ku
  78. // @include /\/\/([a-z0-9-]+\.|)9ku\.com\/pp\/(.+)\/pp\./
  79. // 人人电台
  80. // @include /\/\/fm\.renren\.com\/$/
  81. // 邻居的耳朵
  82. //// @include /\/\/kxt\.fm/
  83. // @include /\/\/ear\.duomi\.com/
  84. // 腾讯电台
  85. // @include /\/\/fm\.qq\.com/
  86. // 音悦台
  87. // @include /\/\/((www|v)\.)yinyuetai\.com\/(video|playlist)\//
  88.  
  89.  
  90. // @include /\/\/([a-z0-9-]+\.|)1ting\.com\//
  91. // 取消掉歌词页面的加载
  92. // @exclude /\/\/([a-z0-9-]+\.|)1ting\.com\/lrc/
  93.  
  94. // @copyright 2012+, Yulei, Chrome Compatibility by Jixun.
  95. // @require http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js
  96. // ==/UserScript==
  97.  
  98.  
  99. // 兼容中文的 BASE64 编码系统: https://code.google.com/p/javascriptbase64/
  100. function StringBuffer(){this.buffer=[]}StringBuffer.prototype.append=function(a){this.buffer.push(a);return this};StringBuffer.prototype.toString=function(){return this.buffer.join("")};var Base64={codex:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode:function(a){var c=new StringBuffer;for(a=new Utf8EncodeEnumerator(a);a.moveNext();){var b=a.current;a.moveNext();var d=a.current;a.moveNext();var e=a.current,h=b>>2,b=(b&3)<<4|d>>4,g=(d&15)<<2|e>>6,f=e&63;isNaN(d)?g=f=64:isNaN(e)&&(f=64);c.append(this.codex.charAt(h)+this.codex.charAt(b)+this.codex.charAt(g)+this.codex.charAt(f))}return c.toString()},decode:function(a){var c=new StringBuffer;for(a=new Base64DecodeEnumerator(a);a.moveNext();){var b=a.current;if(128>b)c.append(String.fromCharCode(b));else if(191<b&&224>b){a.moveNext();var d=a.current;c.append(String.fromCharCode((b&31)<<6|d&63))}else a.moveNext(),d=a.current,a.moveNext(),c.append(String.fromCharCode((b&15)<<12|(d&63)<<6|a.current&63))}return c.toString()}};function Utf8EncodeEnumerator(a){this._input=a;this._index=-1;this._buffer=[]}Utf8EncodeEnumerator.prototype={current:Number.NaN,moveNext:function(){if(0<this._buffer.length)return this.current=this._buffer.shift(),!0;if(this._index>=this._input.length-1)return this.current=Number.NaN,!1;var a=this._input.charCodeAt(++this._index);13==a&&10==this._input.charCodeAt(this._index+1)&&(a=10,this._index+=2);128>a?this.current=a:(127<a&&2048>a?this.current=a>>6|192:(this.current=a>>12|224,this._buffer.push(a>>6&63|128)),this._buffer.push(a&63|128));return!0}};function Base64DecodeEnumerator(a){this._input=a;this._index=-1;this._buffer=[]}Base64DecodeEnumerator.prototype={current:64,moveNext:function(){if(0<this._buffer.length)return this.current=this._buffer.shift(),!0;if(this._index>=this._input.length-1)return this.current=64,!1;var a=Base64.codex.indexOf(this._input.charAt(++this._index)),c=Base64.codex.indexOf(this._input.charAt(++this._index)),b=Base64.codex.indexOf(this._input.charAt(++this._index)),d=Base64.codex.indexOf(this._input.charAt(++this._index)),e=(b&3)<<6|d;this.current=a<<2|c>>4;64!=b&&this._buffer.push((c&15)<<4|b>>2);64!=d&&this._buffer.push(e);return!0}};
  101.  
  102. /* getFlashVars 1.0 by Jixun [Jixun.Org]; MIT License */
  103. function getFlashVars(a){if(!a)return{};a.jquery&&(a=a[0]);if(-1==a.type.indexOf("flash"))return{};for(var b,d={},c=a.childNodes.length;c--;)if("flashvars"==a.childNodes[c].name){b=a.childNodes[c];break}b&&b.value.replace(/([\s\S]+?)=([\s\S]+?)(&|$)/g,function(a,b,c){d[b]=decodeURIComponent(c)});return d};
  104.  
  105. function linkConv(sInput) {
  106. return Base64.decode((sInput.match(/:\/\/([\/+a-z0-9]+)/i) || [, ''])[1]).replace(/^\[FLASHGET\]|\[FLASHGET\]$|^AA|ZZ$/gi, '');
  107. }
  108.  
  109. (function () {
  110. var us = (typeof (unsafeWindow) != "undefined"),
  111. win = us ? unsafeWindow : window,
  112. sVer = 'Mod-v60';
  113. // 某站过 ABP 检测 233333
  114. win.antiads = 0;
  115.  
  116. // 防止书签版出错
  117. if (!us) {
  118. GM_getValue=function(){return sVer};
  119. GM_setValue=function(){return !1}
  120. }
  121. /*
  122. * jPrintf: 自写函数,参考:
  123. * http://jixun.org/1656-
  124. *
  125. * $_GET: 自写全局变量, 模拟 php 端的 $_GET 变量。参考:
  126. * http://jixun.org/1774-
  127. */
  128. var d = document,
  129. l = location,
  130. lurl = l.href,
  131. gPathway = '',
  132. showUpdate = 1, // 更新积累 3 个后改成 True.
  133. body = $('body')[0],
  134. numKeys = [1, 2, 3, 4, 5, 6, 7, 8, 9, 'C', '0', '←'],
  135. ubA = function (e) {
  136. e.outerHTML = e.outerHTML
  137. },
  138. cE = function (e) {
  139. return d.createElement(e);
  140. },
  141. bugRepUrl = 'http://userscripts.org/topics/122061#script-nav',
  142. log = function (a1) {
  143. console.log((arguments.length > 1) ? arguments : a1)
  144. },
  145. dhost = ((new RegExp(/(\w+\.\w+)\//).exec(l.hostname + '/') || [, ''])[1]).toLowerCase(),
  146. jprintf = jPrintf = function () {
  147. var b = arguments,
  148. d = b.length - 1,
  149. c = b[0];
  150. if (!(1 > d)) {
  151. for (var a = 1; a <= d; a++) c = c.replace(RegExp("(\\$|%)" + a, "g"), b[a]);
  152. return c
  153. }
  154. },
  155. $_GET = (function (a) {
  156. var z = [],
  157. b = a.substr(a.indexOf("?") + 1);
  158. if (b)
  159. for (var c = b.split("&"), i = 0; i < c.length; i++) {
  160. var d = c[i].toString(),
  161. e = d.indexOf("=");
  162. z[unescape(d.substr(0, e))] = unescape(d.substr(e + 1))
  163. };
  164. return z
  165. })(lurl),
  166. sUpdated = (GM_getValue('ver', '') != sVer);
  167.  
  168. function wordpressAudio () {
  169. log('WordPress Audio 插件通用代码 启动');
  170.  
  171. function fixEmbed (obj) {
  172. if (obj.hasAttribute('CUWCL4C')) return;
  173. console.log ('fixEmbed: ', obj);
  174. $('<a>').html('下载音频<br>')
  175. .attr ({
  176. href: Base64.decode(getFlashVars(obj).soundFile),
  177. target: '_blank'
  178. }).insertBefore (obj);
  179. obj.setAttribute ('CUWCL4C', '^^');
  180. }
  181.  
  182. new MutationObserver (function (e) {
  183. for (var i=0; i<e.length; i++)
  184. if (e[i].target.className == 'audioplayer_container' && e[i].addedNodes.length)
  185. fixEmbed(e[i].addedNodes[0]);
  186. }).observe ($('.post > .entry')[0], {
  187. childList: true,
  188. subtree: true
  189. });
  190. // Firefox fix.. = =
  191. $('object[id^="audioplayer_"]').each(function () { fixEmbed(this) });
  192. log('WordPress Audio 插件通用代码 结束');
  193. }
  194. function parseHTML(responseText) {
  195. // For Firefox
  196. var ret = (new DOMParser()).parseFromString(responseText, "text/html");
  197. // For Chrome
  198. if (ret == undefined) {
  199. var ret = document.implementation.createHTMLDocument("");
  200. ret.querySelector('html').innerHTML = responseText;
  201. }
  202. return ret;
  203. }
  204. function waitUnTil(ver4Check, func, replaceVar) {
  205. var timer = setInterval(function () {
  206. if (typeof (ver4Check) == 'function') {
  207. if (!ver4Check()) return;
  208. } else if (typeof (win[ver4Check]) == 'undefined') {
  209. return;
  210. }
  211. clearInterval(timer);
  212. if (replaceVar && typeof (win[ver4Check]) == 'function') {
  213. log('Function [ ' + ver4Check + ' ] Hooked.');
  214. win[ver4Check] = replaceVar;
  215. }
  216. if (typeof (func) == 'function')
  217. func();
  218. }, 10);
  219. }
  220. function makeCpfCss(name, param) {
  221. var ret = {};
  222. ret[name] = param;
  223. ['o','ms','moz','webkit'].forEach (function (e) {
  224. ret['-' + e + '-' + name] = param;
  225. });
  226. return ret;
  227. }
  228. function safeJump(sTargetUrl) {
  229. d.title = '正在跳转…';
  230. log('safeJump :: ' + sTargetUrl);
  231. if (!sTargetUrl) return false;
  232. l.href = sTargetUrl;
  233. return true
  234. }
  235. function makeDelayCss(sVar) {
  236. var sP = sVar || 'all .2s';
  237. return makeCpfCss('transition', sP);
  238. }
  239. function makeRotateCss(deg) {
  240. return makeCpfCss('transform', 'rotate(' + deg + 'deg)');
  241. }
  242. function createNumPad(maxLen, targetInput, finishCallback) {
  243. var table = cE('table'),
  244. rcde = targetInput;
  245. $(table).css({
  246. 'background-color': '#ffcc99',
  247. 'position': 'relative',
  248. 'bottom': '164px',
  249. 'left': '170px'
  250. });
  251. for (var i = 0; i < 4; i++) {
  252. var tr = cE('tr');
  253. for (var j = 0; j < 3; j++) {
  254. var td = cE('td');
  255. td.innerHTML = $(td).attr('k', numKeys[i * 3 + j]).attr('k');
  256. tr.appendChild(td);
  257. }
  258. table.appendChild(tr);
  259. }
  260. $(table).find('td').click(function () {
  261. var val = rcde.value,
  262. len = val.length,
  263. key = $(this).attr('k') || '';
  264. $(rcde).focus();
  265. if (len >= maxLen) {
  266. rcde.value = val.substr(-1 * maxLen);
  267. finishCallback(rcde.value);
  268. $(table).hide();
  269. } else if (key == '←') {
  270. rcde.value = val.sub(1);
  271. } else if (key == 'C') {
  272. rcde.value = '';
  273. } else {
  274. rcde.value += key;
  275. if (len == maxLen - 1) {
  276. finishCallback(rcde.value);
  277. $(table).hide();
  278. }
  279. }
  280. }).css({
  281. 'font': 'bold 25px Tahoma',
  282. 'color': 'red',
  283. 'cursor': 'pointer',
  284. 'vertical-align': ' middle',
  285. 'text-align': ' center',
  286. 'border': ' 1px solid #DDDDDD',
  287. 'padding': '6px',
  288. 'width': '40px',
  289. 'height': '40px'
  290. });
  291. return table;
  292. }
  293. //pajhome.org.uk/crypt/md5/md5.js
  294. function hex_md5(p){function k(c,f,d,b,e,g,k){return h(h(h(c,f&d|~f&b),h(e,k))<<g|h(h(c,f&d|~f&b),h(e,k))>>>32-g,f)}function l(c,f,d,b,e,g,k){return h(h(h(c,f&b|d&~b),h(e,k))<<g|h(h(c,f&b|d&~b),h(e,k))>>>32-g,f)}function m(c,f,d,b,e,g,k){return h(h(h(c,f^d^b),h(e,k))<<g|h(h(c,f^d^b),h(e,k))>>>32-g,f)}function n(c,f,d,b,e,g,k){return h(h(h(c,d^(f|~b)),h(e,k))<<g|h(h(c,d^(f|~b)),h(e,k))>>>32-g,f)}function h(c,f){var d=(c&65535)+(f&65535);return(c>>16)+(f>>16)+(d>>16)<<16|d&65535}return function(c){for(var f=[],d=255,b=0;b<8*c.length;b+=8)f[b>>5]|=(c.charCodeAt(b/8)&d)<<b%32;c=8*c.length;f[c>>5]|=128<<c%32;f[(c+64>>>9<<4)+14]=c;c=1732584193;for(var d=-271733879,b=-1732584194,e=271733878,g=0;g<f.length;g+=16){var p=c,q=d,r=b,s=e;c=k(c,d,b,e,f[g+0],7,-680876936);e=k(e,c,d,b,f[g+1],12,-389564586);b=k(b,e,c,d,f[g+2],17,606105819);d=k(d,b,e,c,f[g+3],22,-1044525330);c=k(c,d,b,e,f[g+4],7,-176418897);e=k(e,c,d,b,f[g+5],12,1200080426);b=k(b,e,c,d,f[g+6],17,-1473231341);d=k(d,b,e,c,f[g+7],22,-45705983);c=k(c,d,b,e,f[g+8],7,1770035416);e=k(e,c,d,b,f[g+9],12,-1958414417);b=k(b,e,c,d,f[g+10],17,-42063);d=k(d,b,e,c,f[g+11],22,-1990404162);c=k(c,d,b,e,f[g+12],7,1804603682);e=k(e,c,d,b,f[g+13],12,-40341101);b=k(b,e,c,d,f[g+14],17,-1502002290);d=k(d,b,e,c,f[g+15],22,1236535329);c=l(c,d,b,e,f[g+1],5,-165796510);e=l(e,c,d,b,f[g+6],9,-1069501632);b=l(b,e,c,d,f[g+11],14,643717713);d=l(d,b,e,c,f[g+0],20,-373897302);c=l(c,d,b,e,f[g+5],5,-701558691);e=l(e,c,d,b,f[g+10],9,38016083);b=l(b,e,c,d,f[g+15],14,-660478335);d=l(d,b,e,c,f[g+4],20,-405537848);c=l(c,d,b,e,f[g+9],5,568446438);e=l(e,c,d,b,f[g+14],9,-1019803690);b=l(b,e,c,d,f[g+3],14,-187363961);d=l(d,b,e,c,f[g+8],20,1163531501);c=l(c,d,b,e,f[g+13],5,-1444681467);e=l(e,c,d,b,f[g+2],9,-51403784);b=l(b,e,c,d,f[g+7],14,1735328473);d=l(d,b,e,c,f[g+12],20,-1926607734);c=m(c,d,b,e,f[g+5],4,-378558);e=m(e,c,d,b,f[g+8],11,-2022574463);b=m(b,e,c,d,f[g+11],16,1839030562);d=m(d,b,e,c,f[g+14],23,-35309556);c=m(c,d,b,e,f[g+1],4,-1530992060);e=m(e,c,d,b,f[g+4],11,1272893353);b=m(b,e,c,d,f[g+7],16,-155497632);d=m(d,b,e,c,f[g+10],23,-1094730640);c=m(c,d,b,e,f[g+13],4,681279174);e=m(e,c,d,b,f[g+0],11,-358537222);b=m(b,e,c,d,f[g+3],16,-722521979);d=m(d,b,e,c,f[g+6],23,76029189);c=m(c,d,b,e,f[g+9],4,-640364487);e=m(e,c,d,b,f[g+12],11,-421815835);b=m(b,e,c,d,f[g+15],16,530742520);d=m(d,b,e,c,f[g+2],23,-995338651);c=n(c,d,b,e,f[g+0],6,-198630844);e=n(e,c,d,b,f[g+7],10,1126891415);b=n(b,e,c,d,f[g+14],15,-1416354905);d=n(d,b,e,c,f[g+5],21,-57434055);c=n(c,d,b,e,f[g+12],6,1700485571);e=n(e,c,d,b,f[g+3],10,-1894986606);b=n(b,e,c,d,f[g+10],15,-1051523);d=n(d,b,e,c,f[g+1],21,-2054922799);c=n(c,d,b,e,f[g+8],6,1873313359);e=n(e,c,d,b,f[g+15],10,-30611744);b=n(b,e,c,d,f[g+6],15,-1560198380);d=n(d,b,e,c,f[g+13],21,1309151649);c=n(c,d,b,e,f[g+4],6,-145523070);e=n(e,c,d,b,f[g+11],10,-1120210379);b=n(b,e,c,d,f[g+2],15,718787259);d=n(d,b,e,c,f[g+9],21,-343485551);c=h(c,p);d=h(d,q);b=h(b,r);e=h(e,s)}f=[c,d,b,e];c="0123456789abcdef";d="";for(b=0;b<4*f.length;b++)d+=c.charAt(f[b>>2]>>b%4*8+4&15)+c.charAt(f[b>>2]>>b%4*8&15);return d}(p)}
  295. log('脚本开始执行。');
  296. lurl = lurl.substr(0, (lurl + '#').indexOf('#')); // 过滤 # 后面的内容
  297. log(['调试信息如下:', dhost, lurl, $_GET]);
  298. log('脚本版本 [ ' + sVer + ' ] , 如果发现脚本问题请提交到 [ ' + bugRepUrl + ' ] 谢谢。');
  299. // 文本类扩展 :: 删除文本后方指定位数
  300. String.prototype.sub = function (n) {
  301. return this.substr(0, this.length - n);
  302. }
  303. // 空白函数, 适合腾空页面函数。
  304. function eFunc() {}
  305. function tFunc() { return !0 }
  306. function fFunc() { return !1 }
  307. // 网盘地址自动导向 [基于 phpDisk 的网盘]
  308. function chkDU (){
  309. var chk = /\/(file|)(file|view)([\/.-_])/;
  310.  
  311. return chk.test (l.pathname)
  312. // Because location.xx = xx does not pass the refer, so we're going to make a dummy form.
  313. ? $('<form>').attr('action',l.pathname.replace (chk, '/$1down$3')).appendTo(document.body).submit()
  314. : false;
  315. }
  316. // 强制隐藏/显示某些元素
  317. function forceHide (what){ injStyle(what + ' { display: none !important }')}
  318. function forceShow (what){ injStyle(what + ' { display: block !important }')}
  319. // 强制隐藏框架
  320. function forceHideFrames (){ forceHide('iframe, frameset, frame')}
  321. // 清 Cookie
  322. function clearCookie(){var b=new Date,c,e,f,d,g;b.setTime(b.getTime()-864E5);e=document.cookie.split(";");d=document.domain;b=b.toGMTString();if(e)for(g in e)for(f in c=e[g].split("=")[0],c=["",c+"=; expires="+b+"; path=/; domain=."+d+"; ",c+"=; expires="+b+"; path=/; domain="+d+"; ",c+"=; expires="+b+"; domain=."+d+"; ",c+"=; expires="+b+"; domain="+d+"; ",c+"=; expires="+b+"; path=/; ",c+"=; expires="+b+"; "],c)document.cookie=c[f]}
  323. // 移除站外链接
  324. function clearOutsiteLink() {$('a').not('[href*="' + dhost + '/"]').remove()}
  325. // 插入样式表
  326. function injStyle(s) {
  327. var st = cE('style');
  328. st.innerHTML = s;
  329. d.body.appendChild(st);
  330. return st;
  331. }
  332. // DOMContentLoaded
  333. $(function () {
  334. if (showUpdate && sUpdated) {
  335. GM_setValue('ver', sVer);
  336. alert('\
  337. \n感谢您更新脚本 [ CUWCL4C ] 到最新版 [' + sVer + '],\
  338. \n以下为该版本的更新日志:\
  339. \n* 再次被吐槽全局匹配太危险, 改掉… [topics/202767, topics/127655]\
  340. \n* 上次 SongTaste 修正忘写了\
  341. \n* 修正调用 wp-Audio 的音乐直链在火狐下的解析问题..\
  342. \n* 修正火狐下人人电台的直链解析错误…\
  343. \n* 修正千军万马网盘 ABP 检测 [topics/193286]\
  344. \n* 火狐娘你为何难艹 [瞎]\
  345. \n\
  346. \n\
  347. \n** 脚本搬到 GreaseFork 了哦 **\
  348. \n\
  349. \n\
  350. \n如果发现不兼容的情况 (如: 页面错位, 功能失效)\
  351. \n或新功能建议, xx 站点的下载解析\
  352. \n欢迎提交到脚本讨论区 ≧▼≦\
  353. \n最后, 如果您喜欢该脚本还请打个 5 & 收藏, 谢谢~');
  354. }
  355. log('进入 DOMContentLoaded 事件。');
  356. log('域名判断: ' + dhost);
  357. /*
  358. waitUnTil('OnDownloadClick_Simple', function () {
  359. var tLink = arguments[0].getAttribute('thunderhref').substr(10);
  360. var dlLink = Base64.decode(tLink);
  361. dlLink = dlLink.substr(2, dlLink.length - 4);
  362. console.log(dlLink);
  363. return false;
  364. }, true);
  365. */
  366. // HOOK STAGE 1
  367. var continueScript = false;
  368. switch (l.hostname.toLowerCase()) {
  369. case 'yun.baidu.com':
  370. case 'pan.baidu.com':
  371. // 因为度娘知道自己的所谓云管家不能在非 Windows 下运行
  372. // 因此识别器更改为非 Win32 即可绕过云管家提示。
  373. win.navigator.__defineGetter__ ('platform', function () {return 'Cracked by Jixun ^^'});
  374. break;
  375.  
  376. default:
  377. continueScript = true;
  378. }
  379. if (!continueScript) return;
  380.  
  381. setTimeout(function () {
  382. // 域名判断开始
  383. var continueScript = false;
  384. switch (l.hostname.toLowerCase()) {
  385. default:
  386. continueScript = true;
  387. }
  388. if (!continueScript) return;
  389. switch (dhost) {
  390. case 'kxt.fm':
  391. case 'duomi.com':
  392. wordpressAudio();
  393. break;
  394.  
  395. case 'jing.fm':
  396. waitUnTil (function () {
  397. return win.Player.player.jPlayer
  398. }, function () {
  399. log ('jing.fm Loader Start~');
  400. var myDlBox = $('<a>').appendTo($('#mscPlr')).css({
  401. position: 'absolute',
  402. right: 0,
  403. zIndex: 9
  404. }).attr('target', '_blank').text('下载');
  405. win.Player.player.bind(win.$.jPlayer.event.loadstart, function (eve) {
  406. myDlBox.attr('href', eve.jPlayer.status.src.replace(/\d+$/, 0))
  407. });
  408. });
  409. case 'colafile.com':
  410. chkDU ();
  411. forceHide ('.table_right, #down_link2, #down_link3, .tui, .ad1 > .ad1 > *');
  412. forceShow ('.ad1 > .ad1 > .downbox');
  413. break;
  414. // 通用 phpDisk 网盘
  415. case '2kuai.com':
  416. case '32666.com': // <- 乱七八糟广告就属它最多
  417. forceHide ('a[href*="vip"]');
  418. case "bpan.net":
  419. case '360disk.com':
  420. case 'dxrr.com':
  421. /* case "gxp.cc": */
  422. if (chkDU()) return;
  423. $('script,iframe').remove();
  424. forceHide ('.ad,#vcode,#tui,.dcode,#down_box2,#dl_tips');
  425. injStyle ('#down_box,#dl_addr{display:block !important}');
  426. $('#down_link').next().remove();
  427. $('#ct .viewl,.nal,.scbar_hot_td').remove();
  428. //win.update_sec = false;
  429. //(win.down_file_link||eFunc)();
  430. //win.down_process = eFunc;
  431. break;
  432. case 'sudupan.com':
  433. var tU = lurl.replace(/\/dz_/i, '/xzdz_');
  434. if (tU != lurl)
  435. l.href = tU;
  436. clearOutsiteLink();
  437. break;
  438. case 'yinyuetai.com':
  439. // http://www.yinyuetai.com/insite/get-video-info?videoId=[视频ID]&json=true
  440. var fetchDlUrlById = function (iId, fCallback) {
  441. log('Loading video for ' + iId);
  442. // 因为跨域, 所以 =-=
  443. GM_xmlhttpRequest ({
  444. method: 'GET',
  445. url: "http://www.yinyuetai.com/insite/get-video-info?json=true&videoId=" + iId,
  446. onload: function (u) {
  447. var r = JSON.parse (u.responseText);
  448. fCallback(r.videoInfo.coreVideoInfo.videoUrlModels, r.videoInfo.coreVideoInfo.videoName);
  449. },
  450. onerror: function (r) {
  451. fCallback(false);
  452. }
  453. });
  454. };
  455. var $appTo, $ap1After2, $display = '',
  456. eDiv = $('<div>');
  457. function appendDlLinks(dlLinks, videoTitle) {
  458. if (dlLinks === false) {
  459. console.error('解析失败! ID: ', currentVideoId);
  460. return;
  461. }
  462. eDiv.css ({
  463. color: 'white',
  464. 'font-size': 'small',
  465. 'margin-left': '7px'
  466. });
  467. eDiv.html('下载: ').css('display', $display);
  468. dlLinks.forEach(function (e) {
  469. $('<a>').text(e.QualityLevelName).attr('href', e.videoUrl)
  470. .attr('title', '下载: ' + videoTitle).appendTo(eDiv)
  471. .addClass ('c_cf9');
  472. eDiv.append(' | ');
  473. });
  474. eDiv.append('提供: CUWCL4C ' + sVer);
  475. if ($ap1After2 == 1)
  476. $appTo.append (eDiv);
  477. else // 2
  478. $appTo.after (eDiv);
  479. // $('#download').href = dlLink;
  480. }
  481. if (/^\/video/i.test(l.pathname)) {
  482. // Signal
  483. var currentVideoId = parseInt(l.pathname.match(/\d+/)[0]);
  484. $appTo = $('.vchart'); $ap1After2 = 2;
  485. fetchDlUrlById(currentVideoId, appendDlLinks);
  486. } else {
  487. $ap1After2 = 1;
  488. $display = 'inline';
  489. waitUnTil (function () {
  490. return $('.J_mv_content').length;
  491. }, function () {
  492. $('.J_mv_content').on('DOMSubtreeModified', function () { setTimeout (function () {
  493. log ('> Switch');
  494. $appTo = $('<div>').css('display', $display).appendTo('.J_video_info');
  495. fetchDlUrlById(($('.J_video_info a[href*="video/"]').attr('href').match (/\d+(\/|)$/)||[])[0], appendDlLinks);
  496. }, 10)});
  497. });
  498. }
  499. break;
  500. case 'renren.com':
  501. waitUnTil(function () {
  502. return win.XN.APP.WebRadioNotlogin.player.getPlayer();
  503. }, function () {
  504. // 插入播放按钮
  505. var dlLink = $('<a>').attr('title', '单击下载').css(makeRotateCss(90)).css({
  506. 'width': '38px',
  507. 'height': '36px',
  508. 'background-position': '-4px -820px',
  509. 'margin-top': '-2px'
  510. }).attr('href', win.XN.APP.WebRadioNotlogin.player.getPlayer().getAttribute('src'))
  511. .insertBefore($('.operation #lrc'));
  512.  
  513. var oldPlay = win.XN.APP.WebRadioNotlogin.player.play;
  514. win.XN.APP.WebRadioNotlogin.player.play = function (url, f0) {
  515. console.warn(arguments);
  516. var ret = oldPlay.apply(win.XN.APP.WebRadioNotlogin.player, arguments);
  517. dlLink.attr('href', url);
  518. return ret;
  519. }
  520. });
  521. break;
  522. case 'qq.com':
  523. log('Waiting for fmQQ...');
  524. waitUnTil(function () {
  525. return (typeof (win.$.qPlayer.player.playUrl) == 'function')
  526. }, function () {
  527. log('fmQQ Hook start!');
  528. // CreateDLButton
  529. var dlLink = $('<a>').css(makeRotateCss(90)).css({
  530. 'background-position': '-24px -73px'
  531. });
  532. $('.btn_del').after(dlLink);
  533. var firstRun = true;
  534. oldPlayurl = win.$.qPlayer.player.playUrl;
  535. win.$.qPlayer.player.playUrl = function (songUrl) {
  536. dlLink.attr('href', songUrl).attr('title', '单击下载: ' + win.$.qPlayer.playList.getSongInfoObj().msong);
  537. if (firstRun)
  538. return firstRun = 0;
  539. return oldPlayurl(songUrl);
  540. };
  541. win.$.qPlayer.player.playUrl(win.$.qPlayer.playList.getSongInfoObj().songurl);
  542. log('fmQQ Hook finish!');
  543. });
  544. break;
  545. case 'moe.fm':
  546. waitUnTil('playerInitUI', function () {
  547. // 登录破解
  548. win.is_login = true;
  549. log('fmMoe Hook start!!');
  550. var dlLink = $('<a>').addClass('player-button left').css(makeRotateCss(90)).css({
  551. 'width': '26px',
  552. 'background-position': '-19px -96px'
  553. });
  554. $('div.player-button.button-volume').first().after(dlLink);
  555. var oldPlayerInitUI = win.playerInitUI;
  556. win.playerInitUI = function (a) {
  557. dlLink.attr('href', a.completeUrl).attr('title', '单击下载: ' + a.title);
  558. log(a);
  559. return oldPlayerInitUI(a);
  560. };
  561. log('fmMoe Hook finish!!');
  562. });
  563. break;
  564. case "dbank.com":
  565. case "vmall.com":
  566. // 页面整理。
  567. $('#c_footer, #filelist_marker, div.link-left .panel-line, div[id^="ad_"], .panel-recommended, #hotkw, p.copyright-tips').remove();
  568. break;
  569. case "vdisk.cn":
  570. //Weipan-vdisk,wait 10s,code
  571. // US ID: 152764
  572. // 模拟: yanzheng_ok & 清理右下角广告
  573. $('#btnbox').show();
  574. $('#loadingbox, #yanzhengbox, #yzmbox, #ShowDIV, script[src^="http"], ifarme, div[style*="width:728px"][style*="left:50%"], div[style*="height:90px"]').remove();
  575. // 清理乱七八糟的链接
  576. $('a[href^="http"]').not('[href*="vdisk"]').remove();
  577. break;
  578. case "onlinedown.net":
  579. //Huajun,code
  580. // win.CustomDefinedAjaxOnkeyup(2);
  581. $('div#box, div#cover, div.right, div.idczone, div.downbody:eq(1)').remove();
  582. $('div#ft').css('margin-top', '20px');
  583. break;
  584. case "verycd.com":
  585. //VeryCD2-Dianlu
  586. var topicId = (location.href.match(/topics\/([\d]+)/i) || [, 0])[1];
  587. if (!topicId) {
  588. // 检查是否为文件页
  589. if (!/^\/files\//i.test(l.pathname))
  590. return;
  591. var sDlbox = '.topic_dl_notice';
  592. log('verycd file page');
  593. // 收集信息
  594. var sTitle = $('.fileTitle').text(),
  595. iSize = parseInt(l.pathname.substr(39)),
  596. sHash = l.pathname.substr(7, 32);
  597. // 构建新链接
  598. // ed2k://|file|文件名|大小|哈希值|/
  599. var sEd2kLink = jprintf('ed2k://|file|%1|%2|%3|/', encodeURIComponent(sTitle), iSize, sHash);
  600. log(sEd2kLink);
  601. waitUnTil(function () {
  602. return $(sDlbox).length;
  603. }, function () {
  604. $(sDlbox).html('下载: ').append($('<a>').text('' + sTitle).attr('href', sEd2kLink))
  605. });
  606. // 创建元素并插入
  607. // 函数强制返回,防止执行其它函数。
  608. return;
  609. }
  610. function byte2Str(inp) {
  611. var f = parseFloat(inp),
  612. unit = ['字节', 'KB', 'MB', 'GB', 'TB'],
  613. fUnit = 0;
  614. while (f > 1126) {
  615. f /= 1024;
  616. fUnit += 1;
  617. }
  618. return f.toFixed(2).toString() + ' ' + (unit[fUnit] || '未知单位');
  619. }
  620. function ed2kLink(aHref) {
  621. var ed2kArr = aHref.substr(0, aHref.length - 2).substr(13).split('|');
  622. return ({
  623. name: decodeURIComponent(ed2kArr[0]),
  624. size: parseInt(ed2kArr[1]),
  625. sizs: byte2Str(ed2kArr[1]),
  626. hash: ed2kArr[2],
  627. extr: ed2kArr[3]
  628. });
  629. }
  630. function buildTr(aHref) {
  631. var ed2k = ed2kLink(aHref),
  632. tr = cE('tr'),
  633. d1 = cE('td'),
  634. d2 = cE('td'),
  635. tbox = cE('input'),
  636. aLink = cE('a'),
  637. iLink = cE('a');
  638. d1.className = 'post2';
  639. d2.className = 'post2';
  640. tbox.type = 'checkbox';
  641. tbox.className = 'fBoxT';
  642. tbox.value = aHref;
  643. tbox.checked = 'checked';
  644. aLink.textContent = ed2k.name;
  645. aLink.href = aHref;
  646. aLink.style.width = '570px';
  647. aLink.style.paddingLeft = '8px';
  648. // aLink.style.width = '600px';
  649. aLink.style.overflow = 'hidden';
  650. aLink.style.whiteSpace = 'nowrap';
  651. aLink.style.textOverflow = 'ellipsis';
  652. iLink.textContent = '[详]';
  653. iLink.target = '_blank';
  654. iLink.href = '/files/' + ed2k.hash + ed2k.size;
  655. // //www.verycd.com/files/ [HASH] [SIZE]
  656. d2.textContent = ed2k.sizs;
  657. // 合并组件
  658. d1.appendChild(tbox);
  659. d1.appendChild(iLink);
  660. d1.appendChild(aLink);
  661. tr.appendChild(d1);
  662. tr.appendChild(d2);
  663. return tr;
  664. }
  665. var parseVeryCD = function (aLink) {
  666. log(['parseVeryCD', aLink]);
  667. var topDiv = cE('div'),
  668. mainDiv = cE('div'),
  669. bottomTr = cE('tr'),
  670. mainTable = cE('table');
  671. var sAll = cE('input'),
  672. dAll = cE('input'),
  673. sAlabel = cE('label'),
  674. tdBot = cE('td'),
  675. tdSiz = cE('td'),
  676. ePre = cE('pre');
  677. function updateSize() {
  678. var boxes = document.querySelectorAll('.fBoxT'),
  679. tSize = 0,
  680. j = 0;
  681. for (var i = 0; i < boxes.length; i++) {
  682. if (boxes[i].checked)
  683. tSize += ed2kLink(boxes[i].value).size, j++;
  684. }
  685. tdSiz.textContent = byte2Str(tSize);
  686. sAll.checked = (j == i);
  687. }
  688. topDiv.innerHTML = '电驴链接';
  689. topDiv.className = 'emuletop';
  690. mainDiv.className = 'emulemain';
  691. tdSiz.id = 'allExpSize';
  692. tdSiz.className = 'emulesize post';
  693. tdSiz.style.background = 'inherit';
  694. mainTable.setAttribute('cellpadding', '2');
  695. mainTable.setAttribute('cellspacing', '1');
  696. mainTable.setAttribute('width', '100%');
  697. // 全选
  698. sAll.id = 'sAll';
  699. sAll.checked = true;
  700. sAll.className = 'sAll';
  701. sAll.type = 'checkbox';
  702. sAlabel.setAttribute('for', 'sAll');
  703. sAlabel.textContent = '全选';
  704. sAll.addEventListener('click', function () {
  705. var boxes = document.querySelectorAll('.fBoxT');
  706. for (var i = 0; i < boxes.length; i++) {
  707. boxes[i].checked = this.checked;
  708. }
  709. updateSize();
  710. }, false);
  711. // 导出链接
  712. dAll.type = 'button';
  713. dAll.value = '导出所选链接';
  714. dAll.className = 'button downall';
  715. dAll.style.marginLeft = '10px';
  716. dAll.addEventListener('click', function () {
  717. ePre.innerHTML = '';
  718. var boxes = document.querySelectorAll('.fBoxT');
  719. for (var i = 0; i < boxes.length; i++) {
  720. if (boxes[i].checked)
  721. ePre.textContent += boxes[i].value + '\n';
  722. }
  723. // 高亮选中文本
  724. var selection = unsafeWindow.getSelection();
  725. var range = document.createRange();
  726. range.selectNodeContents(ePre);
  727. selection.removeAllRanges();
  728. selection.addRange(range);
  729. }, false);
  730. // 导出链接输出用样式表
  731. ePre.style.whiteSpace = 'pre-wrap';
  732. ePre.style.wordBreak = 'break-all';
  733. bottomTr.appendChild(sAll);
  734. bottomTr.appendChild(sAlabel);
  735. bottomTr.appendChild(dAll);
  736. bottomTr.appendChild(tdSiz);
  737. for (var i = 0; i < aLink.length; i++) {
  738. mainTable.appendChild(buildTr(aLink[i]));
  739. }
  740. // 文件选择事件
  741. mainDiv.addEventListener('click', function (e) {
  742. if (e.target.className == 'fBoxT')
  743. updateSize();
  744. }, false);
  745. mainTable.appendChild(bottomTr);
  746. mainDiv.appendChild(mainTable);
  747. //var iptInt = setInterval (function () {
  748. var dlDiv = document.querySelector('#iptcomED2K');
  749. //if (!dlDiv)
  750. // return;
  751. //clearInterval (iptInt);
  752. dlDiv.innerHTML = '';
  753. dlDiv.appendChild(topDiv);
  754. dlDiv.appendChild(mainDiv);
  755. dlDiv.appendChild(ePre);
  756. updateSize();
  757. /*$('<style>').html('[class^="downloadCounter_"],[class^="downloadCounter_"] { display: none !important; }')
  758. .appendTo ($('body'));
  759. */
  760. //}, 100);
  761. };
  762. log('requesting page...');
  763. var parseStage1 = function (r) {
  764. var aLinks = parseHTML(r.responseText).querySelectorAll('a[href*="/detail.htm?id="]');
  765. var aHrefs = [],
  766. lStat = [],
  767. finalEd2k = [];
  768. var checkIfReady = function () {
  769. if (lStat.join('').indexOf('0') == -1)
  770. parseVeryCD(finalEd2k);
  771. };
  772. var parseStage2 = function (id) {
  773. var _arrId = id;
  774. log('req Start : ' + _arrId);
  775. GM_xmlhttpRequest({
  776. url: aHrefs[i],
  777. method: 'GET',
  778. onload: function (r) {
  779. log('req Finish: ' + _arrId);
  780. finalEd2k[_arrId] = parseHTML(r.responseText).querySelector('a[href^="ed2k://"]').href;
  781. lStat[_arrId] = 1;
  782. checkIfReady();
  783. },
  784. synchronous: true,
  785. });
  786. }
  787. for (var i = 0; i < aLinks.length; i++) {
  788. aHrefs.push(aLinks[i].href);
  789. lStat.push('0');
  790. finalEd2k.push('');
  791. parseStage2(i);
  792. }
  793. };
  794. var sNewAddr = 'http://www.icili.com/emule/download/' + topicId;
  795. GM_xmlhttpRequest({
  796. url: sNewAddr,
  797. method: 'GET',
  798. onload: function (r) {
  799. log(parseHTML(r.responseText));
  800. var aLink = [],
  801. arrLinks = parseHTML(r.responseText).querySelectorAll('a[href^="ed2k://"]');
  802. for (var i = 0; i < arrLinks.length; i++)
  803. aLink.push(arrLinks[i].href);
  804. parseVeryCD(aLink);
  805. }
  806. });
  807. break;
  808. case 'sufile.com':
  809. case "yunfile.com":
  810. log ('没精力更新这些网盘了,以下代码仅供参考。');
  811. chkDU();
  812. break;
  813. //YunFile;Wait 30,No-Ad,Timeout
  814. var wS = $('#down_interval_tag'),
  815. $vcode = $('#vcode'),
  816. $tip = $('<span>').text('请输入验证码,输入后自动跳转…').css({
  817. 'color': 'red',
  818. 'display': 'block'
  819. });
  820. $('h2.title').append($tip);
  821. var bVarCode = ($('img[src="/verifyimg/getPcv.html"]').length > 0);
  822. if (win.redirectDownPage && bVarCode) {
  823. // 验证码页面
  824. $('#inputDownWait *').hide();
  825. $('#inputDownWait').append(
  826. createNumPad(4, $vcode[0], function () {
  827. var time2Wait = wS.length ? parseInt(wS.text()) * 60000 : 1,
  828. arg = arguments;
  829. log('set time2Wait: ' + time2Wait);
  830. setTimeout(function () {
  831. log(arguments);
  832. var targetLink = $('#downpage_link').attr('href').replace('.html', '/' + arg[0] + '.html');
  833. log('set targetLink: ' + targetLink);
  834. l.href = targetLink;
  835. }, time2Wait); // 自动排队
  836. $tip.text('正在自动排队,排队完毕后自动跳转…').css({
  837. 'border': 'red 2px dashed',
  838. 'padding': '10px'
  839. });
  840. var t = $vcode;
  841. while (t.prop("tagName").toLowerCase() != 'table')
  842. t = t.parent();
  843. t.hide();
  844. })
  845. );
  846. } else if (win.redirectDownPage) {
  847. // 无验证码
  848. $tip.text('正在自动排队,排队完毕后自动跳转…');
  849. setTimeout(function () {
  850. (win.redirectDownPage || eFunc)();
  851. win.doDownload = tFunc; // 停用 40s 超时
  852. win.setcode();
  853. win.downSubmit();
  854. }, wS.length ? parseInt(wS.text()) * 60000 : 1); // 自动排队
  855. } else {
  856. waitUnTil('doDownload', function () {
  857. win.setcode();
  858. win.downSubmit();
  859. }, tFunc);
  860. }
  861. break;
  862. case "qjwm.com":
  863. case "7958.com":
  864. if (l.href.toLowerCase().indexOf("down_") > 0) l.href = lurl.replace(/down_/i, 'download_');
  865. $('.YXM-bg, #foot, #weizhi, .fenxiang, table, div#top, #my_yzm, #inputyzm, .clear, .m1.fr, a[href$="money.html"], a[href$="reg.html"]').remove();
  866. log('等待加载完毕…');
  867. forceShow('#downtc2');
  868. forceHide('#downtc,[id^="cpro_"]');
  869. waitUnTil('authad', function () {
  870. win.authad = win.bdshow = tFunc;
  871. });
  872. break;
  873. case "rayfile.com":
  874. //Feisu-Rayfile,nextpag,showdown
  875. if (win.vkey) {
  876. l.href = lurl + win.vkey;
  877. } else {
  878. win.filesize = 100;
  879. win.showDownload();
  880. win.showDownload = eFunc; // 防止 7 秒后按钮被覆盖。
  881. // 天知道这个错误怎么来的.. 语言错误就显示不了下载按钮..
  882. $('#downloadlink').addClass('btn_downNow_zh-cn');
  883. $('#vodlink').addClass('btn_downTools_zh-cn');
  884. // 整理页面
  885. $('div.left, iframe').remove();
  886. };
  887. break;
  888. case "songtaste.com":
  889. // SongTaste,Source-Code by (inc/common.js)
  890. // By Yulei 2012.11.30 ;Remove register and login tips.
  891. // Simplify Code + Simulate Official site action + Chrome Fix.
  892. var cssCode = {
  893. 'font-size': '15px',
  894. 'color': '#fff',
  895. 'background-color': '#000',
  896. 'text-decoration': 'none',
  897. 'padding': '3px 5px'
  898. };
  899. var sId = $_GET['song_id'] || (function () {
  900. if (lurl.toLowerCase().indexOf('/album/') != -1) {
  901. // 专辑页面功能添加
  902. log('ST :: 专辑页面调整');
  903. var btn_playAll = $('[value="连续播放"]');
  904. var btn_noPopPlay = btn_playAll.clone().attr({
  905. 'value': '不弹窗播放',
  906. 'onclick': ''
  907. });
  908. btn_noPopPlay.click(function () {
  909. var id = "",
  910. arr = win.chkArray;
  911. for (i = 0; i < arr.length; i++) {
  912. if (arr[i].checked) {
  913. id += arr[i].value + ",";
  914. }
  915. }
  916. if (id.length > 1) {
  917. id = id.sub(1);
  918. l.href = "/playmusic.php?song_id=" + id;
  919. } else {
  920. alert("请选择歌曲");
  921. }
  922. });
  923. btn_playAll.after(btn_noPopPlay);
  924. return;
  925. }
  926. log('ST :: 单曲模式解析');
  927. var Args = $("#playicon a")[0].href.replace(/ /g).replace(/\"/g, "'").split('\'');
  928. var sURL = Args[5],
  929. sType = Args[11],
  930. sHead = Args[13],
  931. sId = Args[15],
  932. sTime = ((new RegExp(/,(\d+)\)/).exec(Args[16]) || [, '0'])[1]);
  933. if (sURL.indexOf('rayfile') > 0) {
  934. var SongUrl = sHead + sURL + win.GetSongType(sType);
  935. } else {
  936. SongUrl = $.ajax({
  937. type: 'POST',
  938. url: '/time.php',
  939. cache: true,
  940. /* 从缓存读,反正如果没记录可以跑到 ST 服务器下 */
  941. async: false,
  942. data: 'str=' + sURL + '&sid=' + sId + '&t=' + sTime,
  943. dataType: 'html',
  944. }).responseText;
  945. }
  946. $('a#custom_2').attr({
  947. 'href': SongUrl,
  948. 'title': 'Cracked By jixun66'
  949. }).css(cssCode).text('音乐直链');
  950. return false;
  951. })();
  952. if (sId) {
  953. // 下载解析 - Hook 更换歌曲的函数,避免重复读取歌曲 + 不需要多次请求服务器不容易掉线。
  954. log('ST :: 列表模式解析');
  955. win.changeSong_e = win.changeSong;
  956. win.changeSong = function (a1, a2, a3) {
  957. // 2013.03.19 & 2013.04.09 修正:
  958. // 已经删除的歌曲自动跳到下一曲
  959. if (a1.trim() == '') {
  960. win.pu.doPlayNext(2);
  961. return;
  962. }
  963. log('请求歌曲 :: ' + a1 + ' :: ' + a2);
  964. $('#dl_Link').attr({
  965. 'href': a2,
  966. 'title': a1
  967. });
  968. document.title = 'ST - ' + a1;
  969. // 转接给原函数
  970. win.changeSong_e(a1, a2, a3);
  971. };
  972. win.downSong = function () {
  973. win.open(win.theSongUrl);
  974. };
  975. $('div#left_music_div div.p_fun a:eq(2)').css(cssCode)
  976. .text('直链下载').attr({
  977. 'id': 'dl_Link',
  978. 'target': '_blank'
  979. });
  980. // 2013.03.19 添加:
  981. // 重建播放列表地址
  982. $('p.p_list_txt').append($('<a>').text('重建播放列表').click(function () {
  983. l.href = '?song_id=' + win.arr_ids.join(',');
  984. }).css({
  985. 'cursor': 'pointer'
  986. }));
  987. log('ST :: 等待网页加载...');
  988. var iNv = setInterval(function () {
  989. if (!win.pu.doPlayNext) {
  990. return;
  991. }
  992. log('ST :: 官方播放器删除功能修正启动');
  993. // 修正播放器删除代码错误 :: 开始
  994. win.pu.doPlayNext = function (t) {
  995. for (var i = 0; i < win.arr_ids.length; i++) {
  996. if (win.arr_ids[i] == win.cur_sid) {
  997. var now = i;
  998. break;
  999. }
  1000. }
  1001. // 寻找下一首未删除的歌曲。
  1002. // * 2013.01.29 修正
  1003. // 1. 上一首查找失败的情况下会滚回到当前音乐的错误。
  1004. // 2. 如果没有可听歌曲情况下无限循环的错误。
  1005. var now = Math.abs((now || 0) + t),
  1006. avl = 0;
  1007. // 检查是否有歌曲剩余
  1008. for (var i = 0; i < win.arr_ids.length; i++) {
  1009. if (win.arr_ids[i]) {
  1010. avl++;
  1011. }
  1012. }
  1013. if (avl == 0) {
  1014. alert('歌都被删光了还听啥...');
  1015. return;
  1016. }
  1017. // 寻找空位
  1018. while (true) {
  1019. if (win.arr_ids[now]) {
  1020. log('切换歌曲 :: ' + now.toString());
  1021. win.pu.utils(now);
  1022. win.cur_sid = win.arr_ids[now];
  1023. win.playSongRight();
  1024. return;
  1025. }
  1026. now += t >= 0 ? 1 : -1;
  1027. if (win.arr_ids.length <= now) {
  1028. now = 0;
  1029. }
  1030. if (now < 0) {
  1031. now = win.arr_ids.length;
  1032. }
  1033. }
  1034. }
  1035. win.delSongDiv = function (songid, isbox) {
  1036. log('删除歌曲 :: ' + songid.toString());
  1037. $('#' + songid).hide();
  1038. var new_songlist = [];
  1039. for (var i = 0; i < win.arr_ids.length; i++) {
  1040. if (win.arr_ids[i] == songid) {
  1041. if (songid == win.cur_sid)
  1042. win.pu.doPlayNext(1);
  1043. win.arr_ids[i] = 0;
  1044. }
  1045. }
  1046. }
  1047. // 修正播放器删除代码错误 :: 结束
  1048. log('ST :: 官方播放器删除功能修正结束');
  1049. clearInterval(iNv);
  1050. }, 100);
  1051. }
  1052. break;
  1053. case "5sing.com":
  1054. //By Yulei 2012.11.27
  1055. // Easy way of getting the link url: by jixun
  1056. if (l.href.toLowerCase().indexOf("down") > 0) {
  1057. if (window.confirm('单击确定返回到歌曲信息目录解析下载地址。')) {
  1058. var urls = lurl.replace(/down\.aspx\?sid\=/i, '');
  1059. l.href = urls + ".html";
  1060. }
  1061. break;
  1062. }
  1063. if (l.hostname == 'fm.5sing.com') {
  1064. // 晚点再搞播放列表那的下载按钮。
  1065. // 刚开始加载的网页执行太快了,Hook 慢了点,所以把 _down 也 Hook 过来。
  1066. waitUnTil ('getPlayInfo', function () {
  1067. var getPlayInfo_e = win.getPlayInfo;
  1068. win.getPlayInfo = function (a1, a2) {
  1069. var sUrl = win.wsplayer.playList[win.wsplayer.playIndex].mp3;
  1070. log('5sing :: 歌曲解析 :: ' + a2.songname + ' :: ' + sUrl);
  1071. $('#playerbox .action_btn a.jp-download').attr({
  1072. 'href': sUrl,
  1073. 'target': '_blank',
  1074. 'title': '下载 ' + a2.songname,
  1075. 'onclick': 0
  1076. });
  1077. return getPlayInfo_e (a1, a2);
  1078. }
  1079. $('span.action_shop a.download').each(function(i){
  1080. this.href = win.wsplayer.playList[i].file;
  1081. });
  1082. });
  1083. win._down = function () {
  1084. win.open(win.wsplayer.playList[win.wsplayer.playIndex].mp3);
  1085. }
  1086. } else {
  1087. waitUnTil (function () {return win.wplayer.playList[0].file;}, function () {
  1088. $('a[href^="/down/"]').attr({
  1089. 'href': win.wplayer.playList[0].file,
  1090. 'target': '_blank',
  1091. 'title': 'Cracked By jixun66'
  1092. }).html('<b/>直链下载')
  1093. });
  1094. }
  1095. break;
  1096. case "it168.com":
  1097. //ReAD,Vcode,By Yulei 2012.12.17
  1098. win.callid = 'Jixun';
  1099. jQuery(".right_four").remove();
  1100. var dl = $("#download");
  1101. dl.html('<a href="javascript:func1();" class="sign11" style="color:greenyellow" ' + 'title="点击下载(^__^) Cracked By Yulei">&nbsp;&nbsp;' + dl.html() + "</a>");
  1102. break;
  1103. case '119g.com':
  1104. var reg = /^(\/f\/[a-z0-9]+)(_bak|)/i;
  1105. if (!reg.test(location.pathname))
  1106. return;
  1107. var mat = location.pathname.match(reg) || [, '', ''];
  1108. if (!mat[2])
  1109. location.pathname = mat[1] + '_bak.html';
  1110. break;
  1111. case "yimuhe.com":
  1112. // yimuhe ,Vcode,8s,By Yulei 2012.12.26
  1113. // Make it easy by jixun66
  1114. // /n_dd.php?file_id=476136&userlogin=niuge&ser=1
  1115. chkDU();
  1116. $('#download').show();
  1117. $('#loading, #yzm, .disk_downg, .guanggao, .disk_l, div.yzmq, div[style*="height:90px"]').remove();
  1118. $('.disk_down').css({
  1119. 'float': 'left'
  1120. });
  1121. if (location.pathname != "/filedown.php") {
  1122. var aLink = $('a img[src="n_images/ico_c.gif"], a img[src="n_images/ico_b.gif"]').parent();
  1123. win.down_file = function () {
  1124. var rep = $.ajax({
  1125. type: 'GET',
  1126. url: jprintf('/n_dd.php?file_id=$1&ser=$2', arguments[0], arguments[4] || '1'),
  1127. cache: true,
  1128. /* 从缓存读,反正如果没记录可以跑到服务器下 */
  1129. async: false,
  1130. dataType: 'html',
  1131. }).responseText;
  1132. var rL = parseHTML(rep).querySelector('a#downs').href;
  1133. log('一禾木 :: ' + rL);
  1134. aLink.attr({
  1135. 'href': rL,
  1136. 'onclick': ''
  1137. });
  1138. }
  1139. aLink.click();
  1140. } else {
  1141. win.down_file = function (fId, a2, sKey, sFn, iSid, sType, a7, a8, a9) {
  1142. var rL = jprintf('//down$1.yimuhe.com/downfile/$2.$3?key=$4&type=$5', a9, sKey, sFn, iSid, a7)
  1143. log('一禾木 :: ' + rL);
  1144. l.href = rL;
  1145. }
  1146. }
  1147. break;
  1148. case "xunzai.com":
  1149. $('div#search, div.viewl, div.module.cl').remove();
  1150. $('div.qutuBox').parent().remove();
  1151. $('img').parent().parent().remove();
  1152. break;
  1153. case "djkk.com":
  1154. // 参考 Music liker for Beauty 代码,感谢 @yulei
  1155. var pl4 = document.getElementsByClassName('play_4')[0],
  1156. rmp3 = win.list[0].m4a.replace(/mp\./, 'do.').replace(/m4a/g, 'mp3'),
  1157. myStyle = 'background: transparent url("/images/p_down.gif") no-repeat left center; height:15px; width:15px;';
  1158. if (/img/g.test(pl4.innerHTML)) {
  1159. pl4.innerHTML = "<a href='" + win.list[0].m4a + "' style='color:blueviolet' target='_blank' title='试听音乐下载 - Cracked By Yulei'><b style='" + myStyle + "'> </b>普通</a>";
  1160. pl4.innerHTML += "<a href='" + rmp3 + "' title='高品质音乐下载 - Cracked By Yulei' target='_blank'><b style='" + myStyle + "'> </b>高清</a>";
  1161. pl4.style.width = "82px";
  1162. document.getElementsByClassName('play_2')[0].style.display = "none";
  1163. }
  1164. break;
  1165. case 'kuaipan.cn':
  1166. // 新版更新:
  1167. waitUnTil('CONST', function () {
  1168. win.CONST.Token = 'Cracked By Jixun ^^';
  1169. });
  1170. /*
  1171. // 金山快盘免登录下载解析
  1172. $('#jQrcodeDownload')
  1173. .attr ('class', 'imitate-btn f16 btn-blue l')
  1174. .text('免登录下载');
  1175. $('#jQrcodebox').html ('免登录下载已开始,请等待下载提示...');
  1176. $('#qrcode').remove();
  1177. $('<div id="qrcode">').appendTo (body);
  1178. win.encodeURIComponent_e = win.encodeURIComponent;
  1179. win.encodeURIComponent = function (a1) {
  1180. if (a1.toString().indexOf('/getdl?') >= 0) { l.href = a1.toString(); return false; }
  1181. return win.encodeURIComponent_e (a1);}
  1182. */
  1183. break;
  1184. case 'howfile.com':
  1185. forceHide ('#floatdiv div');
  1186. injStyle ('#floatdiv {top: 150px; z-index: 99999; display: block !important;}');
  1187. $('iframe,script,.row1_right').remove();
  1188. break;
  1189. case '51gugu.com':
  1190. $('#pwd_input_box').remove();
  1191. waitUnTil('GetUrl', function () {
  1192. $('.fileinfo').append($('<a>').attr('href', 'javascript:void(0);').click(function () {
  1193. l.href = win.GetUrl(win.root_dirid)
  1194. }));
  1195. });
  1196. break;
  1197. case "fileim.com":
  1198. /* // 没精力更新了w 请自行改用原版
  1199. // 取消绑定原定事件后绑定自己的事件
  1200. // P.S. jQuery 的取消绑定事件不好用..
  1201. var fD = '#freedown';
  1202. ubA($(fD)[0]);
  1203.  
  1204. // 因为重新绑定了事件,也就是重写了一次代码,因此需要刷新一次查询处理。
  1205. $(fD).bind('click', function () {
  1206. l.href = jPrintf("http://69.197.155.141:7001/download.ashx?a=0,$1,0", win.download.fileOnlyCode);
  1207. }).attr({
  1208. 'value': '下载文件'
  1209. });
  1210. */
  1211. break;
  1212. case "everbox.com":
  1213. // 页面调整
  1214. $('.report, #footer, #sharecopy, #sidebar').hide();
  1215. $('h3#linkTitle').css({
  1216. 'overflow': 'hidden',
  1217. 'text-overflow': 'ellipsis'
  1218. });
  1219. $('#wrapper').css({
  1220. 'width': '100%'
  1221. });
  1222. function eveBox(r) {
  1223. var code = r.code;
  1224. if (code == 200) {
  1225. l.href = r.data.dataurl;
  1226. } else if (code == 412) {
  1227. win.everbox.notice({
  1228. "msg": '匿名下载已达上限, 脚本无力回天',
  1229. "autoHide": false,
  1230. "msgType": "error"
  1231. });
  1232. } else {
  1233. win.everbox.notice({
  1234. "msg": '无法识别的错误码 ' + code + ', 请报告于<a href="' + bugRepUrl + '" target="_blank">此处</a>, 谢谢.',
  1235. "autoHide": false,
  1236. "msgType": "error"
  1237. });
  1238. }
  1239. }
  1240. // 免插件下载解析
  1241. ubA($("#download_button")[0]);
  1242. $("#download_button").bind("click", function () {
  1243. var postData = {};
  1244. postData[win.everbox.csrfKey] = win.everbox.csrfVal;
  1245. $.ajax({
  1246. type: "POST",
  1247. url: "/f/download/" + win.linkid,
  1248. data: postData,
  1249. dataType: "json",
  1250. success: eveBox
  1251. });
  1252. });
  1253. break;
  1254. case '79pan.com':
  1255. chkDU();
  1256. $('iframe, #code_box, #down_box2').remove();
  1257. $('#down_box').show();
  1258. break;
  1259. case "supan.la":
  1260. win.update_sec = eFunc;
  1261. win.down_file_link();
  1262. win.down_file_link = eFunc;
  1263. $('.file_item').css('height', 'auto');
  1264. break;
  1265. case "87pan.com":
  1266. chkDU();
  1267. $('script,.view-gg,#view-gg').remove();
  1268. break;
  1269. case "azpan.com":
  1270. chkDU();
  1271. document.onkeydown = eFunc;
  1272. $('script, iframe').remove();
  1273. forceHide ('a[id*="Union"]');
  1274. break;
  1275. case "dd.ma":
  1276. var aLink = $('#btn_open a.link1').attr('href');
  1277. if (!aLink)
  1278. break;
  1279. l.href = aLink;
  1280. break;
  1281. case '9pan.net':
  1282. l.href = '/down-' + l.pathname.match(/\d+/) + '.html';
  1283. break;
  1284. case 'xddisk.com':
  1285. case 'nyhx.com':
  1286. chkDU();
  1287. break;
  1288. case '9ku.com':
  1289. $('#play_musicname').bind('DOMSubtreeModified', function () {
  1290. $('.ringDown').hide().next().find('a:last').removeAttr('onclick')
  1291. .attr('href', win.firstplay).css({
  1292. 'font-weight': 'bold'
  1293. });
  1294. }).find('a').attr('active', '1');
  1295. forceHide ('#LR2,#LR3,#seegc');
  1296. break;
  1297. case '565656.com':
  1298. $('#down_ring').bind('DOMSubtreeModified', function () {
  1299. var _addMp3Link = function (song, $dlBut) {
  1300. $.ajax({
  1301. type: "GET",
  1302. cache: true,
  1303. url: "/plus/UrlSearch.ashx",
  1304. data: {
  1305. n: song.songname,
  1306. s: song.singername
  1307. },
  1308. dataType: "json",
  1309. success: function (data) {
  1310. $dlBut.text('MP3 格式')
  1311. .attr('title', '下载 MP3 版: ' + song.songname)
  1312. .attr('href', data[0]);
  1313. // TODO: AddLink (data[0]);
  1314. }
  1315. });
  1316. };
  1317. var _getUrl = function (url) {
  1318. if (url.toLowerCase().indexOf("http://") >= 0) {
  1319. return url;
  1320. } else if (url.toLowerCase().indexOf(".m4a") >= 0) {
  1321. return win.listen_server_mp4 + url;
  1322. } else {
  1323. return win.listen_server + url;
  1324. }
  1325. };
  1326. var song = win.splayer.musicinfo();
  1327. setTimeout(function () {
  1328. song.url = song.url.replace(/mp3$/i, '$1m4a').replace(/^\//, '');
  1329. var $dlBut = $('.play-info-otheropt a:last').prev()
  1330. .text('下载: ' + song.songname)
  1331. .attr('title', '下载: ' + song.songname)
  1332. .attr('href', _getUrl(song.url)).next();
  1333. _addMp3Link(song, $dlBut);
  1334. }, 500);
  1335. });
  1336. break;
  1337. case 'djye.com':
  1338. $('#djInfo').bind('DOMSubtreeModified', function () {
  1339. var a = $('a[href^="/down.html"]').attr('href', win.firstplay);
  1340. a.attr('title', '下载: ' + $('#play_musicname').text()).css({
  1341. 'background': 'url(/images/mp3_down.gif)',
  1342. 'padding': '3px 0 5px 9px'
  1343. }).find('img').remove();
  1344. a.clone().css({
  1345. 'background-position': '-184px',
  1346. 'padding': '3px 0 5px 34px'
  1347. }).insertAfter(a);
  1348. log($('a[title^="下载:"]'));
  1349. });
  1350. break;
  1351. case 'djcc.com':
  1352. var a = $('#formusicbox'),
  1353. b = a.clone().insertAfter(a);
  1354. a.parent().animate({
  1355. 'height': '+=27'
  1356. }, 1000);
  1357. b.removeAttr('onclick').text('下载该曲').css({
  1358. 'background-color': 'lightgrey'
  1359. });
  1360. $('.playbox .playstate').bind('DOMSubtreeModified', function () {
  1361. var song = win.jwplayer(win._$[16]).getPlaylistItem();
  1362. b.attr('title', '下载: ' + song.title).attr('href', song.file);
  1363. });
  1364. // Ad.Kill
  1365. $('.left').animate({
  1366. 'width': '0'
  1367. }, 1000, function () {
  1368. $(this).remove();
  1369. });
  1370. $('.left').animate({
  1371. 'width': '0'
  1372. }, 1000, function () {
  1373. $(this).remove();
  1374. });
  1375. $('.center').css({
  1376. 'margin-top': '12px',
  1377. 'margin-left': '240px'
  1378. });
  1379. $('.p3').css('background', 'none');
  1380. $('.right').animate({
  1381. 'width': '0',
  1382. 'left': '310'
  1383. }, 1000, function () {
  1384. $(this).remove();
  1385. });
  1386. $('[class*="banner"]').remove();
  1387. $('#playlistads').remove();
  1388. break;
  1389. case 'ref.so':
  1390. safeJump($('#btn_open a').attr('href'));
  1391. break;
  1392. case 'upan.so':
  1393. var selector = 'img[src*="liulan.jpg"]';
  1394. waitUnTil(function () {
  1395. return $(selector).length;
  1396. }, function () {
  1397. safeJump($(selector).parent().attr('href'));
  1398. });
  1399. break;
  1400. case 'dc2.us':
  1401. case 't00y.com':
  1402. var selector = '#skip_button, #downloadlist a';
  1403. waitUnTil(function () {
  1404. return $(selector).length;
  1405. }, function () {
  1406. $('iframe, embed, object').remove();
  1407. forceHideFrames();
  1408. clearCookie();
  1409. if (!safeJump($(selector).attr('href')) && win.jumpToURL)
  1410. win.jumpToURL();
  1411. });
  1412. break;
  1413. case 'csdn.net':
  1414. // 参考代码 CSDN 免登录, UsoId: 165091
  1415. var downloadId = parseInt((location.href.match(/\/(\d+)/) || [, ''])[1])
  1416. /*,
  1417. dlPoint = parseInt(($('.info li:eq(2)').html().match(/\d/)||[0])[0])*/
  1418. ;
  1419. // 检查是否为正确页面//以及下载是否需要积分
  1420. if (!downloadId /* || !dlPoint*/ )
  1421. return;
  1422. $.ajax({
  1423. url: "/index.php/rest/source/getsourceinfo/" + downloadId
  1424. }).fail(function () {
  1425. $('.vip').append('免积分下载失败!');
  1426. }).done(function (data) {
  1427. var $vip = $('.vip'),
  1428. $a = $vip.find('a:first'),
  1429. arrProp = JSON.parse(data);
  1430. if (!arrProp.url) {
  1431. $vip.append('免积分下载失败!');
  1432. return;
  1433. }
  1434. $vip.css({
  1435. 'margin-bottom': '40px'
  1436. });
  1437. $a.html('').attr('href', arrProp.url).css({
  1438. 'background': 'url(/images/btn_down_vip.png) no-repeat',
  1439. 'padding': '0 100px 40px 0'
  1440. }).attr('title', '单击免积分下载');
  1441. $a.clone().css({
  1442. 'padding-right': '153px',
  1443. 'background-position-x': '-145px'
  1444. }).insertAfter($a);
  1445. $a.clone().css({
  1446. 'padding-right': '46px',
  1447. 'background-position-x': '-6px'
  1448. }).insertAfter($a);
  1449. });
  1450. /*
  1451. var sDlAddr = 'http://www.poboke.com/wp-content/themes/QQ/csdnformac.php?token='
  1452. + hex_md5(hex_md5('sunofbeach' + downloadId)) + '&id=' + downloadId;
  1453. GM_xmlhttpRequest({
  1454. method: "GET",
  1455. url: sDlAddr,
  1456. onload: function(r) {
  1457. var $vip = $('.vip'),
  1458. $a = $vip.find('a:first');
  1459. if (!/http/.test(r.responseText)) {
  1460. $vip.append('免积分下载失败!');
  1461. return;
  1462. }
  1463. $vip.css({
  1464. 'margin-bottom': '40px'
  1465. });
  1466. $a.html('').attr('href', r.responseText).css({
  1467. 'background': 'url(/images/btn_down_vip.png) no-repeat',
  1468. 'padding': '0 100px 40px 0'
  1469. }).attr('title', '单击免积分下载');
  1470. $a.clone().css({
  1471. 'padding-right': '153px',
  1472. 'background-position-x': '-145px'
  1473. }).insertAfter($a);
  1474. $a.clone().css({
  1475. 'padding-right': '46px',
  1476. 'background-position-x': '-6px'
  1477. }).insertAfter($a);
  1478. }
  1479. });
  1480. */
  1481. break;
  1482. default:
  1483. // log ('该域名未获得匹配,请联系作者修正该问题!');
  1484. // Do nothing.
  1485. }
  1486. }, 1);
  1487. });
  1488. document.addEventListener('readystatechange', function () {
  1489. console.log('readystatechange: ' + document.readyState);
  1490. if (document.readyState != 'complete')
  1491. return;
  1492. log('网页已完整加载。');
  1493. switch (dhost) {
  1494. case "87pan.com":
  1495. case "bpan.net":
  1496. $('script,.view-gg,#view-gg').remove();
  1497. break;
  1498. case 'duole.com':
  1499. var a = $('#player_right .last'),
  1500. b = a.clone();
  1501. $('#player_right').animate({
  1502. 'width': '+=32'
  1503. }, 500);
  1504. $('a.music_info').css({
  1505. 'cursor': 'text'
  1506. }).bind('DOMAttrModified', function () {
  1507. if (this.hasAttribute('href'))
  1508. this.removeAttribute('href');
  1509. });
  1510. b.insertBefore(a.prev()).removeClass('last').css({
  1511. 'width': '0',
  1512. 'display': 'inline',
  1513. 'background-position': '-150px -104px'
  1514. }).css(makeRotateCss(90)).animate({
  1515. 'width': '+=32'
  1516. }, 500).attr('target', '_blank');
  1517. var oldPlayNew = win.duolePlayer.playNew;
  1518. win.duolePlayer.playNew = function (t, n) {
  1519. b.attr('href', t).attr('title', '单击下载: ' + this.curMusic.song_name);
  1520. return oldPlayNew(t, n);
  1521. };
  1522. break;
  1523. case '1ting.com':
  1524. log('1ting 解析启动 :: ' + '等待播放器加载');
  1525. waitUnTil('yiting', function () {
  1526. log('1ting 解析启动 :: ' + '播放器加载完毕,开始函数绑定…');
  1527. var getCurrentSongLink = function () {
  1528. return win.yiting.player.entity.Source;
  1529. }
  1530. // 防止下方函数绑定失效
  1531. win.$YV.down = function () {
  1532. l.href = getCurrentSongLink();
  1533. }
  1534. win.yiting.player.hook('play', function () {
  1535. $('.songact a.down').attr('href', getCurrentSongLink())
  1536. .removeAttr('onclick').css('border', '1px lightgrey dashed');
  1537. });
  1538. // 启动时强制刷新下载地址
  1539. win.yiting.player.hook('play');
  1540. log('1ting 解析启动 :: ' + '绑定完毕,单击原始下载按钮即可下载。');
  1541. });
  1542. break;
  1543. case "ctdisk.com":
  1544. case "pipipan.com":
  1545. case "400gb.com":
  1546. case "bego.cc":
  1547. log('开始执行 城通 旗下网盘系列简化验证码。');
  1548. setTimeout (function () {
  1549. win.chkform = tFunc;
  1550. $('.kk_xshow').remove();
  1551. forceHide ('div.span6:first-child');
  1552. $('.captcha').hide('slow');
  1553. $('.captcha_right').css('float', 'left');
  1554. $('#vfcode:first').parent()
  1555. .append(createNumPad(4, $('#randcode')[0], function () {
  1556. $('[name="user_form"]').submit();
  1557. }));
  1558. log('Finish 城通 旗下网盘系列简化验证码。');
  1559. }, 10);
  1560. // 下载支持加强 (貌似没用…?)
  1561. var thunderLink = $('.freelist .thunder'),
  1562. nDlBtn = $('<a class="local">');
  1563. if (thunderLink.length)
  1564. nDlBtn.text('下载器链接 (?)').attr('href', linkConv(thunderLink[0].outerHTML)).insertBefore (thunderLink);
  1565. break;
  1566. case "xiami.com":
  1567. win.player_download = function (sId) {
  1568. // 读取原始歌曲地址
  1569. var SongUrl = $($.ajax({
  1570. type: 'GET',
  1571. url: '/song/playlist/id/' + sId.songId + '/object_name/default/object_id/0',
  1572. cache: true,
  1573. /* 从缓存读,反正如果没记录可以跑到服务器找 */
  1574. async: false
  1575. }).responseText).find('location').html();
  1576. log('虾米解析 :: 歌曲ID [ ' + sId + ' ] :: 解密地址 :: ' + SongUrl);
  1577. // 开始解密...
  1578. SongUrl = (function (sLocation) {
  1579. var num = Number(sLocation.charAt(0)),
  1580. inp = sLocation.substr(1),
  1581. iLe = inp.length % num,
  1582. a = 0,
  1583. ret = '',
  1584. arr = [];
  1585. for (var i = 0; i < num; i++) {
  1586. arr[i] = (iLe > i ? 1 : 0) + (inp.length - iLe) / num;
  1587. }
  1588. for (var i = 0; i < arr[1]; i++) {
  1589. a = 0;
  1590. for (var j = 0; j < num; j++) {
  1591. ret += inp.charAt(a + i);
  1592. a += arr[j];
  1593. }
  1594. }
  1595. return unescape(ret.substr(0, inp.length)).replace(/\^/g, '0').replace(/\+/g, ' ');
  1596. })(SongUrl);
  1597. log('虾米解析 :: 歌曲ID [ ' + sId + ' ] :: 开启窗口 :: ' + SongUrl);
  1598. // 开启窗口...
  1599. win.open(SongUrl);
  1600. };
  1601. break;
  1602. case "dbank.com":
  1603. case "vmall.com":
  1604. win.adSend = eFunc;
  1605. function eI(aList, t, fCallback) {
  1606. var fId = false,
  1607. ret = {};
  1608. console.log('Process: ', aList);
  1609. for (var i = 0; i < aList.length; i++) {
  1610. console.log('Check the aList[' + i + '] :: ', aList[i]);
  1611. ret = fCallback(aList[i], t);
  1612. if (ret.ret) {
  1613. console.log('URL GET :: ' + aList[i].downloadurl);
  1614. fId = aList[i].downloadurl;
  1615. break;
  1616. } else if (aList[i].childList) {
  1617. console.log('NEXT TRY: aList[' + i + '] :: ' + aList[i].childList);
  1618. fId = eI(aList[i].childList, t, fCallback);
  1619. if (fId) {
  1620. return fId
  1621. }
  1622. }
  1623. }
  1624. return fId;
  1625. }
  1626. // 下载解析
  1627. var iNv = setInterval(function () {
  1628. if (!win.dbank.securelink.downloadfile) {
  1629. return;
  1630. } // 等待初始化
  1631. clearInterval(iNv);
  1632. log('dBank 解析 :: 文件列表加载完毕。');
  1633. win.dbank.securelink.setStat = win.dbank.hsdownload.checkResourceSelected = eFunc; // dBank 特殊解析
  1634. win.dbank.securelink.downloadfile = function (ahref) {
  1635. var fList = win.globallinkdata.data.resource.files,
  1636. fId = eI(fList, ahref.id, function (l, t) {
  1637. return ((l.id == t) ? {
  1638. ret: 1
  1639. } : {})
  1640. });
  1641. if (!fId) {
  1642. prompt('无法解析其真实地址,可能因为网站改版导致脚本失效..\n\n请提交问题和发生错误的地址到下列地址:', bugRepUrl);
  1643. return;
  1644. }
  1645. var rA = win.dbank.crt.decrypt(fId, this.encrykey);
  1646. log('dBank 解析 :: ' + rA);
  1647. win.open(rA, 'CUWCL4C ' + sVer + fId);
  1648. };
  1649. // 判断是否提示需要 VIP 帐号转存
  1650. if ($('#hsdownload').length == 0) {
  1651. eI(win.globallinkdata.data.resource.files, 0, function (l) {
  1652. $('a#' + l.id).click(function () {
  1653. win.dbank.securelink.downloadfile(this);
  1654. })
  1655. .attr('href', 'javascript:void(0);');
  1656. });
  1657. } else {
  1658. // 高速下载按钮拦截
  1659. ubA($('#hsdownload')[0]);
  1660. $('#hsdownload').click(function () {
  1661. $('#down_filelist .list-select input[type="checkbox"]').each(function () {
  1662. if ($(this).prop('checked')) {
  1663. win.dbank.securelink.downloadfile($(this).parent().parent().find('span.list-tit a[id]')[0]);
  1664. }
  1665. })
  1666. });
  1667. log('dBank 解析 :: 解析函数已绑定');
  1668. }
  1669. }, 100);
  1670. break;
  1671. case "5sing.com":
  1672. // 播放列表的下载按钮。
  1673. $('a[href*="Down.aspx?sid="]')
  1674. .each(function (i) {
  1675. $(this).attr({
  1676. 'href': win.wsplayer.playList[i].mp3,
  1677. 'title': '下载 ' + win.wsplayer.playList[i].songname,
  1678. 'target': '_blank'
  1679. })
  1680. });
  1681. break;
  1682. case 'douban.fm':
  1683. // 参考代码 豆藤, UsoId: 49911
  1684. var $a = $('<a>').css({
  1685. 'background': '#9DD6C5',
  1686. 'padding': '3px 5px',
  1687. 'color': 'white'
  1688. }).text('下载').hover(function () {
  1689. $(this).css({
  1690. 'margin-left': '5px',
  1691. 'padding-left': '10px',
  1692. 'background': '#BAE2D6'
  1693. });
  1694. }, function () {
  1695. $(this).css({
  1696. 'margin-left': '0',
  1697. 'padding-left': '5px',
  1698. 'background': '#9DD6C5'
  1699. });
  1700. }).css(makeDelayCss())
  1701. .attr('target', '_blank');
  1702. var $div = $('<div>').css({
  1703. 'float': 'right',
  1704. 'margin-top': '-230px',
  1705. 'margin-right': '-32px',
  1706. 'font-weight': 'bold',
  1707. 'font-family': '微软雅黑'
  1708. }).append($a).insertAfter('.player-wrap');
  1709. log('等待豆瓣电台加载…');
  1710. waitUnTil('extStatusHandler', function () {
  1711. log('豆瓣电台加载完毕! 开始绑定函数…');
  1712. var oldExtStatusHandler = win.extStatusHandler;
  1713. win.extStatusHandler = function (p) {
  1714. var a = JSON.parse(p);
  1715. if ('start' == a.type && a.song) {
  1716. $a.attr('href', a.song.url)
  1717. .attr('title', '右键另存下载: ' + a.song.title);
  1718. log(a.song.title + ' :: ' + a.song.url);
  1719. }
  1720. return oldExtStatusHandler(p);
  1721. }
  1722. log('函数绑定完毕, Enjoy~');
  1723. });
  1724. break;
  1725. }
  1726. }, false);
  1727. })();
  1728. /*
  1729. * 简单成就下载 by Yulei 本脚本只作学习研究参考用,版权所有 不得滥用、它用,后果自负
  1730. *
  1731. * Chrome 兼容 + 加强 by jixun66
  1732. * 个人修正内容请参考:
  1733. * http://userscripts.org/scripts/show/157621#full_description
  1734. *
  1735. */