Bypass Wait, Code, & Login For Chrome

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

Fra og med 15.04.2014. Se den nyeste version.

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