Greasy Fork is available in English.

Bypass Wait, Code, & Login For Chrome

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

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

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