Greasy Fork is available in English.

Bypass Wait, Code, & Login For Chrome

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

2014-05-06 या दिनांकाला. सर्वात नवीन आवृत्ती पाहा.

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