Bypass Wait, Code, & Login For Chrome

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

As of 2014-03-26. See the latest version.

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