Greasy Fork is available in English.

Bypass Wait, Code, & Login For Chrome

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

Versión del día 15/4/2014. Echa un vistazo a la versión más reciente.

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