Bypass Wait, Code, & Login For Chrome

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

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

  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 0.6.2.3
  14. // @create 2012-01-26
  15. // @lastmodified 2014.03.06
  16.  
  17. //// 网盘域名匹配
  18. /// 国内一些「网赚」网盘,体验很差 orz
  19. // @include http://www.azpan.com/*
  20. // @include http://xddisk.com/*
  21. // @include http://www.xddisk.com/*
  22. // @include http://*.dxrr.com/*
  23. // @include http://*.87pan.com/*
  24. // @include http://www.nyhx.com/*
  25. // @include http://yimuhe.com/*
  26. // @include http://*.yimuhe.com/*
  27. // @include http://www.79pan.com/*
  28. // @include http://*.sudupan.com/*
  29. // @include http://sudupan.com/*
  30. // @include http://www.colafile.com/*
  31. // @include http://dl.vmall.com/*
  32. // @include http://dl.dbank.com/*
  33. // @include http://d.119g.com/*
  34. //
  35. // @include http://*.qjwm.com/*
  36. // @include http://*.7958.com/*
  37. // @include http://www.2kuai.com/*
  38. // @include http://v.32666.com/*
  39.  
  40. /// 百度
  41. // @include http://pan.baidu.com/share/link*
  42. // @include http://pan.baidu.com/s/
  43. // @include http://yun.baidu.com/share/link*
  44. // @include http://yun.baidu.com/s/
  45.  
  46. /// it168 整个站就一个下载地址 ..
  47. // @include http://down.it168.com/*
  48.  
  49. /// 飞速盘
  50. // @include http://*.rayfile.com/*/files/*
  51. // @include http://rayfile.com/*/files/*
  52.  
  53. /// 威盘
  54. // @include http://www.vdisk.cn/down/index/*
  55.  
  56. /// 城通系列
  57. // @include http://www.pipipan.com/*
  58. // @include http://www.ctdisk.com/*
  59. // @include http://www.400gb.com/*
  60. // @include http://www.bego.cc/*
  61.  
  62. /// 好
  63. // @include http://www.howfile.com/*
  64. // @include http://howfile.com/*
  65.  
  66. // 快盘
  67. // @include http://www.kuaipan.cn/*
  68.  
  69. // 短链接 (准备拆开, 暂时留在这)
  70. //\\ @include /\/\/(dc2\.us|dd\.ma|(ref|upan)\.so|t00y\.com)\//
  71.  
  72.  
  73. // 音乐放这边 >.>
  74. // @include http://jing.fm/*
  75. // @include http://5sing.com/*
  76. // @include http://zy.51gugu.com/*
  77. // @include http://duole.com/*
  78. // @include http://www.duole.com/*
  79. // @include http://douban.fm/*
  80. // @include http://moe.fm/*
  81.  
  82. // SongTaste
  83. // @include http://songtaste.com/song/*
  84. // @include http://songtaste.com/album/*
  85. // @include http://songtaste.com/playmusic.php*
  86. // 虾米音乐
  87. // @include http://xiami.com/song/play
  88. // @include http://www.xiami.com/song/play
  89. // 565656
  90. // @include http://www.565656.com/plus/player.ashx*
  91. // djcc & djye (还没确认是否可用, 暂时注释掉)
  92. //\\ @include /\/\/([a-z0-9-]+\.|)(djcc|djye)\.com\/play\.(php|html)/
  93. //\\ @include /\/\/([a-z0-9-]+\.|)djkk\.com\/dance\/play\//
  94. // 9ku
  95. // @include http://www.9ku.com/play/*
  96. // 人人电台
  97. // @include http://kxt.fm/*
  98. // @include http://fm.renren.com/*
  99. // 腾讯电台 (可能失效)
  100. // @include http://fm.qq.com/*
  101. // 音悦台
  102. // @include http://yinyuetai.com/video/*
  103. // @include http://yinyuetai.com/playlist/*
  104. // @include http://v.yinyuetai.com/video/*
  105. // @include http://v.yinyuetai.com/playlist/*
  106. // @include http://www.yinyuetai.com/video/*
  107. // @include http://www.yinyuetai.com/playlist/*
  108.  
  109. /// 访问不能, 注释掉
  110. //\\ @include /\/\/([a-z0-9-]+\.|)1ting\.com\//
  111. //\\ @exclude /\/\/([a-z0-9-]+\.|)1ting\.com\/lrc/
  112.  
  113. // @copyright 2012+, Yulei, Chrome Compatibility by Jixun.
  114. // @require https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.0/jquery.min.js
  115. // ==/UserScript==
  116.  
  117.  
  118.  
  119. // 兼容中文的 BASE64 编码系统: https://code.google.com/p/javascriptbase64/
  120. 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}};
  121.  
  122. /* getFlashVars 1.0 by Jixun [Jixun.Org]; MIT License */
  123. 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};
  124.  
  125. function linkConv(sInput) {
  126. return Base64.decode((sInput.match(/:\/\/([\/+a-z0-9]+)/i) || [, ''])[1]).replace(/^\[FLASHGET\]|\[FLASHGET\]$|^AA|ZZ$/gi, '');
  127. }
  128. // 验证码绑定; 用法演示 (不绑定自定义回调):
  129. // codeKeyBind('input#code', 4, 'button#check')
  130. function codeKeyBind (inputBox, codeLen, btnTarget, callback) {
  131. $(inputBox).on('keyup', function (e) {
  132. codeLen == this.value.length
  133. && (!callback || callback(this.value, codeLen))
  134. && $(btnTarget).click();
  135. });
  136. }
  137.  
  138. function getUrlParam (a) {
  139. var z = {},
  140. b = a.substr(a.indexOf("?") + 1);
  141. if (b)
  142. for (var c = b.split("&"), i = 0; i < c.length; i++) {
  143. var d = c[i].toString(),
  144. e = d.indexOf("=");
  145. z[unescape(d.substr(0, e))] = unescape(d.substr(e + 1))
  146. };
  147. return z
  148. }
  149.  
  150. (function () {
  151. var us = (typeof (unsafeWindow) != "undefined"),
  152. win = us ? unsafeWindow : window,
  153. sVer = '0.6.2.2';
  154. // 某站过 ABP 检测 233333
  155. win.antiads = 0;
  156.  
  157. // 防止书签版出错
  158. if (!us) {
  159. GM_getValue=function(){return sVer};
  160. GM_setValue=function(){return !1}
  161. }
  162. /*
  163. * jPrintf: 自写函数,参考:
  164. * http://jixun.org/1656-
  165. *
  166. * $_GET: 自写全局变量, 模拟 php 端的 $_GET 变量。参考:
  167. * http://jixun.org/1774-
  168. */
  169. var d = document,
  170. l = location,
  171. lurl = l.href,
  172. gPathway = '',
  173. showUpdate = 1, // 更新积累 3 个后改成 True.
  174. body = $('body')[0],
  175. numKeys = [1, 2, 3, 4, 5, 6, 7, 8, 9, 'C', '0', '←'],
  176. ubA = function (e) {
  177. e.outerHTML = e.outerHTML
  178. },
  179. cE = function (e) {
  180. return d.createElement(e);
  181. },
  182. bugRepUrl = 'http://userscripts.org/topics/122061#script-nav',
  183. log = function (a1) {
  184. console.log((arguments.length > 1) ? arguments : a1)
  185. },
  186. dhost = ((new RegExp(/(\w+\.\w+)\//).exec(l.hostname + '/') || [, ''])[1]).toLowerCase(),
  187. jprintf = jPrintf = function () {
  188. var b = arguments,
  189. d = b.length - 1,
  190. c = b[0];
  191. if (!(1 > d)) {
  192. for (var a = 1; a <= d; a++) c = c.replace(RegExp("(\\$|%)" + a, "g"), b[a]);
  193. return c
  194. }
  195. },
  196. $_GET = getUrlParam (lurl),
  197. sUpdated = (GM_getValue('ver', '') != sVer);
  198.  
  199. function wordpressAudio () {
  200. log('WordPress Audio 插件通用代码 启动');
  201.  
  202. function fixEmbed (obj) {
  203. if (obj.hasAttribute('CUWCL4C')) return;
  204. console.log ('fixEmbed: ', obj);
  205. $('<a>').html('下载音频<br>')
  206. .attr ({
  207. href: Base64.decode(getFlashVars(obj).soundFile),
  208. target: '_blank'
  209. }).insertBefore (obj);
  210. obj.setAttribute ('CUWCL4C', '^^');
  211. }
  212.  
  213. new MutationObserver (function (e) {
  214. for (var i=0; i<e.length; i++)
  215. if (e[i].target.className == 'audioplayer_container' && e[i].addedNodes.length)
  216. fixEmbed(e[i].addedNodes[0]);
  217. }).observe ($('.post > .entry')[0], {
  218. childList: true,
  219. subtree: true
  220. });
  221. // Firefox fix.. = =
  222. $('object[id^="audioplayer_"]').each(function () { fixEmbed(this) });
  223. log('WordPress Audio 插件通用代码 结束');
  224. }
  225. function parseHTML(responseText) {
  226. // For Firefox
  227. var ret = (new DOMParser()).parseFromString(responseText, "text/html");
  228. // For Chrome
  229. if (ret == undefined) {
  230. var ret = document.implementation.createHTMLDocument("");
  231. ret.querySelector('html').innerHTML = responseText;
  232. }
  233. return ret;
  234. }
  235. function waitUnTil(ver4Check, func, replaceVar) {
  236. var timer = setInterval(function () {
  237. if (typeof (ver4Check) == 'function') {
  238. if (!ver4Check()) return;
  239. } else if (typeof (win[ver4Check]) == 'undefined') {
  240. return;
  241. }
  242. clearInterval(timer);
  243. if (replaceVar && typeof (win[ver4Check]) == 'function') {
  244. log('Function [ ' + ver4Check + ' ] Hooked.');
  245. win[ver4Check] = replaceVar;
  246. }
  247. if (typeof (func) == 'function')
  248. func();
  249. }, 10);
  250. }
  251. function makeCpfCss(name, param) {
  252. var ret = {};
  253. ret[name] = param;
  254. ['o','ms','moz','webkit'].forEach (function (e) {
  255. ret['-' + e + '-' + name] = param;
  256. });
  257. return ret;
  258. }
  259. function safeJump(sTargetUrl) {
  260. d.title = '正在跳转…';
  261. log('safeJump :: ' + sTargetUrl);
  262. if (!sTargetUrl) return false;
  263. return reDirWithRef(sTargetUrl);
  264. }
  265. function makeDelayCss(sVar) {
  266. var sP = sVar || 'all .2s';
  267. return makeCpfCss('transition', sP);
  268. }
  269. function makeRotateCss(deg) {
  270. return makeCpfCss('transform', 'rotate(' + deg + 'deg)');
  271. }
  272. function createNumPad(maxLen, targetInput, finishCallback, codeResetCallback) {
  273. if (!codeResetCallback)
  274. codeResetCallback = eFunc;
  275. var table = cE('table'),
  276. rcde = $(targetInput)[0];
  277. $(table).css({
  278. 'background-color': '#ffcc99',
  279. 'position': 'relative',
  280. 'bottom': '164px',
  281. 'left': '170px'
  282. });
  283. for (var i = 0; i < 4; i++) {
  284. var tr = cE('tr');
  285. for (var j = 0; j < 3; j++) {
  286. var td = cE('td');
  287. td.innerHTML = $(td).attr('k', numKeys[i * 3 + j]).attr('k');
  288. tr.appendChild(td);
  289. }
  290. table.appendChild(tr);
  291. }
  292. $(table).find('td').click(function () {
  293. var val = rcde.value,
  294. len = val.length,
  295. key = $(this).attr('k') || '';
  296. $(rcde).focus();
  297.  
  298. switch (key) {
  299. case '←':
  300. rcde.value = val.sub(1);
  301. break;
  302. case 'C':
  303. rcde.value = '';
  304. break;
  305. default:
  306. rcde.value += key;
  307. ++len >= maxLen
  308. && (finishCallback(rcde.value)
  309. ? $(table).hide()
  310. : codeResetCallback(), rcde.value = ''
  311. );
  312. }
  313. }).css({
  314. 'font': 'bold 25px Tahoma',
  315. 'color': 'red',
  316. 'cursor': 'pointer',
  317. 'vertical-align': ' middle',
  318. 'text-align': ' center',
  319. 'border': ' 1px solid #DDDDDD',
  320. 'padding': '6px',
  321. 'width': '40px',
  322. 'height': '40px'
  323. });
  324. return table;
  325. }
  326. //pajhome.org.uk/crypt/md5/md5.js
  327. log('脚本开始执行。');
  328. lurl = lurl.substr(0, (lurl + '#').indexOf('#')); // 过滤 # 后面的内容
  329. log(['调试信息如下:', dhost, lurl, $_GET]);
  330. log('脚本版本 [ ' + sVer + ' ] , 如果发现脚本问题请提交到 [ ' + bugRepUrl + ' ] 谢谢。');
  331. // 文本类扩展 :: 删除文本后方指定位数
  332. String.prototype.sub = function (n) {
  333. return this.substr(0, this.length - n);
  334. }
  335. // 空白函数, 适合腾空页面函数。
  336. function eFunc() {}
  337. function tFunc() { return !0 }
  338. function fFunc() { return !1 }
  339. function reDirWithRef (targetUrl) {
  340. var GET = getUrlParam(targetUrl),
  341. form = $('<form>')
  342. .attr('action', targetUrl.replace(/\?.*$/, ''))
  343. .text('正在跳转: ' + targetUrl).prependTo(document.body)
  344. .css ({fontSize: 12});
  345.  
  346. for (g in GET)
  347. form.append($('<input>').attr({
  348. name: g,
  349. type: 'hidden'
  350. }).val(GET[g]));
  351.  
  352. form.submit();
  353. return 1;
  354. }
  355.  
  356. // 网盘地址自动导向 [基于 phpDisk 的网盘]
  357. function chkDU (){
  358. var chk = /\/(file|)(file|view)([\/.\-_].*)/;
  359. return chk.test (l.href)
  360. // Because location.xx = xx does not pass the refer, so we're going to make a dummy form.
  361. ? reDirWithRef(l.href.replace (chk, '/$1down$3'))
  362. : false;
  363. }
  364. // 插入样式表
  365. function injStyle(s) {
  366. var st = cE('style');
  367. st.innerHTML = s;
  368. d.body.appendChild(st);
  369. return st;
  370. }
  371. // 强制隐藏/显示某些元素
  372. function forceHide (what){ injStyle(what + ' { display: none !important }')}
  373. function forceShow (what){ injStyle(what + ' { display: block !important }')}
  374. // 强制隐藏框架
  375. function forceHideFrames (){ forceHide('iframe, frameset, frame')}
  376. // 清 Cookie
  377. 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]}
  378. // 移除站外链接
  379. function clearOutsiteLink() {
  380. $('a').not('[href*="' + dhost + '/"],[href*="#"],[href^="j"],[href^="/"]').remove();
  381. }
  382. function jPlayerPatcher (callback) {
  383. log ('[-] Waiting for jPlayer to load...');
  384. waitUnTil(function () {
  385. return win.$.jPlayer.prototype.setMedia;
  386. }, function () {
  387. log ('[*] Backup old function...');
  388. var oldSetMedia = win.$.jPlayer.prototype.setMedia;
  389. log ('[*] Hook start!');
  390. win.$.jPlayer.prototype.setMedia = function (newMedia) {
  391. console.log (newMedia);
  392. callback(newMedia);
  393. return oldSetMedia.apply(this, arguments);
  394. };
  395. log ('[+] Hook finish, enjoy~');
  396. });
  397. }
  398.  
  399. // DOMContentLoaded
  400. $(function () {
  401. if (showUpdate && sUpdated) {
  402. GM_setValue('ver', sVer);
  403. alert('\
  404. \n感谢您更新脚本 [ CUWCL4C ] 到最新版 [' + sVer + '],\
  405. \n以下为该版本的更新日志:\
  406. \n\ * 修正 7958 网盘用户文件夹神隐错误 [37], 感谢 @myx0415 报告.\
  407. \n\ * 修正 7958 ABP 检测..\
  408. \n\
  409. \n** 脚本搬到 GreaseFork 了哦 **\
  410. \n\
  411. \n\
  412. \n如果发现不兼容的情况 (如: 页面错位, 功能失效)\
  413. \n或新功能建议, xx 站点的下载解析\
  414. \n欢迎提交到脚本讨论区 ≧▼≦\
  415. \n最后, 如果您喜欢该脚本还请打个 5 & 收藏, 谢谢~');
  416. }
  417. log('进入 DOMContentLoaded 事件。');
  418. log('域名判断: ' + dhost);
  419. /*
  420. waitUnTil('OnDownloadClick_Simple', function () {
  421. var tLink = arguments[0].getAttribute('thunderhref').substr(10);
  422. var dlLink = Base64.decode(tLink);
  423. dlLink = dlLink.substr(2, dlLink.length - 4);
  424. console.log(dlLink);
  425. return false;
  426. }, true);
  427. */
  428. // HOOK STAGE 1
  429. var continueScript = false;
  430. switch (l.hostname.toLowerCase()) {
  431. case 'yun.baidu.com':
  432. case 'pan.baidu.com':
  433. // 因为度娘知道自己的所谓云管家不能在非 Windows 下运行
  434. // 因此识别器更改为非 Win32 即可绕过云管家提示。
  435. win.navigator.__defineGetter__ ('platform', function () {return 'Cracked by Jixun ^^'});
  436. break;
  437.  
  438. default:
  439. continueScript = true;
  440. }
  441. if (!continueScript) return;
  442.  
  443. setTimeout(function () {
  444. // 域名判断开始
  445. var continueScript = false;
  446. switch (l.hostname.toLowerCase()) {
  447. default:
  448. continueScript = true;
  449. }
  450. if (!continueScript) return;
  451. switch (dhost) {
  452. case 'kxt.fm':
  453. case 'duomi.com':
  454. wordpressAudio();
  455. break;
  456.  
  457. case 'jing.fm':
  458. waitUnTil (function () {
  459. return win.Player.player.jPlayer
  460. }, function () {
  461. log ('jing.fm Loader Start~');
  462. var myDlBox = $('<a>').appendTo($('#mscPlr')).css({
  463. position: 'absolute',
  464. right: 0,
  465. zIndex: 9
  466. }).attr('target', '_blank').text('下载');
  467. win.Player.player.bind(win.$.jPlayer.event.loadstart, function (eve) {
  468. myDlBox.attr('href', eve.jPlayer.status.src.replace(/\d+$/, 0))
  469. });
  470. });
  471. case 'colafile.com':
  472. chkDU ();
  473. forceHide ('.table_right, #down_link2, #down_link3, .tui, .ad1 > .ad1 > *');
  474. forceShow ('.ad1 > .ad1 > .downbox');
  475. break;
  476. // 通用 phpDisk 网盘
  477. case '2kuai.com':
  478. case '32666.com': // <- 乱七八糟广告就属它最多
  479. forceHide ('a[href*="vip"]');
  480. case 'dxrr.com':
  481. /* case "gxp.cc": */
  482. if (chkDU()) return;
  483. $('script,iframe').remove();
  484. forceHide ('.ad,#vcode,#tui,.dcode,#down_box2,#dl_tips');
  485. forceShow ('#down_box,#dl_addr{display:block !important}');
  486. $('#ct .viewl,.nal,.scbar_hot_td').remove();
  487. break;
  488. case 'sudupan.com':
  489. var tU = lurl.replace(/\/down_/i, '/sudupan/xiazai_');
  490. if (tU != lurl) l.href = tU;
  491. forceHideFrames();
  492. break;
  493. case 'yinyuetai.com':
  494. // http://www.yinyuetai.com/insite/get-video-info?videoId=[视频ID]&json=true
  495. var fetchDlUrlById = function (iId, fCallback) {
  496. log('Loading video for ' + iId);
  497. // 因为跨域, 所以 =-=
  498. GM_xmlhttpRequest ({
  499. method: 'GET',
  500. url: "http://www.yinyuetai.com/insite/get-video-info?json=true&videoId=" + iId,
  501. onload: function (u) {
  502. var r = JSON.parse (u.responseText);
  503. fCallback(r.videoInfo.coreVideoInfo.videoUrlModels, r.videoInfo.coreVideoInfo.videoName);
  504. },
  505. onerror: function (r) {
  506. fCallback(false);
  507. }
  508. });
  509. };
  510. var $appTo, $ap1After2, $display = '',
  511. eDiv = $('<div>');
  512. function appendDlLinks(dlLinks, videoTitle) {
  513. if (dlLinks === false) {
  514. console.error('解析失败! ID: ', currentVideoId);
  515. return;
  516. }
  517. eDiv.css ({
  518. color: 'white',
  519. 'font-size': 'small',
  520. 'margin-left': '7px'
  521. });
  522. eDiv.html('下载: ').css('display', $display);
  523. dlLinks.forEach(function (e) {
  524. $('<a>').text(e.QualityLevelName).attr('href', e.videoUrl)
  525. .attr('title', '下载: ' + videoTitle).appendTo(eDiv)
  526. .addClass ('c_cf9');
  527. eDiv.append(' | ');
  528. });
  529. eDiv.append('提供: CUWCL4C ' + sVer);
  530. if ($ap1After2 == 1)
  531. $appTo.append (eDiv);
  532. else // 2
  533. $appTo.after (eDiv);
  534. // $('#download').href = dlLink;
  535. }
  536. if (/^\/video/i.test(l.pathname)) {
  537. // Signal
  538. var currentVideoId = parseInt(l.pathname.match(/\d+/)[0]);
  539. $appTo = $('.vchart'); $ap1After2 = 2;
  540. fetchDlUrlById(currentVideoId, appendDlLinks);
  541. } else {
  542. $ap1After2 = 1;
  543. $display = 'inline';
  544. waitUnTil (function () {
  545. return $('.J_mv_content').length;
  546. }, function () {
  547. $('.J_mv_content').on('DOMSubtreeModified', function () { setTimeout (function () {
  548. log ('> Switch');
  549. $appTo = $('<div>').css('display', $display).appendTo('.J_video_info');
  550. fetchDlUrlById(($('.J_video_info a[href*="video/"]').attr('href').match (/\d+(\/|)$/)||[])[0], appendDlLinks);
  551. }, 10)});
  552. });
  553. }
  554. break;
  555. case 'renren.com':
  556. waitUnTil(function () {
  557. return win.XN.APP.WebRadioNotlogin.player.getPlayer();
  558. }, function () {
  559. // 插入播放按钮
  560. var dlLink = $('<a>').attr('title', '单击下载').css(makeRotateCss(90)).css({
  561. 'width': '38px',
  562. 'height': '36px',
  563. 'background-position': '-4px -820px',
  564. 'margin-top': '-2px'
  565. }).attr('href', win.XN.APP.WebRadioNotlogin.player.getPlayer().getAttribute('src'))
  566. .insertBefore($('.operation #lrc'));
  567.  
  568. var oldPlay = win.XN.APP.WebRadioNotlogin.player.play;
  569. win.XN.APP.WebRadioNotlogin.player.play = function (url, f0) {
  570. console.warn(arguments);
  571. var ret = oldPlay.apply(win.XN.APP.WebRadioNotlogin.player, arguments);
  572. dlLink.attr('href', url);
  573. return ret;
  574. }
  575. });
  576. break;
  577. case 'qq.com':
  578. log('Waiting for fmQQ...');
  579. waitUnTil(function () {
  580. return (typeof (win.$.qPlayer.player.playUrl) == 'function')
  581. }, function () {
  582. log('fmQQ Hook start!');
  583. // CreateDLButton
  584. var dlLink = $('<a>').css(makeRotateCss(90)).css({
  585. 'background-position': '-24px -73px'
  586. });
  587. $('.btn_del').after(dlLink);
  588. var firstRun = true;
  589. oldPlayurl = win.$.qPlayer.player.playUrl;
  590. win.$.qPlayer.player.playUrl = function (songUrl) {
  591. dlLink.attr('href', songUrl).attr('title', '单击下载: ' + win.$.qPlayer.playList.getSongInfoObj().msong);
  592. if (firstRun)
  593. return firstRun = 0;
  594. return oldPlayurl(songUrl);
  595. };
  596. win.$.qPlayer.player.playUrl(win.$.qPlayer.playList.getSongInfoObj().songurl);
  597. log('fmQQ Hook finish!');
  598. });
  599. break;
  600. case 'moe.fm':
  601. waitUnTil('playerInitUI', function () {
  602. // 登录破解
  603. win.is_login = true;
  604. log('fmMoe Hook start!!');
  605. var dlLink = $('<a>').addClass('player-button left').css(makeRotateCss(90)).css({
  606. 'width': '26px',
  607. 'background-position': '-19px -96px'
  608. });
  609. $('div.player-button.button-volume').first().after(dlLink);
  610. var oldPlayerInitUI = win.playerInitUI;
  611. win.playerInitUI = function (a) {
  612. dlLink.attr('href', a.completeUrl).attr('title', '单击下载: ' + a.title);
  613. log(a);
  614. return oldPlayerInitUI(a);
  615. };
  616. log('fmMoe Hook finish!!');
  617. });
  618. break;
  619. case "dbank.com":
  620. case "vmall.com":
  621. // 页面整理。
  622. $('#c_footer, #filelist_marker, div.link-left .panel-line, div[id^="ad_"], .panel-recommended, #hotkw, p.copyright-tips').remove();
  623. break;
  624. case "vdisk.cn":
  625. forceShow('#btnbox');
  626. forceHide('#loadingbox, #yanzhengbox, #yzmbox, #ShowDIV, ifarme');
  627. // 清理乱七八糟的链接
  628. clearOutsiteLink();
  629. break;
  630. case "qjwm.com":
  631. case "7958.com":
  632. if (l.href.toLowerCase().indexOf("down_") > 0) l.href = lurl.replace(/down_/i, 'download_');
  633. forceHide('#downtc,[id^="cpro_"],.download_alert,#inputyzm,#house,#uptown,a[href$="money.html"],a[href$="reg.html"]');
  634. forceShow('#downtc2,.new_down');
  635. waitUnTil('authad', function () {
  636. win.authad = win.bdshow = win.scrollTo = tFunc;
  637. });
  638. break;
  639. case "rayfile.com":
  640. //Feisu-Rayfile,nextpag,showdown
  641. if (win.vkey) {
  642. l.href = lurl + win.vkey;
  643. } else {
  644. win.filesize = 100;
  645. win.showDownload();
  646. win.showDownload = eFunc; // 防止 7 秒后按钮被覆盖。
  647. // 天知道这个错误怎么来的.. 语言错误就显示不了下载按钮..
  648. $('#downloadlink').addClass('btn_downNow_zh-cn');
  649. $('#vodlink').addClass('btn_downTools_zh-cn');
  650. // 整理页面
  651. $('div.left, iframe').remove();
  652. };
  653. break;
  654. case "songtaste.com":
  655. // SongTaste,Source-Code by (inc/common.js)
  656. // By Yulei 2012.11.30 ;Remove register and login tips.
  657. // Simplify Code + Simulate Official site action + Chrome Fix.
  658. var cssCode = {
  659. 'font-size': '15px',
  660. 'color': '#fff',
  661. 'background-color': '#000',
  662. 'text-decoration': 'none',
  663. 'padding': '3px 5px'
  664. };
  665. var sId = $_GET['song_id'] || (function () {
  666. if (lurl.toLowerCase().indexOf('/album/') != -1) {
  667. // 专辑页面功能添加
  668. log('ST :: 专辑页面调整');
  669. var btn_playAll = $('[value="连续播放"]');
  670. var btn_noPopPlay = btn_playAll.clone().attr({
  671. 'value': '不弹窗播放',
  672. 'onclick': ''
  673. });
  674. btn_noPopPlay.click(function () {
  675. var id = "",
  676. arr = win.chkArray;
  677. for (i = 0; i < arr.length; i++) {
  678. if (arr[i].checked) {
  679. id += arr[i].value + ",";
  680. }
  681. }
  682. if (id.length > 1) {
  683. id = id.sub(1);
  684. l.href = "/playmusic.php?song_id=" + id;
  685. } else {
  686. alert("请选择歌曲");
  687. }
  688. });
  689. btn_playAll.after(btn_noPopPlay);
  690. return;
  691. }
  692. log('ST :: 单曲模式解析');
  693. var Args = $("#playicon a")[0].href.replace(/ /g).replace(/\"/g, "'").split('\'');
  694. var sURL = Args[5],
  695. sType = Args[11],
  696. sHead = Args[13],
  697. sId = Args[15],
  698. sTime = ((new RegExp(/,(\d+)\)/).exec(Args[16]) || [, '0'])[1]);
  699. if (sURL.indexOf('rayfile') > 0) {
  700. var SongUrl = sHead + sURL + win.GetSongType(sType);
  701. } else {
  702. SongUrl = $.ajax({
  703. type: 'POST',
  704. url: '/time.php',
  705. cache: true,
  706. /* 从缓存读,反正如果没记录可以跑到 ST 服务器下 */
  707. async: false,
  708. data: 'str=' + sURL + '&sid=' + sId + '&t=' + sTime,
  709. dataType: 'html',
  710. }).responseText;
  711. }
  712. $('a#custom_2').attr({
  713. 'href': SongUrl,
  714. 'title': 'Cracked By jixun66'
  715. }).css(cssCode).text('音乐直链');
  716. return false;
  717. })();
  718. if (sId) {
  719. // 下载解析 - Hook 更换歌曲的函数,避免重复读取歌曲 + 不需要多次请求服务器不容易掉线。
  720. log('ST :: 列表模式解析');
  721. win.changeSong_e = win.changeSong;
  722. win.changeSong = function (a1, a2, a3) {
  723. // 2013.03.19 & 2013.04.09 修正:
  724. // 已经删除的歌曲自动跳到下一曲
  725. if (a1.trim() == '') {
  726. win.pu.doPlayNext(2);
  727. return;
  728. }
  729. log('请求歌曲 :: ' + a1 + ' :: ' + a2);
  730. $('#dl_Link').attr({
  731. 'href': a2,
  732. 'title': a1
  733. });
  734. document.title = 'ST - ' + a1;
  735. // 转接给原函数
  736. win.changeSong_e(a1, a2, a3);
  737. };
  738. win.downSong = function () {
  739. win.open(win.theSongUrl);
  740. };
  741. $('div#left_music_div div.p_fun a:eq(2)').css(cssCode)
  742. .text('直链下载').attr({
  743. 'id': 'dl_Link',
  744. 'target': '_blank'
  745. });
  746. // 2013.03.19 添加:
  747. // 重建播放列表地址
  748. $('p.p_list_txt').append($('<a>').text('重建播放列表').click(function () {
  749. l.href = '?song_id=' + win.arr_ids.join(',');
  750. }).css({
  751. 'cursor': 'pointer'
  752. }));
  753. log('ST :: 等待网页加载...');
  754. var iNv = setInterval(function () {
  755. if (!win.pu.doPlayNext) {
  756. return;
  757. }
  758. log('ST :: 官方播放器删除功能修正启动');
  759. // 修正播放器删除代码错误 :: 开始
  760. win.pu.doPlayNext = function (t) {
  761. for (var i = 0; i < win.arr_ids.length; i++) {
  762. if (win.arr_ids[i] == win.cur_sid) {
  763. var now = i;
  764. break;
  765. }
  766. }
  767. // 寻找下一首未删除的歌曲。
  768. // * 2013.01.29 修正
  769. // 1. 上一首查找失败的情况下会滚回到当前音乐的错误。
  770. // 2. 如果没有可听歌曲情况下无限循环的错误。
  771. var now = Math.abs((now || 0) + t),
  772. avl = 0;
  773. // 检查是否有歌曲剩余
  774. for (var i = 0; i < win.arr_ids.length; i++) {
  775. if (win.arr_ids[i]) {
  776. avl++;
  777. }
  778. }
  779. if (avl == 0) {
  780. alert('歌都被删光了还听啥...');
  781. return;
  782. }
  783. // 寻找空位
  784. while (true) {
  785. if (win.arr_ids[now]) {
  786. log('切换歌曲 :: ' + now.toString());
  787. win.pu.utils(now);
  788. win.cur_sid = win.arr_ids[now];
  789. win.playSongRight();
  790. return;
  791. }
  792. now += t >= 0 ? 1 : -1;
  793. if (win.arr_ids.length <= now) {
  794. now = 0;
  795. }
  796. if (now < 0) {
  797. now = win.arr_ids.length;
  798. }
  799. }
  800. }
  801. win.delSongDiv = function (songid, isbox) {
  802. log('删除歌曲 :: ' + songid.toString());
  803. $('#' + songid).hide();
  804. var new_songlist = [];
  805. for (var i = 0; i < win.arr_ids.length; i++) {
  806. if (win.arr_ids[i] == songid) {
  807. if (songid == win.cur_sid)
  808. win.pu.doPlayNext(1);
  809. win.arr_ids[i] = 0;
  810. }
  811. }
  812. }
  813. // 修正播放器删除代码错误 :: 结束
  814. log('ST :: 官方播放器删除功能修正结束');
  815. clearInterval(iNv);
  816. }, 100);
  817. }
  818. break;
  819. case "5sing.com":
  820. //By Yulei 2012.11.27
  821. // Easy way of getting the link url: by jixun
  822. if (l.href.toLowerCase().indexOf("down") > 0) {
  823. if (window.confirm('单击确定返回到歌曲信息目录解析下载地址。')) {
  824. var urls = lurl.replace(/down\.aspx\?sid\=/i, '');
  825. l.href = urls + ".html";
  826. }
  827. break;
  828. }
  829. if (l.hostname == 'fm.5sing.com') {
  830. // 晚点再搞播放列表那的下载按钮。
  831. // 刚开始加载的网页执行太快了,Hook 慢了点,所以把 _down 也 Hook 过来。
  832. waitUnTil ('getPlayInfo', function () {
  833. var getPlayInfo_e = win.getPlayInfo;
  834. win.getPlayInfo = function (a1, a2) {
  835. var sUrl = win.wsplayer.playList[win.wsplayer.playIndex].mp3;
  836. log('5sing :: 歌曲解析 :: ' + a2.songname + ' :: ' + sUrl);
  837. $('#playerbox .action_btn a.jp-download').attr({
  838. 'href': sUrl,
  839. 'target': '_blank',
  840. 'title': '下载 ' + a2.songname,
  841. 'onclick': 0
  842. });
  843. return getPlayInfo_e (a1, a2);
  844. }
  845. $('span.action_shop a.download').each(function(i){
  846. this.href = win.wsplayer.playList[i].file;
  847. });
  848. });
  849. win._down = function () {
  850. win.open(win.wsplayer.playList[win.wsplayer.playIndex].mp3);
  851. }
  852. } else {
  853. waitUnTil (function () {return win.wplayer.playList[0].file;}, function () {
  854. $('a[href^="/down/"]').attr({
  855. 'href': win.wplayer.playList[0].file,
  856. 'target': '_blank',
  857. 'title': 'Cracked By jixun66'
  858. }).html('<b/>直链下载')
  859. });
  860. }
  861. break;
  862. case "it168.com":
  863. forceHide('.right_four,#wanyxShowAD');
  864. $("#download").html ('').append($('<a>').attr({
  865. href: $('.sign11.four_li1>a').attr('href'),
  866. class: 'sign11'
  867. }).css({
  868. paddingLeft: '2em',
  869. color: '#fff'
  870. }).text('点我下载'));
  871. break;
  872. case '119g.com':
  873. var reg = /^(\/f\/[a-z0-9]+)(_bak|)/i;
  874. if (!reg.test(location.pathname))
  875. return;
  876. var mat = location.pathname.match(reg) || [, '', ''];
  877. if (!mat[2])
  878. location.pathname = mat[1] + '_bak.html';
  879. break;
  880. case "yimuhe.com":
  881. // yimuhe ,Vcode,8s,By Yulei 2012.12.26
  882. // Make it easy by jixun66
  883. // /n_dd.php?file_id=476136&userlogin=niuge&ser=1
  884. chkDU();
  885. forceShow('#yzm');
  886. forceHide('#loading');
  887. $('.w632').css({height:368});
  888. var oldDL;
  889. $('#yzm>form')
  890. .append(createNumPad(4, '#code', function () {
  891. $('#yzm>form>input[name="Submit"]').click();
  892. setTimeout (function () {
  893. $('#download:visible>a:last').click();
  894. }, 200);
  895. return 1;
  896. }, function () {
  897. $('#vcode_img').click();
  898. }));
  899. if (!l.pathname.indexOf('/n_dd.php')) {
  900. forceHide('.ggao');
  901. reDirWithRef($('#downs').attr('href'));
  902. }
  903. break;
  904.  
  905. break;
  906. if (location.pathname != "/filedown.php") {
  907. var aLink = $('a img[src="n_images/ico_c.gif"], a img[src="n_images/ico_b.gif"]').parent();
  908. win.down_file2 = function () {
  909. var rep = $.ajax({
  910. type: 'GET',
  911. url: jprintf('/n_dd.php?file_id=$1&ser=$2', arguments[0], arguments[4] || '1'),
  912. cache: true,
  913. /* 从缓存读,反正如果没记录可以跑到服务器下 */
  914. async: false,
  915. dataType: 'html',
  916. }).responseText;
  917. console.log (rep);
  918. var rL = parseHTML(rep).querySelector('a#downs').href;
  919. log('一禾木 :: ' + rL);
  920. aLink.attr({
  921. 'href': rL,
  922. 'onclick': ''
  923. });
  924. }
  925. // aLink.click();
  926. } else {
  927. win.down_file = function (fId, a2, sKey, sFn, iSid, sType, a7, a8, a9) {
  928. var rL = jprintf('//down$1.yimuhe.com/downfile/$2.$3?key=$4&type=$5', a9, sKey, sFn, iSid, a7)
  929. log('一禾木 :: ' + rL);
  930. l.href = rL;
  931. }
  932. }
  933. break;
  934. case "djkk.com":
  935. // 参考 Music liker for Beauty 代码,感谢 @yulei
  936. var pl4 = document.getElementsByClassName('play_4')[0],
  937. rmp3 = win.list[0].m4a.replace(/mp\./, 'do.').replace(/m4a/g, 'mp3'),
  938. myStyle = 'background: transparent url("/images/p_down.gif") no-repeat left center; height:15px; width:15px;';
  939. if (/img/g.test(pl4.innerHTML)) {
  940. pl4.innerHTML = "<a href='" + win.list[0].m4a + "' style='color:blueviolet' target='_blank' title='试听音乐下载 - Cracked By Yulei'><b style='" + myStyle + "'> </b>普通</a>";
  941. pl4.innerHTML += "<a href='" + rmp3 + "' title='高品质音乐下载 - Cracked By Yulei' target='_blank'><b style='" + myStyle + "'> </b>高清</a>";
  942. pl4.style.width = "82px";
  943. document.getElementsByClassName('play_2')[0].style.display = "none";
  944. }
  945. break;
  946. case 'kuaipan.cn':
  947. // 火狐下失效 囧…
  948. //waitUnTil('CONST', function () {
  949. // win.CONST.Token = win.CONST.Token || 'Patched By Jixun ^^';
  950. //});
  951. // 金山快盘免登录下载解析
  952. $('#jQrcodeDownload')
  953. .attr ('class', 'imitate-btn f16 btn-blue l')
  954. .text('免登录下载');
  955. $('#jQrcodebox').html ('免登录下载已开始,请等待下载提示...');
  956. $('#qrcode').remove();
  957. $('<div>').attr('id', 'qrcode').appendTo (body);
  958. win.encodeURIComponent_e = win.encodeURIComponent;
  959. win.encodeURIComponent = function (a1) {
  960. if (a1.toString().indexOf('/getdl?') >= 0) {
  961. l.href = a1.toString();
  962. $('.ui-dialog-title').text('Patched By Jixun');
  963. return false;
  964. }
  965. return win.encodeURIComponent_e (a1);
  966. }
  967. break;
  968. case 'howfile.com':
  969. forceHide ('#floatdiv div');
  970. injStyle ('#floatdiv {top: 150px; z-index: 99999; display: block !important;}');
  971. $('iframe,script,.row1_right').remove();
  972. break;
  973. case '51gugu.com':
  974. $('#pwd_input_box').remove();
  975. waitUnTil('GetUrl', function () {
  976. $('.fileinfo').append($('<a>').attr('href', 'javascript:void(0);').click(function () {
  977. l.href = win.GetUrl(win.root_dirid)
  978. }));
  979. });
  980. break;
  981. case '79pan.com':
  982. chkDU();
  983. $('iframe, #code_box, #down_box2').remove();
  984. $('#down_box').show();
  985. break;
  986. case "87pan.com":
  987. chkDU();
  988. $('script,.view-gg,#view-gg').remove();
  989. break;
  990. case "azpan.com":
  991. chkDU();
  992. document.onkeydown = eFunc;
  993. $('script, iframe').remove();
  994. forceHide ('a[id*="Union"]');
  995. break;
  996. case "dd.ma":
  997. var aLink = $('#btn_open a.link1').attr('href');
  998. if (!aLink)
  999. break;
  1000. l.href = aLink;
  1001. break;
  1002. case '9pan.net':
  1003. l.href = '/down-' + l.pathname.match(/\d+/) + '.html';
  1004. break;
  1005. case 'xddisk.com':
  1006. case 'nyhx.com':
  1007. chkDU();
  1008. document.body.oncontextmenu = null;
  1009. forceHide('#dl_tips,.adv_box,marquee');
  1010. forceShow('#dl_addr');
  1011. break;
  1012. case '9ku.com':
  1013. forceHide ('#LR2,#LR3,#seegc,.dongDown');
  1014. jPlayerPatcher (function (media) {
  1015. $('.ringDown').html($('<a>').attr('href', media.mp3 || media.m4a)
  1016. .text('下载: ' + $('#play_musicname').text()));
  1017. });
  1018. break;
  1019. case '565656.com':
  1020. // Let's monkey patch jPlayer xD
  1021. jPlayerPatcher (function (media) {
  1022. $('.play-info-otheropt > a:last').attr('href', media.mp3 || media.m4a)
  1023. .find('span').text('下载: ' + media.songname + ' - ' + media.singername);
  1024. });
  1025. break;
  1026. case 'djye.com':
  1027. $('#djInfo').bind('DOMSubtreeModified', function () {
  1028. var a = $('a[href^="/down.html"]').attr('href', win.firstplay);
  1029. a.attr('title', '下载: ' + $('#play_musicname').text()).css({
  1030. 'background': 'url(/images/mp3_down.gif)',
  1031. 'padding': '3px 0 5px 9px'
  1032. }).find('img').remove();
  1033. a.clone().css({
  1034. 'background-position': '-184px',
  1035. 'padding': '3px 0 5px 34px'
  1036. }).insertAfter(a);
  1037. log($('a[title^="下载:"]'));
  1038. });
  1039. break;
  1040. case 'djcc.com':
  1041. var a = $('#formusicbox'),
  1042. b = a.clone().insertAfter(a);
  1043. a.parent().animate({
  1044. 'height': '+=27'
  1045. }, 1000);
  1046. b.removeAttr('onclick').text('下载该曲').css({
  1047. 'background-color': 'lightgrey'
  1048. });
  1049. $('.playbox .playstate').bind('DOMSubtreeModified', function () {
  1050. var song = win.jwplayer(win._$[16]).getPlaylistItem();
  1051. b.attr('title', '下载: ' + song.title).attr('href', song.file);
  1052. });
  1053. // Ad.Kill
  1054. $('.left').animate({
  1055. 'width': '0'
  1056. }, 1000, function () {
  1057. $(this).remove();
  1058. });
  1059. $('.left').animate({
  1060. 'width': '0'
  1061. }, 1000, function () {
  1062. $(this).remove();
  1063. });
  1064. $('.center').css({
  1065. 'margin-top': '12px',
  1066. 'margin-left': '240px'
  1067. });
  1068. $('.p3').css('background', 'none');
  1069. $('.right').animate({
  1070. 'width': '0',
  1071. 'left': '310'
  1072. }, 1000, function () {
  1073. $(this).remove();
  1074. });
  1075. $('[class*="banner"]').remove();
  1076. $('#playlistads').remove();
  1077. break;
  1078. // 短链接
  1079. case 'ref.so':
  1080. safeJump($('#btn_open a').attr('href'));
  1081. break;
  1082. case 'upan.so':
  1083. var selector = 'img[src*="liulan.jpg"]';
  1084. waitUnTil(function () {
  1085. return $(selector).length;
  1086. }, function () {
  1087. safeJump($(selector).parent().attr('href'));
  1088. });
  1089. break;
  1090. case 'dc2.us':
  1091. case 't00y.com':
  1092. var selector = '#skip_button, #downloadlist a';
  1093. waitUnTil(function () {
  1094. return $(selector).length;
  1095. }, function () {
  1096. $('iframe, embed, object').remove();
  1097. forceHideFrames();
  1098. clearCookie();
  1099. if (!safeJump($(selector).attr('href')) && win.jumpToURL)
  1100. win.jumpToURL();
  1101. });
  1102. break;
  1103. default:
  1104. // log ('该域名未获得匹配,请联系作者修正该问题!');
  1105. // Do nothing.
  1106. }
  1107. }, 1);
  1108. });
  1109. document.addEventListener('readystatechange', function () {
  1110. console.log('readystatechange: ' + document.readyState);
  1111. if (document.readyState != 'complete')
  1112. return;
  1113. log('网页已完整加载。');
  1114. switch (dhost) {
  1115. case "87pan.com":
  1116. case "bpan.net":
  1117. $('script,.view-gg,#view-gg').remove();
  1118. break;
  1119. case 'duole.com':
  1120. var a = $('#player_right .last'),
  1121. b = a.clone();
  1122. $('#player_right').animate({
  1123. 'width': '+=32'
  1124. }, 500);
  1125. $('a.music_info').css({
  1126. 'cursor': 'text'
  1127. }).bind('DOMAttrModified', function () {
  1128. if (this.hasAttribute('href'))
  1129. this.removeAttribute('href');
  1130. }).removeAttr('href');
  1131. b.insertBefore(a.prev()).removeClass('last').css({
  1132. 'width': '0',
  1133. 'display': 'inline',
  1134. 'background-position': '-150px -104px'
  1135. }).css(makeRotateCss(90)).animate({
  1136. 'width': '+=32'
  1137. }, 500).attr('target', '_blank');
  1138. var oldPlayNew = win.duolePlayer.playNew, rollid;
  1139. win.duolePlayer.playNew = function (t, n) {
  1140. b.attr({
  1141. href: t,
  1142. title: '单击下载: ' + this.curMusic.song_name,
  1143. // Firefox 下会因为不是同一域名而不让用指定的名字 && 提示下载 orz
  1144. download: this.curMusic.song_name + ' [' + this.curMusic.album_name + '] - '
  1145. + this.curMusic.singer_name + '.mp3'
  1146. });
  1147. win.remind.resolve({
  1148. type: rollid = rollid ? 0 : 8,
  1149. uid: 0,
  1150. id: 0,
  1151. param: {
  1152. },
  1153. msg: this.curMusic.song_name + ' [' + this.curMusic.album_name + '] - '
  1154. + this.curMusic.singer_name + '.mp3'
  1155. });
  1156.  
  1157. return oldPlayNew(t, n);
  1158. };
  1159. break;
  1160. case '1ting.com':
  1161. log('1ting 解析启动 :: ' + '等待播放器加载');
  1162. waitUnTil('yiting', function () {
  1163. log('1ting 解析启动 :: ' + '播放器加载完毕,开始函数绑定…');
  1164. var getCurrentSongLink = function () {
  1165. return win.yiting.player.entity.Source;
  1166. }
  1167. // 防止下方函数绑定失效
  1168. win.$YV.down = function () {
  1169. l.href = getCurrentSongLink();
  1170. }
  1171. win.yiting.player.hook('play', function () {
  1172. $('.songact a.down').attr('href', getCurrentSongLink())
  1173. .removeAttr('onclick').css('border', '1px lightgrey dashed');
  1174. });
  1175. // 启动时强制刷新下载地址
  1176. win.yiting.player.hook('play');
  1177. log('1ting 解析启动 :: ' + '绑定完毕,单击原始下载按钮即可下载。');
  1178. });
  1179. break;
  1180. case "ctdisk.com":
  1181. case "pipipan.com":
  1182. case "400gb.com":
  1183. case "bego.cc":
  1184. log('开始执行 城通 旗下网盘系列简化验证码。');
  1185. setTimeout (function () {
  1186. win.$.fn.size = function () { return this.length || 'Patched' };
  1187. forceHide ('.kk_xshow,div.span6:first-child');
  1188. $('.captcha').hide('slow');
  1189. $('.captcha_right').css('float', 'left');
  1190. $('#vfcode:first').parent()
  1191. .append(createNumPad(4, $('#randcode')[0], function () {
  1192. $('[name="user_form"]').submit();
  1193. return true;
  1194. }));
  1195. log('Finish 城通 旗下网盘系列简化验证码。');
  1196. }, 10);
  1197. break;
  1198. case "xiami.com":
  1199. win.player_download = function (sId) {
  1200. // 读取原始歌曲地址
  1201. var SongUrl = $($.ajax({
  1202. type: 'GET',
  1203. url: '/song/playlist/id/' + sId.songId + '/object_name/default/object_id/0',
  1204. cache: true,
  1205. /* 从缓存读,反正如果没记录可以跑到服务器找 */
  1206. async: false
  1207. }).responseText).find('location').html();
  1208. log('虾米解析 :: 歌曲ID [ ' + sId + ' ] :: 解密地址 :: ' + SongUrl);
  1209. // 开始解密...
  1210. SongUrl = (function (sLocation) {
  1211. var num = Number(sLocation.charAt(0)),
  1212. inp = sLocation.substr(1),
  1213. iLe = inp.length % num,
  1214. a = 0,
  1215. ret = '',
  1216. arr = [];
  1217. for (var i = 0; i < num; i++) {
  1218. arr[i] = (iLe > i ? 1 : 0) + (inp.length - iLe) / num;
  1219. }
  1220. for (var i = 0; i < arr[1]; i++) {
  1221. a = 0;
  1222. for (var j = 0; j < num; j++) {
  1223. ret += inp.charAt(a + i);
  1224. a += arr[j];
  1225. }
  1226. }
  1227. return unescape(ret.substr(0, inp.length)).replace(/\^/g, '0').replace(/\+/g, ' ');
  1228. })(SongUrl);
  1229. log('虾米解析 :: 歌曲ID [ ' + sId + ' ] :: 开启窗口 :: ' + SongUrl);
  1230. // 开启窗口...
  1231. win.open(SongUrl);
  1232. };
  1233. break;
  1234. case "dbank.com":
  1235. case "vmall.com":
  1236. win.adSend = eFunc;
  1237. function eI(aList, t, fCallback) {
  1238. var fId = false,
  1239. ret = {};
  1240. console.log('Process: ', aList);
  1241. for (var i = 0; i < aList.length; i++) {
  1242. console.log('Check the aList[' + i + '] :: ', aList[i]);
  1243. ret = fCallback(aList[i], t);
  1244. if (ret.ret) {
  1245. console.log('URL GET :: ' + aList[i].downloadurl);
  1246. fId = aList[i].downloadurl;
  1247. break;
  1248. } else if (aList[i].childList) {
  1249. console.log('NEXT TRY: aList[' + i + '] :: ' + aList[i].childList);
  1250. fId = eI(aList[i].childList, t, fCallback);
  1251. if (fId) {
  1252. return fId
  1253. }
  1254. }
  1255. }
  1256. return fId;
  1257. }
  1258. // 下载解析
  1259. var iNv = setInterval(function () {
  1260. if (!win.dbank.securelink.downloadfile) {
  1261. return;
  1262. } // 等待初始化
  1263. clearInterval(iNv);
  1264. log('dBank 解析 :: 文件列表加载完毕。');
  1265. win.dbank.securelink.setStat = win.dbank.hsdownload.checkResourceSelected = eFunc; // dBank 特殊解析
  1266. win.dbank.securelink.downloadfile = function (ahref) {
  1267. var fList = win.globallinkdata.data.resource.files,
  1268. fId = eI(fList, ahref.id, function (l, t) {
  1269. return ((l.id == t) ? {
  1270. ret: 1
  1271. } : {})
  1272. });
  1273. if (!fId) {
  1274. prompt('无法解析其真实地址,可能因为网站改版导致脚本失效..\n\n请提交问题和发生错误的地址到下列地址:', bugRepUrl);
  1275. return;
  1276. }
  1277. var rA = win.dbank.crt.decrypt(fId, this.encrykey);
  1278. log('dBank 解析 :: ' + rA);
  1279. win.open(rA, 'CUWCL4C ' + sVer + fId);
  1280. };
  1281. // 判断是否提示需要 VIP 帐号转存
  1282. if ($('#hsdownload').length == 0) {
  1283. eI(win.globallinkdata.data.resource.files, 0, function (l) {
  1284. $('a#' + l.id).click(function () {
  1285. win.dbank.securelink.downloadfile(this);
  1286. })
  1287. .attr('href', 'javascript:void(0);');
  1288. });
  1289. } else {
  1290. // 高速下载按钮拦截
  1291. ubA($('#hsdownload')[0]);
  1292. $('#hsdownload').click(function () {
  1293. $('#down_filelist .list-select input[type="checkbox"]').each(function () {
  1294. if ($(this).prop('checked')) {
  1295. win.dbank.securelink.downloadfile($(this).parent().parent().find('span.list-tit a[id]')[0]);
  1296. }
  1297. })
  1298. });
  1299. log('dBank 解析 :: 解析函数已绑定');
  1300. }
  1301. }, 100);
  1302. break;
  1303. case "5sing.com":
  1304. // 播放列表的下载按钮。
  1305. $('a[href*="Down.aspx?sid="]')
  1306. .each(function (i) {
  1307. $(this).attr({
  1308. 'href': win.wsplayer.playList[i].mp3,
  1309. 'title': '下载 ' + win.wsplayer.playList[i].songname,
  1310. 'target': '_blank'
  1311. })
  1312. });
  1313. break;
  1314. case 'douban.fm':
  1315. // 参考代码 豆藤, UsoId: 49911
  1316. var $a = $('<a>').css({
  1317. 'background': '#9DD6C5',
  1318. 'padding': '3px 5px',
  1319. 'color': 'white'
  1320. }).text('下载').hover(function () {
  1321. $(this).css({
  1322. 'margin-left': '5px',
  1323. 'padding-left': '10px',
  1324. 'background': '#BAE2D6'
  1325. });
  1326. }, function () {
  1327. $(this).css({
  1328. 'margin-left': '0',
  1329. 'padding-left': '5px',
  1330. 'background': '#9DD6C5'
  1331. });
  1332. }).css(makeDelayCss())
  1333. .attr('target', '_blank');
  1334. var $div = $('<div>').css({
  1335. 'float': 'right',
  1336. 'margin-top': '-230px',
  1337. 'margin-right': '-32px',
  1338. 'font-weight': 'bold',
  1339. 'font-family': '微软雅黑'
  1340. }).append($a).insertAfter('.player-wrap');
  1341. log('等待豆瓣电台加载…');
  1342. waitUnTil('extStatusHandler', function () {
  1343. log('豆瓣电台加载完毕! 开始绑定函数…');
  1344. var oldExtStatusHandler = win.extStatusHandler;
  1345. win.extStatusHandler = function (p) {
  1346. var a = JSON.parse(p);
  1347. if ('start' == a.type && a.song) {
  1348. $a.attr('href', a.song.url)
  1349. .attr('title', '右键另存下载: ' + a.song.title);
  1350. log(a.song.title + ' :: ' + a.song.url);
  1351. }
  1352. return oldExtStatusHandler(p);
  1353. }
  1354. log('函数绑定完毕, Enjoy~');
  1355. });
  1356. break;
  1357. }
  1358. }, false);
  1359. })();
  1360. /*
  1361. * 简单成就下载 by Yulei 本脚本只作学习研究参考用,版权所有 不得滥用、它用,后果自负
  1362. *
  1363. * Chrome 兼容 + 加强 by jixun66
  1364. * 个人修正内容请参考:
  1365. * http://userscripts.org/scripts/show/157621#full_description
  1366. *
  1367. */