Bypass Wait, Code, & Login For Chrome

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

Verze ze dne 04. 05. 2014. Zobrazit nejnovější verzi.

  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.13
  15. // @create 2012-01-26
  16. // @lastmodified 2014.05.04
  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://*.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 (funcCallback){
  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. var bPassTest = chk.test (l.href);
  370. return bPassTest ?
  371. (funcCallback || reDirWithRef)(l.href.replace (chk, '/$1down$3')) : false;
  372. },
  373. // 插入样式表
  374. injStyle = function (s) {
  375. var st = cE('style');
  376. st.innerHTML = s;
  377. d.body.appendChild(st);
  378. return st;
  379. },
  380. // 强制隐藏/显示某些元素
  381. forceHide = function (what){ injStyle(what + ' { display: none !important }'); },
  382. forceShow = function (what){ injStyle(what + ' { display: block !important }'); },
  383. // 强制隐藏框架
  384. forceHideFrames = function (){ forceHide('iframe, frameset, frame');},
  385. // 移除站外链接
  386. clearOutsiteLink = function () {
  387. $('a').not('[href*="' + dhost + '/"],[href*="#"],[href^="j"],[href^="/"]').remove();
  388. },
  389. // 通用 jPlayer 注入
  390. jPlayerPatcher = function (callback, namespace) {
  391. // 默认为 jPlayer
  392. if (!namespace) namespace = 'jPlayer';
  393. log ('[-] Waiting for jPlayer to load...');
  394. waitUnTil(function () {
  395. return win.$[namespace].prototype.setMedia;
  396. }, function () {
  397. log ('[*] Backup old function...');
  398. var oldSetMedia = win.$[namespace].prototype.setMedia;
  399. log ('[*] Hook start!');
  400. win.$[namespace].prototype.setMedia = function (newMedia) {
  401. console.log (newMedia);
  402. callback(newMedia);
  403. return oldSetMedia.apply(this, arguments);
  404. };
  405. log ('[+] Hook finish, enjoy~');
  406. });
  407. };
  408.  
  409. // DOMContentLoaded
  410. $(function () {
  411. log('进入 DOMContentLoaded 事件。');
  412. log('域名判断: ' + dhost);
  413.  
  414. // HOOK STAGE 1
  415. var continueScript = false;
  416. switch (l.hostname.toLowerCase()) {
  417. case 'yun.baidu.com':
  418. case 'pan.baidu.com':
  419. // 因为度娘知道自己的所谓云管家不能在非 Windows 下运行
  420. // 因此识别器更改为非 Win32 即可绕过云管家提示。
  421. win.navigator.__defineGetter__ ('platform', function () {return 'Cracked by Jixun ^^';});
  422. break;
  423.  
  424. default:
  425. continueScript = true;
  426. }
  427. if (!continueScript) return;
  428.  
  429. setTimeout(function () {
  430. // 域名判断开始
  431. var continueScript = false;
  432. switch (l.hostname.toLowerCase()) {
  433. default:
  434. continueScript = true;
  435. }
  436. if (!continueScript) return;
  437. switch (dhost) {
  438. // 2014.04.06
  439. case 'lepan.cc':
  440. $('#header:first').next().hide();
  441. if (/\/file|\/view/.test(l.pathname)) {
  442. reDirWithRef($('#hsdownload').attr('href'));
  443. // console.log ();
  444. // $('#hsdownload').click();
  445. return;
  446. }
  447. forceHide ('[class^="banner"],#dl_tips');
  448. forceShow ('#down_box');
  449. if ($('.dianxin>a').attr('href') == 'vip.php') {
  450. forceHide ('.content_l>.down_list_1,.file_tip');
  451. $('.talk_show').html($('.talk_show').html()
  452. .replace(/none\.png(.*?)有广告/, 'right.jpg$1搭配 ABP 插件无广告')
  453. .replace(/none\.png(.*?)无权下载/, 'right.jpg$1插件用户任意下载')
  454. );
  455. }
  456. break;
  457.  
  458. case 'kxt.fm':
  459. case 'duomi.com':
  460. wordpressAudio();
  461. break;
  462.  
  463. case 'jing.fm':
  464. waitUnTil (function () {
  465. return win.Player.player.jPlayer;
  466. }, function () {
  467. log ('jing.fm Loader Start~');
  468. var myDlBox = $('<a>').appendTo($('#mscPlr')).css({
  469. position: 'absolute',
  470. right: 0,
  471. zIndex: 9
  472. }).attr('target', '_blank').text('下载');
  473. win.Player.player.bind(win.$.jPlayer.event.loadstart, function (eve) {
  474. myDlBox.attr('href', eve.jPlayer.status.src.replace(/\d+$/, 0));
  475. });
  476. });
  477. break;
  478. case 'colafile.com':
  479. chkDU ();
  480. forceHide ('.table_right, #down_link2, #down_link3, .tui, .ad1 > .ad1 > *');
  481. forceShow ('.ad1 > .ad1 > .downbox');
  482. break;
  483. // 通用 phpDisk 网盘
  484. case 'dxrr.com':
  485. if (chkDU(function (r) { return reDirWithRef(r.replace('v.', 'www.')); })) return;
  486. forceHide ('.ad,#vcode,#tui,.dcode,#down_box2,#dl_tips,.nal,.scbar_hot_td,.fbtn-vip-down');
  487. forceShow ('#down_box,#dl_addr');
  488. break;
  489. case '2kuai.com':
  490. case '32666.com': // <- 乱七八糟广告就属它最多
  491. /* case "gxp.cc": */
  492. if (chkDU()) return;
  493. forceHide ('.ad,#vcode,#tui,.dcode,#down_box2,#dl_tips,.nal,.scbar_hot_td');
  494. forceShow ('#down_box,#dl_addr');
  495. break;
  496. case 'sudupan.com':
  497. var tU = lurl.replace(/\/down_/i, '/sudupan/xiazai_');
  498. if (tU != lurl) l.href = tU;
  499. forceHideFrames();
  500. break;
  501. case 'yinyuetai.com':
  502. // http://www.yinyuetai.com/insite/get-video-info?videoId=[视频ID]&json=true
  503. var fetchDlUrlById = function (iId, fCallback) {
  504. log('Loading video for ' + iId);
  505. // 因为跨域, 所以 =-=
  506. /* jshint ignore:start */
  507. GM_xmlhttpRequest ({
  508. method: 'GET',
  509. url: 'http://www.yinyuetai.com/insite/get-video-info?json=true&videoId=' + iId,
  510. onload: function (u) {
  511. var r = JSON.parse (u.responseText);
  512. fCallback (r.videoInfo.coreVideoInfo.videoUrlModels, r.videoInfo.coreVideoInfo.videoName);
  513. },
  514. onerror: function (r) {
  515. fCallback (false);
  516. }
  517. });
  518. /* jshint ignore:end */
  519. };
  520. var $appTo, $ap1After2, $display = '',
  521. eDiv = $('<div>'),
  522. appendDlLinks = function (dlLinks, videoTitle) {
  523. if (dlLinks === false) {
  524. console.error('解析失败! ID: ', currentVideoId);
  525. return;
  526. }
  527. eDiv.css ({
  528. color: 'white',
  529. 'font-size': 'small',
  530. 'margin-left': '7px'
  531. });
  532. eDiv.html('下载: ').css('display', $display);
  533. dlLinks.forEach(function (e) {
  534. $('<a>').text(e.QualityLevelName).attr('href', e.videoUrl)
  535. .attr('title', '下载: ' + videoTitle).appendTo(eDiv)
  536. .addClass ('c_cf9');
  537. eDiv.append(' | ');
  538. });
  539. eDiv.append('提供: CUWCL4C ' + sVer);
  540. if ($ap1After2 == 1)
  541. $appTo.append (eDiv);
  542. else // 2
  543. $appTo.after (eDiv);
  544. // $('#download').href = dlLink;
  545. }
  546. if (/^\/video/i.test(l.pathname)) {
  547. // Signal
  548. var currentVideoId = parseInt(l.pathname.match(/\d+/)[0]);
  549. $appTo = $('.vchart'); $ap1After2 = 2;
  550. fetchDlUrlById(currentVideoId, appendDlLinks);
  551. } else {
  552. $ap1After2 = 1;
  553. $display = 'inline';
  554. waitUnTil (function () {
  555. return $('.J_mv_content').length;
  556. }, function () {
  557. $('.J_mv_content').on('DOMSubtreeModified', function () { setTimeout (function () {
  558. log ('> Switch');
  559. $appTo = $('<div>').css('display', $display).appendTo('.J_video_info');
  560. fetchDlUrlById(($('.J_video_info a[href*="video/"]').attr('href').match (/\d+(\/|)$/)||[])[0], appendDlLinks);
  561. }, 10);});
  562. });
  563. }
  564. break;
  565. case 'renren.com':
  566. waitUnTil(function () {
  567. return win.XN.APP.WebRadioNotlogin.player.getPlayer();
  568. }, function () {
  569. // 插入播放按钮
  570. var dlLink = $('<a>').attr('title', '单击下载').css(makeRotateCss(90)).css({
  571. 'width': '38px',
  572. 'height': '36px',
  573. 'background-position': '-4px -820px',
  574. 'margin-top': '-2px'
  575. }).attr('href', win.XN.APP.WebRadioNotlogin.player.getPlayer().getAttribute('src'))
  576. .insertBefore($('.operation #lrc'));
  577.  
  578. var oldPlay = win.XN.APP.WebRadioNotlogin.player.play;
  579. win.XN.APP.WebRadioNotlogin.player.play = function (url, f0) {
  580. console.warn(arguments);
  581. var ret = oldPlay.apply(win.XN.APP.WebRadioNotlogin.player, arguments);
  582. dlLink.attr('href', url);
  583. return ret;
  584. };
  585. });
  586. break;
  587. case 'qq.com':
  588. log('Waiting for fmQQ...');
  589. waitUnTil(function () {
  590. return (typeof (win.$.qPlayer.player.playUrl) == 'function');
  591. }, function () {
  592. log('fmQQ Hook start!');
  593. // CreateDLButton
  594. var dlLink = $('<a>').css(makeRotateCss(90)).css({
  595. 'background-position': '-24px -73px'
  596. });
  597. $('.btn_del').after(dlLink);
  598. var firstRun = true;
  599. oldPlayurl = win.$.qPlayer.player.playUrl;
  600. win.$.qPlayer.player.playUrl = function (songUrl) {
  601. dlLink.attr('href', songUrl).attr('title', '单击下载: ' + win.$.qPlayer.playList.getSongInfoObj().msong);
  602. // 第一次为程序模拟解析, 所以不需要经过 oldPlayurl 路线
  603. if (firstRun)
  604. return (firstRun = 0);
  605. return oldPlayurl(songUrl);
  606. };
  607. win.$.qPlayer.player.playUrl(win.$.qPlayer.playList.getSongInfoObj().songurl);
  608. log('fmQQ Hook finish!');
  609. });
  610. break;
  611. case 'moe.fm':
  612. waitUnTil('playerInitUI', function () {
  613. // 登录破解
  614. win.is_login = true;
  615. log('fmMoe Hook start!!');
  616. var dlLink = $('<a>').addClass('player-button left').css(makeRotateCss(90)).css({
  617. 'width': '26px',
  618. 'background-position': '-19px -96px'
  619. });
  620. $('div.player-button.button-volume').first().after(dlLink);
  621. var oldPlayerInitUI = win.playerInitUI;
  622. win.playerInitUI = function (a) {
  623. dlLink.attr('href', a.completeUrl).attr('title', '单击下载: ' + a.title);
  624. log(a);
  625. return oldPlayerInitUI(a);
  626. };
  627. log('fmMoe Hook finish!!');
  628. });
  629. break;
  630. case "dbank.com":
  631. case "vmall.com":
  632. // 页面整理。
  633. $('#c_footer, #filelist_marker, div.link-left .panel-line, div[id^="ad_"], .panel-recommended, #hotkw, p.copyright-tips').remove();
  634. break;
  635. case "vdisk.cn":
  636. forceShow('#btnbox');
  637. forceHide('#loadingbox, #yanzhengbox, #yzmbox, #ShowDIV, ifarme');
  638. // 清理乱七八糟的链接
  639. clearOutsiteLink();
  640. break;
  641. case "qjwm.com":
  642. case "7958.com":
  643. if (l.href.toLowerCase().indexOf("down_") > 0) l.href = lurl.replace(/down_/i, 'download_');
  644. forceHide('#downtc,[id^="cpro_"],.download_alert,#inputyzm,#house,#uptown,a[href$="money.html"],a[href$="reg.html"]');
  645. forceShow('#downtc2,.new_down');
  646. waitUnTil('authad', function () {
  647. win.authad = win.bdshow = win.scrollTo = tFunc;
  648. });
  649. break;
  650. case "rayfile.com":
  651. //Feisu-Rayfile,nextpag,showdown
  652. if (win.vkey) {
  653. l.href = lurl + win.vkey;
  654. } else {
  655. win.filesize = 100;
  656. win.showDownload();
  657. win.showDownload = eFunc; // 防止 7 秒后按钮被覆盖。
  658. // 天知道这个错误怎么来的.. 语言错误就显示不了下载按钮..
  659. $('#downloadlink').addClass('btn_downNow_zh-cn');
  660. $('#vodlink').addClass('btn_downTools_zh-cn');
  661. // 整理页面
  662. $('div.left, iframe').remove();
  663. }
  664. break;
  665. case "songtaste.com":
  666. // SongTaste,Source-Code by (inc/common.js)
  667. // By Yulei 2012.11.30 ;Remove register and login tips.
  668. // Simplify Code + Simulate Official site action + Chrome Fix.
  669. var cssCode = {
  670. 'font-size': '15px',
  671. 'color': '#fff',
  672. 'background-color': '#000',
  673. 'text-decoration': 'none',
  674. 'padding': '3px 5px'
  675. };
  676. var sId = $_GET.song_id;
  677.  
  678. if (!sId) {
  679. if (lurl.toLowerCase().indexOf('/album/') != -1) {
  680. // 专辑页面功能添加
  681. log('ST :: 专辑页面调整');
  682. var btn_playAll = $('[value="连续播放"]');
  683. var btn_noPopPlay = btn_playAll.clone().attr({
  684. 'value': '不弹窗播放',
  685. 'onclick': ''
  686. });
  687. btn_noPopPlay.click(function () {
  688. var id = "",
  689. arr = win.chkArray;
  690. for (i = 0; i < arr.length; i++) {
  691. if (arr[i].checked) {
  692. id += arr[i].value + ",";
  693. }
  694. }
  695. if (id.length > 1) {
  696. id = id.sub(1);
  697. l.href = "/playmusic.php?song_id=" + id;
  698. } else {
  699. alert("请选择歌曲");
  700. }
  701. });
  702. btn_playAll.after(btn_noPopPlay);
  703. return;
  704. }
  705. log('ST :: 单曲模式解析');
  706. var Args = $("#playicon a")[0].href.replace(/ /g).replace(/\"/g, "'").split('\'');
  707. var sURL = Args[5],
  708. sType = Args[11],
  709. sHead = Args[13],
  710. songId = Args[15],
  711. sTime = ((new RegExp(/,(\d+)\)/).exec(Args[16]) || [, '0'])[1]),
  712. SongUrl;
  713.  
  714. if (sURL.indexOf('rayfile') > 0) {
  715. SongUrl = sHead + sURL + win.GetSongType(sType);
  716. } else {
  717. SongUrl = $.ajax({
  718. type: 'POST',
  719. url: '/time.php',
  720. cache: true,
  721. /* 从缓存读,反正如果没记录可以跑到 ST 服务器下 */
  722. async: false,
  723. data: 'str=' + sURL + '&sid=' + songId + '&t=' + sTime,
  724. dataType: 'html',
  725. }).responseText;
  726. }
  727. $('a#custom_2').attr({
  728. 'href': SongUrl,
  729. 'title': 'Cracked By jixun66'
  730. }).css(cssCode).text('音乐直链');
  731. return false;
  732. } else {
  733. // 下载解析 - Hook 更换歌曲的函数,避免重复读取歌曲 + 不需要多次请求服务器不容易掉线。
  734. log('ST :: 列表模式解析');
  735. win.changeSong_e = win.changeSong;
  736. win.changeSong = function (a1, a2, a3) {
  737. // 2013.03.19 & 2013.04.09 修正:
  738. // 已经删除的歌曲自动跳到下一曲
  739. if (!a1.trim()) {
  740. win.pu.doPlayNext(2);
  741. return;
  742. }
  743. log('请求歌曲 :: ' + a1 + ' :: ' + a2);
  744. $('#dl_Link').attr({
  745. 'href': a2,
  746. 'title': a1
  747. });
  748. document.title = 'ST - ' + a1;
  749. // 转接给原函数
  750. win.changeSong_e(a1, a2, a3);
  751. };
  752. win.downSong = function () {
  753. win.open(win.theSongUrl);
  754. };
  755. $('div#left_music_div div.p_fun a:eq(2)').css(cssCode)
  756. .text('直链下载').attr({
  757. 'id': 'dl_Link',
  758. 'target': '_blank'
  759. });
  760. // 2013.03.19 添加:
  761. // 重建播放列表地址
  762. $('p.p_list_txt').append($('<a>').text('重建播放列表').click(function () {
  763. l.href = '?song_id=' + win.arr_ids.join(',');
  764. }).css({
  765. 'cursor': 'pointer'
  766. }));
  767. log('ST :: 等待网页加载...');
  768. var iNv = setInterval(function () {
  769. if (!win.pu.doPlayNext) {
  770. return;
  771. }
  772. log('ST :: 官方播放器删除功能修正启动');
  773. // 修正播放器删除代码错误 :: 开始
  774. win.pu.doPlayNext = function (t) {
  775. var now, avl, i;
  776. for (i = 0; i < win.arr_ids.length; i++) {
  777. if (win.arr_ids[i] == win.cur_sid) {
  778. now = i;
  779. break;
  780. }
  781. }
  782. // 寻找下一首未删除的歌曲。
  783. // * 2013.01.29 修正
  784. // 1. 上一首查找失败的情况下会滚回到当前音乐的错误。
  785. // 2. 如果没有可听歌曲情况下无限循环的错误。
  786. now = Math.abs((now || 0) + t);
  787. avl = 0;
  788. // 检查是否有歌曲剩余
  789. for (i = 0; i < win.arr_ids.length; i++) {
  790. if (win.arr_ids[i]) {
  791. avl++;
  792. }
  793. }
  794. if (avl === 0) {
  795. alert('歌都被删光了还听啥...');
  796. return;
  797. }
  798. // 寻找空位
  799. while (true) {
  800. if (win.arr_ids[now]) {
  801. log('切换歌曲 :: ' + now.toString());
  802. win.pu.utils(now);
  803. win.cur_sid = win.arr_ids[now];
  804. win.playSongRight();
  805. return;
  806. }
  807. now += t >= 0 ? 1 : -1;
  808. if (win.arr_ids.length <= now) {
  809. now = 0;
  810. }
  811. if (now < 0) {
  812. now = win.arr_ids.length;
  813. }
  814. }
  815. };
  816. win.delSongDiv = function (songid, isbox) {
  817. log('删除歌曲 :: ' + songid.toString());
  818. $('#' + songid).hide();
  819. var new_songlist = [];
  820. for (var i = 0; i < win.arr_ids.length; i++) {
  821. if (win.arr_ids[i] == songid) {
  822. if (songid == win.cur_sid)
  823. win.pu.doPlayNext(1);
  824. win.arr_ids[i] = 0;
  825. }
  826. }
  827. };
  828.  
  829. // 修正播放器删除代码错误 :: 结束
  830. log('ST :: 官方播放器删除功能修正结束');
  831. clearInterval(iNv);
  832. }, 100);
  833. }
  834. break;
  835. case "oyinyue.com":
  836. if (l.href.toLowerCase().indexOf("/down.") > 0) {
  837. alert ('請返回音樂頁解析音樂, 此處腳本不負責解析… orz');
  838. break;
  839. }
  840.  
  841. waitUnTil (function () {return win.player.getUrl (); }, function () {
  842. $('a[href*="/Down."]').attr({
  843. 'href': win.player.getUrl(),
  844. 'target': '_blank'
  845. }).html('<b/>直链下载');
  846. });
  847. break;
  848. case "5sing.com":
  849. //By Yulei 2012.11.27
  850. // Easy way of getting the link url: by jixun
  851. if (l.href.toLowerCase().indexOf("down") > 0) {
  852. if (confirm('单击确定返回到歌曲信息页面解析下载地址。')) {
  853. var urls = lurl.replace(/down\.aspx\?sid\=/i, '');
  854. l.href = urls + ".html";
  855. }
  856. break;
  857. }
  858. var $dl = $('<a>')
  859. .append($('<span>').text('>> 直链下載 <<'))
  860. .insertAfter ($('.zhe>.sup>span,.play>.play_intro_tit>h1,.mc_info_tit>h1').first())
  861. .attr('target', '_blank');
  862. waitUnTil (function () {
  863. return win.$wsp.mediaHelper.createPlugin;
  864. }, function () {
  865. console.log ('Hook 啓動~');
  866. var oldCreatePlugin = win.$wsp.mediaHelper.createPlugin;
  867. win.$wsp.mediaHelper.createPlugin = function (src) {
  868. console.log ('下載地址: %s', src);
  869. $dl.attr('href', src);
  870. return oldCreatePlugin.apply (this, arguments);
  871. };
  872.  
  873. if (win.wplayer.playList.length) {
  874. $dl.attr('href', win.wplayer.playList[0].file);
  875. $('a[href^="/down/"]').attr ({
  876. href: win.wplayer.playList[0].file
  877. }).html('<b/>直链下载');
  878. }
  879. });
  880. break;
  881. case "it168.com":
  882. forceHide('.right_four,#wanyxShowAD');
  883. $("#download").html ('').append($('<a>').attr({
  884. href: $('.sign11.four_li1>a').attr('href'),
  885. class: 'sign11'
  886. }).css({
  887. paddingLeft: '2em',
  888. color: '#fff'
  889. }).text('点我下载'));
  890. break;
  891. case '119g.com':
  892. var reg = /^(\/f\/[a-z0-9]+)(_bak|)/i;
  893. if (!reg.test(location.pathname))
  894. return;
  895. var mat = location.pathname.match(reg) || [, '', ''];
  896. if (!mat[2])
  897. location.pathname = mat[1] + '_bak.html';
  898. break;
  899. case "yimuhe.com":
  900. // yimuhe ,Vcode,8s,By Yulei 2012.12.26
  901. // Make it easy by jixun66
  902. // /n_dd.php?file_id=476136&userlogin=niuge&ser=1
  903. chkDU();
  904. forceShow('#yzm');
  905. forceHide('#loading');
  906. $('.w632').css({height:368});
  907. var oldDL;
  908. $('#yzm>form')
  909. .append(createNumPad(4, '#code', function () {
  910. $('#yzm>form>input[name="Submit"]').click();
  911. setTimeout (function () {
  912. $('#download:visible>a:last').click();
  913. }, 200);
  914. return 1;
  915. }, function () {
  916. $('#vcode_img').click();
  917. }));
  918. if (!l.pathname.indexOf('/n_dd.php')) {
  919. forceHide('.ggao');
  920. reDirWithRef($('#downs').attr('href'));
  921. }
  922. break;
  923. case "djkk.com":
  924. // 参考 Music liker for Beauty 代码,感谢 @yulei
  925. var pl4 = document.getElementsByClassName('play_4')[0],
  926. rmp3 = win.list[0].m4a.replace(/mp\./, 'do.').replace(/m4a/g, 'mp3'),
  927. myStyle = 'background: transparent url("/images/p_down.gif") no-repeat left center; height:15px; width:15px;';
  928. if (/img/g.test(pl4.innerHTML)) {
  929. pl4.innerHTML = "<a href='" + win.list[0].m4a + "' style='color:blueviolet' target='_blank' title='试听音乐下载 - Cracked By Yulei'><b style='" + myStyle + "'> </b>普通</a>";
  930. pl4.innerHTML += "<a href='" + rmp3 + "' title='高品质音乐下载 - Cracked By Yulei' target='_blank'><b style='" + myStyle + "'> </b>高清</a>";
  931. pl4.style.width = "82px";
  932. document.getElementsByClassName('play_2')[0].style.display = "none";
  933. }
  934. break;
  935. case 'kuaipan.cn':
  936. // 火狐下失效 囧…
  937. //waitUnTil('CONST', function () {
  938. // win.CONST.Token = win.CONST.Token || 'Patched By Jixun ^^';
  939. //});
  940. // 金山快盘免登录下载解析
  941. $('#jQrcodeDownload')
  942. .attr ('class', 'imitate-btn f16 btn-blue l')
  943. .text('免登录下载');
  944. $('#jQrcodebox').html ('免登录下载已开始,请等待下载提示...');
  945. $('#qrcode').remove();
  946. $('<div>').attr('id', 'qrcode').appendTo (body);
  947. win.encodeURIComponent_e = win.encodeURIComponent;
  948. win.encodeURIComponent = function (a1) {
  949. if (a1.toString().indexOf('/getdl?') >= 0) {
  950. l.href = a1.toString();
  951. $('.ui-dialog-title').text('Patched By Jixun');
  952. return false;
  953. }
  954. return win.encodeURIComponent_e (a1);
  955. };
  956. break;
  957. case 'howfile.com':
  958. forceHide ('#floatdiv div');
  959. injStyle ('#floatdiv {top: 150px; z-index: 99999; display: block !important;}');
  960. $('iframe,script,.row1_right').remove();
  961. break;
  962. case '79pan.com':
  963. chkDU();
  964. $('iframe, #code_box, #down_box2').remove();
  965. $('#down_box').show();
  966. break;
  967. case "87pan.com":
  968. chkDU();
  969. $('script,.view-gg,#view-gg').remove();
  970. break;
  971. case "azpan.com":
  972. chkDU();
  973. document.onkeydown = eFunc;
  974. $('script, iframe').remove();
  975. forceHide ('a[id*="Union"]');
  976. break;
  977. case "dd.ma":
  978. var aLink = $('#btn_open a.link1').attr('href');
  979. if (!aLink)
  980. break;
  981. l.href = aLink;
  982. break;
  983. case '9pan.net':
  984. l.href = '/down-' + l.pathname.match(/\d+/) + '.html';
  985. break;
  986. case 'xddisk.com':
  987. case 'nyhx.com':
  988. chkDU();
  989. document.body.oncontextmenu = null;
  990. forceHide('#dl_tips,.adv_box,marquee');
  991. forceShow('#dl_addr');
  992. break;
  993. case '9ku.com':
  994. forceHide ('#LR2,#LR3,#seegc,.dongDown');
  995. jPlayerPatcher (function (media) {
  996. $('.ringDown').html($('<a>').attr('href', media.mp3 || media.m4a)
  997. .text('下载: ' + $('#play_musicname').text()));
  998. });
  999. break;
  1000. case '565656.com':
  1001. // Let's monkey patch jPlayer xD
  1002. jPlayerPatcher (function (media) {
  1003. $('.play-info-otheropt > a:last').attr('href', media.mp3 || media.m4a)
  1004. .find('span').text('下载: ' + media.songname + ' - ' + media.singername);
  1005. });
  1006. break;
  1007. case 'djye.com':
  1008. $('#djInfo').bind('DOMSubtreeModified', function () {
  1009. var a = $('a[href^="/down.html"]').attr('href', win.firstplay);
  1010. a.attr('title', '下载: ' + $('#play_musicname').text()).css({
  1011. 'background': 'url(/images/mp3_down.gif)',
  1012. 'padding': '3px 0 5px 9px'
  1013. }).find('img').remove();
  1014. a.clone().css({
  1015. 'background-position': '-184px',
  1016. 'padding': '3px 0 5px 34px'
  1017. }).insertAfter(a);
  1018. log($('a[title^="下载:"]'));
  1019. });
  1020. break;
  1021. case 'djcc.com':
  1022. var a = $('#formusicbox'),
  1023. b = a.clone().insertAfter(a);
  1024. a.parent().animate({
  1025. 'height': '+=27'
  1026. }, 1000);
  1027. b.removeAttr('onclick').text('下载该曲').css({
  1028. 'background-color': 'lightgrey'
  1029. });
  1030. $('.playbox .playstate').bind('DOMSubtreeModified', function () {
  1031. var song = win.jwplayer(win._$[16]).getPlaylistItem();
  1032. b.attr('title', '下载: ' + song.title).attr('href', song.file);
  1033. });
  1034. // Ad.Kill
  1035. $('.left').animate({
  1036. 'width': '0'
  1037. }, 1000, function () {
  1038. $(this).remove();
  1039. });
  1040. $('.left').animate({
  1041. 'width': '0'
  1042. }, 1000, function () {
  1043. $(this).remove();
  1044. });
  1045. $('.center').css({
  1046. 'margin-top': '12px',
  1047. 'margin-left': '240px'
  1048. });
  1049. $('.p3').css('background', 'none');
  1050. $('.right').animate({
  1051. 'width': '0',
  1052. 'left': '310'
  1053. }, 1000, function () {
  1054. $(this).remove();
  1055. });
  1056. $('[class*="banner"]').remove();
  1057. $('#playlistads').remove();
  1058. break;
  1059. // 短链接
  1060. case 'ref.so':
  1061. safeJump($('#btn_open a').attr('href'));
  1062. break;
  1063. case 'upan.so':
  1064. var upselector = 'img[src*="liulan.jpg"]';
  1065. waitUnTil(function () {
  1066. return $(upselector).length;
  1067. }, function () {
  1068. safeJump($(upselector).parent().attr('href'));
  1069. });
  1070. break;
  1071. case 'dc2.us':
  1072. case 't00y.com':
  1073. var selector = '#skip_button, #downloadlist a';
  1074. waitUnTil(function () {
  1075. return $(selector).length;
  1076. }, function () {
  1077. $('iframe, embed, object').remove();
  1078. forceHideFrames();
  1079. clearCookie();
  1080. if (!safeJump($(selector).attr('href')) && win.jumpToURL)
  1081. win.jumpToURL();
  1082. });
  1083. break;
  1084. default:
  1085. // log ('该域名未获得匹配,请联系作者修正该问题!');
  1086. // Do nothing.
  1087. }
  1088. }, 1);
  1089. });
  1090. document.addEventListener('readystatechange', function () {
  1091. console.log('readystatechange: ' + document.readyState);
  1092. if (document.readyState != 'complete')
  1093. return;
  1094. log('网页已完整加载。');
  1095. switch (dhost) {
  1096. case "87pan.com":
  1097. case "bpan.net":
  1098. $('script,.view-gg,#view-gg').remove();
  1099. break;
  1100. case 'duole.com':
  1101. var a = $('#player_right .last'),
  1102. b = a.clone();
  1103. $('#player_right').animate({
  1104. 'width': '+=32'
  1105. }, 500);
  1106. $('a.music_info').css({
  1107. 'cursor': 'text'
  1108. }).bind('DOMAttrModified', function () {
  1109. if (this.hasAttribute('href'))
  1110. this.removeAttribute('href');
  1111. }).removeAttr('href');
  1112. b.insertBefore(a.prev()).removeClass('last').css({
  1113. 'width': '0',
  1114. 'display': 'inline',
  1115. 'background-position': '-150px -104px'
  1116. }).css(makeRotateCss(90)).animate({
  1117. 'width': '+=32'
  1118. }, 500).attr('target', '_blank');
  1119. var oldPlayNew = win.duolePlayer.playNew, rollid;
  1120. win.duolePlayer.playNew = function (t, n) {
  1121. b.attr({
  1122. href: t,
  1123. title: '单击下载: ' + this.curMusic.song_name
  1124. });
  1125.  
  1126. win.remind.resolve({
  1127. type: rollid = rollid ? 0 : 8,
  1128. uid: 0,
  1129. id: 0,
  1130. param: {
  1131. },
  1132. msg: this.curMusic.song_name + ' [' + this.curMusic.album_name + '] - ' +
  1133. this.curMusic.singer_name + '.mp3'
  1134. });
  1135.  
  1136. return oldPlayNew(t, n);
  1137. };
  1138. break;
  1139. case '1ting.com':
  1140. log('1ting 解析启动 :: ' + '等待播放器加载');
  1141. waitUnTil('yiting', function () {
  1142. log('1ting 解析启动 :: ' + '播放器加载完毕,开始函数绑定…');
  1143. var getCurrentSongLink = function () {
  1144. return win.yiting.player.entity.Source;
  1145. };
  1146. // 防止下方函数绑定失效
  1147. win.$YV.down = function () {
  1148. l.href = getCurrentSongLink();
  1149. };
  1150. win.yiting.player.hook('play', function () {
  1151. $('.songact a.down').attr('href', getCurrentSongLink())
  1152. .removeAttr('onclick').css('border', '1px lightgrey dashed');
  1153. });
  1154. // 启动时强制刷新下载地址
  1155. win.yiting.player.hook('play');
  1156. log('1ting 解析启动 :: ' + '绑定完毕,单击原始下载按钮即可下载。');
  1157. });
  1158. break;
  1159. case "ctdisk.com":
  1160. case "pipipan.com":
  1161. case "400gb.com":
  1162. case "bego.cc":
  1163. log('开始执行 城通 旗下网盘系列简化验证码。');
  1164. setTimeout (function () {
  1165. // Fix Anti-ABP as it doesn't check the code.
  1166. waitUnTil ('guestviewchkform', null, function (that) {
  1167. return that.randcode && that.randcode.value.length == 4;
  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. */