Greasy Fork is available in English.

Bypass Wait, Code, & Login For Chrome

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

Per 27-05-2014. Zie de nieuwste versie.

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