Bypass Wait, Code, & Login For Chrome

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

目前為 2014-03-16 提交的版本,檢視 最新版本

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