Crack Url Wait Code Login For Chrome

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

As of 2014-03-05. See the latest version.

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