Bypass Wait, Code, & Login For Chrome

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

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