Bypass Wait, Code, & Login For Chrome

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

La data de 26-03-2014. Vezi ultima versiune.

  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.3.6
  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.3.5';
  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. body = $('body')[0],
  179. numKeys = [1, 2, 3, 4, 5, 6, 7, 8, 9, 'C', '0', '←'],
  180. ubA = function (e) {
  181. e.outerHTML = e.outerHTML
  182. },
  183. cE = function (e) {
  184. return d.createElement(e);
  185. },
  186. bugRepUrl = 'https://greatest.deepsurf.us/forum/post/discussion?Discussion/ScriptID=125',
  187. log = function (a1) {
  188. console.log((arguments.length > 1) ? arguments : a1)
  189. },
  190. dhost = ((new RegExp(/(\w+\.\w+)\//).exec(l.hostname + '/') || [, ''])[1]).toLowerCase(),
  191. jprintf = jPrintf = function () {
  192. var b = arguments,
  193. d = b.length - 1,
  194. c = b[0];
  195. if (!(1 > d)) {
  196. for (var a = 1; a <= d; a++) c = c.replace(RegExp("(\\$|%)" + a, "g"), b[a]);
  197. return c
  198. }
  199. },
  200. $_GET = getUrlParam (lurl),
  201. sUpdated = (GM_getValue('ver', '') != sVer);
  202.  
  203. function wordpressAudio () {
  204. log('WordPress Audio 插件通用代码 启动');
  205.  
  206. function fixEmbed (obj) {
  207. if (obj.hasAttribute('CUWCL4C')) return;
  208. console.log ('fixEmbed: ', obj);
  209. $('<a>').html('下载音频<br>')
  210. .attr ({
  211. href: Base64.decode(getFlashVars(obj).soundFile),
  212. target: '_blank'
  213. }).insertBefore (obj);
  214. obj.setAttribute ('CUWCL4C', '^^');
  215. }
  216.  
  217. new MutationObserver (function (e) {
  218. for (var i=0; i<e.length; i++)
  219. if (e[i].target.className == 'audioplayer_container' && e[i].addedNodes.length)
  220. fixEmbed(e[i].addedNodes[0]);
  221. }).observe ($('.post > .entry')[0], {
  222. childList: true,
  223. subtree: true
  224. });
  225. // Firefox fix.. = =
  226. $('object[id^="audioplayer_"]').each(function () { fixEmbed(this) });
  227. log('WordPress Audio 插件通用代码 结束');
  228. }
  229. function parseHTML(responseText) {
  230. // For Firefox
  231. var ret = (new DOMParser()).parseFromString(responseText, "text/html");
  232. // For Chrome
  233. if (ret == undefined) {
  234. var ret = document.implementation.createHTMLDocument("");
  235. ret.querySelector('html').innerHTML = responseText;
  236. }
  237. return ret;
  238. }
  239. function waitUnTil(ver4Check, func, replaceVar) {
  240. var timer = setInterval(function () {
  241. if (typeof (ver4Check) == 'function') {
  242. if (!ver4Check()) return;
  243. } else if (typeof (win[ver4Check]) == 'undefined') {
  244. return;
  245. }
  246. clearInterval(timer);
  247. if (replaceVar && typeof (win[ver4Check]) == 'function') {
  248. log('Function [ ' + ver4Check + ' ] Hooked.');
  249. win[ver4Check] = replaceVar;
  250. }
  251. if (typeof (func) == 'function')
  252. func();
  253. }, 30);
  254. }
  255. function makeCpfCss(name, param) {
  256. var ret = {};
  257. ret[name] = param;
  258. ['o','ms','moz','webkit'].forEach (function (e) {
  259. ret['-' + e + '-' + name] = param;
  260. });
  261. return ret;
  262. }
  263. function safeJump(sTargetUrl) {
  264. d.title = '正在跳转…';
  265. log('safeJump :: ' + sTargetUrl);
  266. if (!sTargetUrl) return false;
  267. return reDirWithRef(sTargetUrl);
  268. }
  269. function makeDelayCss(sVar) {
  270. var sP = sVar || 'all .2s';
  271. return makeCpfCss('transition', sP);
  272. }
  273. function makeRotateCss(deg) {
  274. return makeCpfCss('transform', 'rotate(' + deg + 'deg)');
  275. }
  276. function createNumPad(maxLen, targetInput, finishCallback, codeResetCallback) {
  277. if (!codeResetCallback)
  278. codeResetCallback = eFunc;
  279. var table = cE('table'),
  280. rcde = $(targetInput)[0];
  281. $(table).css({
  282. 'background-color': '#ffcc99',
  283. 'position': 'relative',
  284. 'bottom': '164px',
  285. 'left': '170px'
  286. });
  287. for (var i = 0; i < 4; i++) {
  288. var tr = cE('tr');
  289. for (var j = 0; j < 3; j++) {
  290. var td = cE('td');
  291. td.innerHTML = $(td).attr('k', numKeys[i * 3 + j]).attr('k');
  292. tr.appendChild(td);
  293. }
  294. table.appendChild(tr);
  295. }
  296. $(table).find('td').click(function () {
  297. var val = rcde.value,
  298. len = val.length,
  299. key = $(this).attr('k') || '';
  300. $(rcde).focus();
  301.  
  302. switch (key) {
  303. case '←':
  304. rcde.value = val.sub(1);
  305. break;
  306. case 'C':
  307. rcde.value = '';
  308. break;
  309. default:
  310. rcde.value += key;
  311. ++len >= maxLen
  312. && (finishCallback(rcde.value)
  313. ? $(table).hide()
  314. : codeResetCallback(), rcde.value = ''
  315. );
  316. }
  317. }).css({
  318. font: 'bold 25px Tahoma',
  319. color: 'red',
  320. cursor: 'pointer',
  321. verticalAlign: ' middle',
  322. textAlign: ' center',
  323. border: '1px solid #DDDDDD',
  324. padding: '6px',
  325. width: '40px',
  326. height: '40px'
  327. });
  328. return table;
  329. }
  330. //pajhome.org.uk/crypt/md5/md5.js
  331. log('脚本开始执行。');
  332. lurl = lurl.substr(0, (lurl + '#').indexOf('#')); // 过滤 # 后面的内容
  333. log(['调试信息如下:', dhost, lurl, $_GET]);
  334. log('脚本版本 [ ' + sVer + ' ] , 如果发现脚本问题请提交到 [ ' + bugRepUrl + ' ] 谢谢。');
  335. // 文本类扩展 :: 删除文本后方指定位数
  336. String.prototype.sub = function (n) {
  337. return this.substr(0, this.length - n);
  338. }
  339. // 空白函数, 适合腾空页面函数。
  340. function eFunc() {}
  341. function tFunc() { return !0 }
  342. function fFunc() { return !1 }
  343. // 带有引用页的跳转
  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. // 通用 jPlayer 注入
  388. function jPlayerPatcher (callback, namespace) {
  389. // 默认为 jPlayer
  390. if (!namespace) namespace = 'jPlayer';
  391. log ('[-] Waiting for jPlayer to load...');
  392. waitUnTil(function () {
  393. return win.$[namespace].prototype.setMedia;
  394. }, function () {
  395. log ('[*] Backup old function...');
  396. var oldSetMedia = win.$[namespace].prototype.setMedia;
  397. log ('[*] Hook start!');
  398. win.$[namespace].prototype.setMedia = function (newMedia) {
  399. console.log (newMedia);
  400. callback(newMedia);
  401. return oldSetMedia.apply(this, arguments);
  402. };
  403. log ('[+] Hook finish, enjoy~');
  404. });
  405. }
  406.  
  407. // DOMContentLoaded
  408. $(function () {
  409. if (sUpdated) {
  410. GM_setValue('ver', sVer);
  411. alert('\
  412. \n感谢您更新脚本 [ CUWCL4C ] 到最新版 [' + sVer + '],\
  413. \n以下为该版本的更新日志:\
  414. \n + 哦音樂 (初版)\
  415. \n * 修正 5sing 电台下载解析\
  416. \n * 修正 5sing 下载按钮被覆盖问题\
  417. \n * 修正部分音乐站子域名匹配问题 [37]\
  418. \n - 51gugu, 官方限制解除了 (?)\
  419. \n\
  420. \n ** 脚本搬到 GreasyFork 了哦 **\
  421. \n[ https://greatest.deepsurf.us/scripts/125 ]\
  422. \n\
  423. \n\
  424. \n如果发现不兼容的情况 (如: 页面错位, 功能失效)\
  425. \n或新功能建议, xx 站点的下载解析\
  426. \n欢迎提交到脚本讨论区 ≧▼≦\
  427. \n最后, 如果您喜欢该脚本还请打个 5 & 收藏, 谢谢~');
  428. }
  429. log('进入 DOMContentLoaded 事件。');
  430. log('域名判断: ' + dhost);
  431.  
  432. // HOOK STAGE 1
  433. var continueScript = false;
  434. switch (l.hostname.toLowerCase()) {
  435. case 'yun.baidu.com':
  436. case 'pan.baidu.com':
  437. // 因为度娘知道自己的所谓云管家不能在非 Windows 下运行
  438. // 因此识别器更改为非 Win32 即可绕过云管家提示。
  439. win.navigator.__defineGetter__ ('platform', function () {return 'Cracked by Jixun ^^'});
  440. break;
  441.  
  442. default:
  443. continueScript = true;
  444. }
  445. if (!continueScript) return;
  446.  
  447. setTimeout(function () {
  448. // 域名判断开始
  449. var continueScript = false;
  450. switch (l.hostname.toLowerCase()) {
  451. default:
  452. continueScript = true;
  453. }
  454. if (!continueScript) return;
  455. switch (dhost) {
  456. case 'kxt.fm':
  457. case 'duomi.com':
  458. wordpressAudio();
  459. break;
  460.  
  461. case 'jing.fm':
  462. waitUnTil (function () {
  463. return win.Player.player.jPlayer
  464. }, function () {
  465. log ('jing.fm Loader Start~');
  466. var myDlBox = $('<a>').appendTo($('#mscPlr')).css({
  467. position: 'absolute',
  468. right: 0,
  469. zIndex: 9
  470. }).attr('target', '_blank').text('下载');
  471. win.Player.player.bind(win.$.jPlayer.event.loadstart, function (eve) {
  472. myDlBox.attr('href', eve.jPlayer.status.src.replace(/\d+$/, 0))
  473. });
  474. });
  475. case 'colafile.com':
  476. chkDU ();
  477. forceHide ('.table_right, #down_link2, #down_link3, .tui, .ad1 > .ad1 > *');
  478. forceShow ('.ad1 > .ad1 > .downbox');
  479. break;
  480. // 通用 phpDisk 网盘
  481. case '2kuai.com':
  482. case '32666.com': // <- 乱七八糟广告就属它最多
  483. forceHide ('a[href*="vip"]');
  484. case 'dxrr.com':
  485. /* case "gxp.cc": */
  486. if (chkDU()) return;
  487. $('script,iframe').remove();
  488. forceHide ('.ad,#vcode,#tui,.dcode,#down_box2,#dl_tips');
  489. forceShow ('#down_box,#dl_addr');
  490. $('#ct .viewl,.nal,.scbar_hot_td').remove();
  491. break;
  492. case 'sudupan.com':
  493. var tU = lurl.replace(/\/down_/i, '/sudupan/xiazai_');
  494. if (tU != lurl) l.href = tU;
  495. forceHideFrames();
  496. break;
  497. case 'yinyuetai.com':
  498. // http://www.yinyuetai.com/insite/get-video-info?videoId=[视频ID]&json=true
  499. var fetchDlUrlById = function (iId, fCallback) {
  500. log('Loading video for ' + iId);
  501. // 因为跨域, 所以 =-=
  502. GM_xmlhttpRequest ({
  503. method: 'GET',
  504. url: "http://www.yinyuetai.com/insite/get-video-info?json=true&videoId=" + iId,
  505. onload: function (u) {
  506. var r = JSON.parse (u.responseText);
  507. fCallback(r.videoInfo.coreVideoInfo.videoUrlModels, r.videoInfo.coreVideoInfo.videoName);
  508. },
  509. onerror: function (r) {
  510. fCallback(false);
  511. }
  512. });
  513. };
  514. var $appTo, $ap1After2, $display = '',
  515. eDiv = $('<div>');
  516. function appendDlLinks(dlLinks, videoTitle) {
  517. if (dlLinks === false) {
  518. console.error('解析失败! ID: ', currentVideoId);
  519. return;
  520. }
  521. eDiv.css ({
  522. color: 'white',
  523. 'font-size': 'small',
  524. 'margin-left': '7px'
  525. });
  526. eDiv.html('下载: ').css('display', $display);
  527. dlLinks.forEach(function (e) {
  528. $('<a>').text(e.QualityLevelName).attr('href', e.videoUrl)
  529. .attr('title', '下载: ' + videoTitle).appendTo(eDiv)
  530. .addClass ('c_cf9');
  531. eDiv.append(' | ');
  532. });
  533. eDiv.append('提供: CUWCL4C ' + sVer);
  534. if ($ap1After2 == 1)
  535. $appTo.append (eDiv);
  536. else // 2
  537. $appTo.after (eDiv);
  538. // $('#download').href = dlLink;
  539. }
  540. if (/^\/video/i.test(l.pathname)) {
  541. // Signal
  542. var currentVideoId = parseInt(l.pathname.match(/\d+/)[0]);
  543. $appTo = $('.vchart'); $ap1After2 = 2;
  544. fetchDlUrlById(currentVideoId, appendDlLinks);
  545. } else {
  546. $ap1After2 = 1;
  547. $display = 'inline';
  548. waitUnTil (function () {
  549. return $('.J_mv_content').length;
  550. }, function () {
  551. $('.J_mv_content').on('DOMSubtreeModified', function () { setTimeout (function () {
  552. log ('> Switch');
  553. $appTo = $('<div>').css('display', $display).appendTo('.J_video_info');
  554. fetchDlUrlById(($('.J_video_info a[href*="video/"]').attr('href').match (/\d+(\/|)$/)||[])[0], appendDlLinks);
  555. }, 10)});
  556. });
  557. }
  558. break;
  559. case 'renren.com':
  560. waitUnTil(function () {
  561. return win.XN.APP.WebRadioNotlogin.player.getPlayer();
  562. }, function () {
  563. // 插入播放按钮
  564. var dlLink = $('<a>').attr('title', '单击下载').css(makeRotateCss(90)).css({
  565. 'width': '38px',
  566. 'height': '36px',
  567. 'background-position': '-4px -820px',
  568. 'margin-top': '-2px'
  569. }).attr('href', win.XN.APP.WebRadioNotlogin.player.getPlayer().getAttribute('src'))
  570. .insertBefore($('.operation #lrc'));
  571.  
  572. var oldPlay = win.XN.APP.WebRadioNotlogin.player.play;
  573. win.XN.APP.WebRadioNotlogin.player.play = function (url, f0) {
  574. console.warn(arguments);
  575. var ret = oldPlay.apply(win.XN.APP.WebRadioNotlogin.player, arguments);
  576. dlLink.attr('href', url);
  577. return ret;
  578. }
  579. });
  580. break;
  581. case 'qq.com':
  582. log('Waiting for fmQQ...');
  583. waitUnTil(function () {
  584. return (typeof (win.$.qPlayer.player.playUrl) == 'function')
  585. }, function () {
  586. log('fmQQ Hook start!');
  587. // CreateDLButton
  588. var dlLink = $('<a>').css(makeRotateCss(90)).css({
  589. 'background-position': '-24px -73px'
  590. });
  591. $('.btn_del').after(dlLink);
  592. var firstRun = true;
  593. oldPlayurl = win.$.qPlayer.player.playUrl;
  594. win.$.qPlayer.player.playUrl = function (songUrl) {
  595. dlLink.attr('href', songUrl).attr('title', '单击下载: ' + win.$.qPlayer.playList.getSongInfoObj().msong);
  596. if (firstRun)
  597. return firstRun = 0;
  598. return oldPlayurl(songUrl);
  599. };
  600. win.$.qPlayer.player.playUrl(win.$.qPlayer.playList.getSongInfoObj().songurl);
  601. log('fmQQ Hook finish!');
  602. });
  603. break;
  604. case 'moe.fm':
  605. waitUnTil('playerInitUI', function () {
  606. // 登录破解
  607. win.is_login = true;
  608. log('fmMoe Hook start!!');
  609. var dlLink = $('<a>').addClass('player-button left').css(makeRotateCss(90)).css({
  610. 'width': '26px',
  611. 'background-position': '-19px -96px'
  612. });
  613. $('div.player-button.button-volume').first().after(dlLink);
  614. var oldPlayerInitUI = win.playerInitUI;
  615. win.playerInitUI = function (a) {
  616. dlLink.attr('href', a.completeUrl).attr('title', '单击下载: ' + a.title);
  617. log(a);
  618. return oldPlayerInitUI(a);
  619. };
  620. log('fmMoe Hook finish!!');
  621. });
  622. break;
  623. case "dbank.com":
  624. case "vmall.com":
  625. // 页面整理。
  626. $('#c_footer, #filelist_marker, div.link-left .panel-line, div[id^="ad_"], .panel-recommended, #hotkw, p.copyright-tips').remove();
  627. break;
  628. case "vdisk.cn":
  629. forceShow('#btnbox');
  630. forceHide('#loadingbox, #yanzhengbox, #yzmbox, #ShowDIV, ifarme');
  631. // 清理乱七八糟的链接
  632. clearOutsiteLink();
  633. break;
  634. case "qjwm.com":
  635. case "7958.com":
  636. if (l.href.toLowerCase().indexOf("down_") > 0) l.href = lurl.replace(/down_/i, 'download_');
  637. forceHide('#downtc,[id^="cpro_"],.download_alert,#inputyzm,#house,#uptown,a[href$="money.html"],a[href$="reg.html"]');
  638. forceShow('#downtc2,.new_down');
  639. waitUnTil('authad', function () {
  640. win.authad = win.bdshow = win.scrollTo = tFunc;
  641. });
  642. break;
  643. case "rayfile.com":
  644. //Feisu-Rayfile,nextpag,showdown
  645. if (win.vkey) {
  646. l.href = lurl + win.vkey;
  647. } else {
  648. win.filesize = 100;
  649. win.showDownload();
  650. win.showDownload = eFunc; // 防止 7 秒后按钮被覆盖。
  651. // 天知道这个错误怎么来的.. 语言错误就显示不了下载按钮..
  652. $('#downloadlink').addClass('btn_downNow_zh-cn');
  653. $('#vodlink').addClass('btn_downTools_zh-cn');
  654. // 整理页面
  655. $('div.left, iframe').remove();
  656. };
  657. break;
  658. case "songtaste.com":
  659. // SongTaste,Source-Code by (inc/common.js)
  660. // By Yulei 2012.11.30 ;Remove register and login tips.
  661. // Simplify Code + Simulate Official site action + Chrome Fix.
  662. var cssCode = {
  663. 'font-size': '15px',
  664. 'color': '#fff',
  665. 'background-color': '#000',
  666. 'text-decoration': 'none',
  667. 'padding': '3px 5px'
  668. };
  669. var sId = $_GET['song_id'] || (function () {
  670. if (lurl.toLowerCase().indexOf('/album/') != -1) {
  671. // 专辑页面功能添加
  672. log('ST :: 专辑页面调整');
  673. var btn_playAll = $('[value="连续播放"]');
  674. var btn_noPopPlay = btn_playAll.clone().attr({
  675. 'value': '不弹窗播放',
  676. 'onclick': ''
  677. });
  678. btn_noPopPlay.click(function () {
  679. var id = "",
  680. arr = win.chkArray;
  681. for (i = 0; i < arr.length; i++) {
  682. if (arr[i].checked) {
  683. id += arr[i].value + ",";
  684. }
  685. }
  686. if (id.length > 1) {
  687. id = id.sub(1);
  688. l.href = "/playmusic.php?song_id=" + id;
  689. } else {
  690. alert("请选择歌曲");
  691. }
  692. });
  693. btn_playAll.after(btn_noPopPlay);
  694. return;
  695. }
  696. log('ST :: 单曲模式解析');
  697. var Args = $("#playicon a")[0].href.replace(/ /g).replace(/\"/g, "'").split('\'');
  698. var sURL = Args[5],
  699. sType = Args[11],
  700. sHead = Args[13],
  701. sId = Args[15],
  702. sTime = ((new RegExp(/,(\d+)\)/).exec(Args[16]) || [, '0'])[1]);
  703. if (sURL.indexOf('rayfile') > 0) {
  704. var SongUrl = sHead + sURL + win.GetSongType(sType);
  705. } else {
  706. SongUrl = $.ajax({
  707. type: 'POST',
  708. url: '/time.php',
  709. cache: true,
  710. /* 从缓存读,反正如果没记录可以跑到 ST 服务器下 */
  711. async: false,
  712. data: 'str=' + sURL + '&sid=' + sId + '&t=' + sTime,
  713. dataType: 'html',
  714. }).responseText;
  715. }
  716. $('a#custom_2').attr({
  717. 'href': SongUrl,
  718. 'title': 'Cracked By jixun66'
  719. }).css(cssCode).text('音乐直链');
  720. return false;
  721. })();
  722. if (sId) {
  723. // 下载解析 - Hook 更换歌曲的函数,避免重复读取歌曲 + 不需要多次请求服务器不容易掉线。
  724. log('ST :: 列表模式解析');
  725. win.changeSong_e = win.changeSong;
  726. win.changeSong = function (a1, a2, a3) {
  727. // 2013.03.19 & 2013.04.09 修正:
  728. // 已经删除的歌曲自动跳到下一曲
  729. if (a1.trim() == '') {
  730. win.pu.doPlayNext(2);
  731. return;
  732. }
  733. log('请求歌曲 :: ' + a1 + ' :: ' + a2);
  734. $('#dl_Link').attr({
  735. 'href': a2,
  736. 'title': a1
  737. });
  738. document.title = 'ST - ' + a1;
  739. // 转接给原函数
  740. win.changeSong_e(a1, a2, a3);
  741. };
  742. win.downSong = function () {
  743. win.open(win.theSongUrl);
  744. };
  745. $('div#left_music_div div.p_fun a:eq(2)').css(cssCode)
  746. .text('直链下载').attr({
  747. 'id': 'dl_Link',
  748. 'target': '_blank'
  749. });
  750. // 2013.03.19 添加:
  751. // 重建播放列表地址
  752. $('p.p_list_txt').append($('<a>').text('重建播放列表').click(function () {
  753. l.href = '?song_id=' + win.arr_ids.join(',');
  754. }).css({
  755. 'cursor': 'pointer'
  756. }));
  757. log('ST :: 等待网页加载...');
  758. var iNv = setInterval(function () {
  759. if (!win.pu.doPlayNext) {
  760. return;
  761. }
  762. log('ST :: 官方播放器删除功能修正启动');
  763. // 修正播放器删除代码错误 :: 开始
  764. win.pu.doPlayNext = function (t) {
  765. for (var i = 0; i < win.arr_ids.length; i++) {
  766. if (win.arr_ids[i] == win.cur_sid) {
  767. var now = i;
  768. break;
  769. }
  770. }
  771. // 寻找下一首未删除的歌曲。
  772. // * 2013.01.29 修正
  773. // 1. 上一首查找失败的情况下会滚回到当前音乐的错误。
  774. // 2. 如果没有可听歌曲情况下无限循环的错误。
  775. var now = Math.abs((now || 0) + t),
  776. avl = 0;
  777. // 检查是否有歌曲剩余
  778. for (var i = 0; i < win.arr_ids.length; i++) {
  779. if (win.arr_ids[i]) {
  780. avl++;
  781. }
  782. }
  783. if (avl == 0) {
  784. alert('歌都被删光了还听啥...');
  785. return;
  786. }
  787. // 寻找空位
  788. while (true) {
  789. if (win.arr_ids[now]) {
  790. log('切换歌曲 :: ' + now.toString());
  791. win.pu.utils(now);
  792. win.cur_sid = win.arr_ids[now];
  793. win.playSongRight();
  794. return;
  795. }
  796. now += t >= 0 ? 1 : -1;
  797. if (win.arr_ids.length <= now) {
  798. now = 0;
  799. }
  800. if (now < 0) {
  801. now = win.arr_ids.length;
  802. }
  803. }
  804. }
  805. win.delSongDiv = function (songid, isbox) {
  806. log('删除歌曲 :: ' + songid.toString());
  807. $('#' + songid).hide();
  808. var new_songlist = [];
  809. for (var i = 0; i < win.arr_ids.length; i++) {
  810. if (win.arr_ids[i] == songid) {
  811. if (songid == win.cur_sid)
  812. win.pu.doPlayNext(1);
  813. win.arr_ids[i] = 0;
  814. }
  815. }
  816. }
  817. // 修正播放器删除代码错误 :: 结束
  818. log('ST :: 官方播放器删除功能修正结束');
  819. clearInterval(iNv);
  820. }, 100);
  821. }
  822. break;
  823. case "oyinyue.com":
  824. if (l.href.toLowerCase().indexOf("/down.") > 0) {
  825. alert ('請返回音樂頁解析音樂, 此處腳本不負責解析… orz');
  826. break;
  827. }
  828.  
  829. waitUnTil (function () {return win.player.getUrl ()}, function () {
  830. $('a[href*="/Down."]').attr({
  831. 'href': win.player.getUrl(),
  832. 'target': '_blank'
  833. }).html('<b/>直链下载');
  834. });
  835. break;
  836. case "5sing.com":
  837. //By Yulei 2012.11.27
  838. // Easy way of getting the link url: by jixun
  839. if (l.href.toLowerCase().indexOf("down") > 0) {
  840. if (confirm('单击确定返回到歌曲信息页面解析下载地址。')) {
  841. var urls = lurl.replace(/down\.aspx\?sid\=/i, '');
  842. l.href = urls + ".html";
  843. }
  844. break;
  845. }
  846. var $dl = $('<a>')
  847. .append($('<span>').text('>> 直链下載 <<'))
  848. .insertAfter ($('.zhe>.sup>span,.play>.play_intro_tit>h1,.mc_info_tit>h1').first())
  849. .attr('target', '_blank');
  850. waitUnTil (function () {
  851. return win.$wsp.mediaHelper.createPlugin;
  852. }, function () {
  853. console.log ('Hook 啓動~');
  854. var oldCreatePlugin = win.$wsp.mediaHelper.createPlugin;
  855. win.$wsp.mediaHelper.createPlugin = function (src) {
  856. console.log ('下載地址: %s', src);
  857. $dl.attr('href', src);
  858. return oldCreatePlugin.apply (this, arguments);
  859. }
  860.  
  861. if (win.wplayer.playList.length) {
  862. $dl.attr('href', win.wplayer.playList[0].file);
  863. $('a[href^="/down/"]').attr ({
  864. href: win.wplayer.playList[0].file
  865. }).html('<b/>直链下载');
  866. }
  867. });
  868. break;
  869. case "it168.com":
  870. forceHide('.right_four,#wanyxShowAD');
  871. $("#download").html ('').append($('<a>').attr({
  872. href: $('.sign11.four_li1>a').attr('href'),
  873. class: 'sign11'
  874. }).css({
  875. paddingLeft: '2em',
  876. color: '#fff'
  877. }).text('点我下载'));
  878. break;
  879. case '119g.com':
  880. var reg = /^(\/f\/[a-z0-9]+)(_bak|)/i;
  881. if (!reg.test(location.pathname))
  882. return;
  883. var mat = location.pathname.match(reg) || [, '', ''];
  884. if (!mat[2])
  885. location.pathname = mat[1] + '_bak.html';
  886. break;
  887. case "yimuhe.com":
  888. // yimuhe ,Vcode,8s,By Yulei 2012.12.26
  889. // Make it easy by jixun66
  890. // /n_dd.php?file_id=476136&userlogin=niuge&ser=1
  891. chkDU();
  892. forceShow('#yzm');
  893. forceHide('#loading');
  894. $('.w632').css({height:368});
  895. var oldDL;
  896. $('#yzm>form')
  897. .append(createNumPad(4, '#code', function () {
  898. $('#yzm>form>input[name="Submit"]').click();
  899. setTimeout (function () {
  900. $('#download:visible>a:last').click();
  901. }, 200);
  902. return 1;
  903. }, function () {
  904. $('#vcode_img').click();
  905. }));
  906. if (!l.pathname.indexOf('/n_dd.php')) {
  907. forceHide('.ggao');
  908. reDirWithRef($('#downs').attr('href'));
  909. }
  910. break;
  911.  
  912. break;
  913. if (location.pathname != "/filedown.php") {
  914. var aLink = $('a img[src="n_images/ico_c.gif"], a img[src="n_images/ico_b.gif"]').parent();
  915. win.down_file2 = function () {
  916. var rep = $.ajax({
  917. type: 'GET',
  918. url: jprintf('/n_dd.php?file_id=$1&ser=$2', arguments[0], arguments[4] || '1'),
  919. cache: true,
  920. /* 从缓存读,反正如果没记录可以跑到服务器下 */
  921. async: false,
  922. dataType: 'html',
  923. }).responseText;
  924. console.log (rep);
  925. var rL = parseHTML(rep).querySelector('a#downs').href;
  926. log('一禾木 :: ' + rL);
  927. aLink.attr({
  928. 'href': rL,
  929. 'onclick': ''
  930. });
  931. }
  932. // aLink.click();
  933. } else {
  934. win.down_file = function (fId, a2, sKey, sFn, iSid, sType, a7, a8, a9) {
  935. var rL = jprintf('//down$1.yimuhe.com/downfile/$2.$3?key=$4&type=$5', a9, sKey, sFn, iSid, a7)
  936. log('一禾木 :: ' + rL);
  937. l.href = rL;
  938. }
  939. }
  940. break;
  941. case "djkk.com":
  942. // 参考 Music liker for Beauty 代码,感谢 @yulei
  943. var pl4 = document.getElementsByClassName('play_4')[0],
  944. rmp3 = win.list[0].m4a.replace(/mp\./, 'do.').replace(/m4a/g, 'mp3'),
  945. myStyle = 'background: transparent url("/images/p_down.gif") no-repeat left center; height:15px; width:15px;';
  946. if (/img/g.test(pl4.innerHTML)) {
  947. pl4.innerHTML = "<a href='" + win.list[0].m4a + "' style='color:blueviolet' target='_blank' title='试听音乐下载 - Cracked By Yulei'><b style='" + myStyle + "'> </b>普通</a>";
  948. pl4.innerHTML += "<a href='" + rmp3 + "' title='高品质音乐下载 - Cracked By Yulei' target='_blank'><b style='" + myStyle + "'> </b>高清</a>";
  949. pl4.style.width = "82px";
  950. document.getElementsByClassName('play_2')[0].style.display = "none";
  951. }
  952. break;
  953. case 'kuaipan.cn':
  954. // 火狐下失效 囧…
  955. //waitUnTil('CONST', function () {
  956. // win.CONST.Token = win.CONST.Token || 'Patched By Jixun ^^';
  957. //});
  958. // 金山快盘免登录下载解析
  959. $('#jQrcodeDownload')
  960. .attr ('class', 'imitate-btn f16 btn-blue l')
  961. .text('免登录下载');
  962. $('#jQrcodebox').html ('免登录下载已开始,请等待下载提示...');
  963. $('#qrcode').remove();
  964. $('<div>').attr('id', 'qrcode').appendTo (body);
  965. win.encodeURIComponent_e = win.encodeURIComponent;
  966. win.encodeURIComponent = function (a1) {
  967. if (a1.toString().indexOf('/getdl?') >= 0) {
  968. l.href = a1.toString();
  969. $('.ui-dialog-title').text('Patched By Jixun');
  970. return false;
  971. }
  972. return win.encodeURIComponent_e (a1);
  973. }
  974. break;
  975. case 'howfile.com':
  976. forceHide ('#floatdiv div');
  977. injStyle ('#floatdiv {top: 150px; z-index: 99999; display: block !important;}');
  978. $('iframe,script,.row1_right').remove();
  979. break;
  980. case '79pan.com':
  981. chkDU();
  982. $('iframe, #code_box, #down_box2').remove();
  983. $('#down_box').show();
  984. break;
  985. case "87pan.com":
  986. chkDU();
  987. $('script,.view-gg,#view-gg').remove();
  988. break;
  989. case "azpan.com":
  990. chkDU();
  991. document.onkeydown = eFunc;
  992. $('script, iframe').remove();
  993. forceHide ('a[id*="Union"]');
  994. break;
  995. case "dd.ma":
  996. var aLink = $('#btn_open a.link1').attr('href');
  997. if (!aLink)
  998. break;
  999. l.href = aLink;
  1000. break;
  1001. case '9pan.net':
  1002. l.href = '/down-' + l.pathname.match(/\d+/) + '.html';
  1003. break;
  1004. case 'xddisk.com':
  1005. case 'nyhx.com':
  1006. chkDU();
  1007. document.body.oncontextmenu = null;
  1008. forceHide('#dl_tips,.adv_box,marquee');
  1009. forceShow('#dl_addr');
  1010. break;
  1011. case '9ku.com':
  1012. forceHide ('#LR2,#LR3,#seegc,.dongDown');
  1013. jPlayerPatcher (function (media) {
  1014. $('.ringDown').html($('<a>').attr('href', media.mp3 || media.m4a)
  1015. .text('下载: ' + $('#play_musicname').text()));
  1016. });
  1017. break;
  1018. case '565656.com':
  1019. // Let's monkey patch jPlayer xD
  1020. jPlayerPatcher (function (media) {
  1021. $('.play-info-otheropt > a:last').attr('href', media.mp3 || media.m4a)
  1022. .find('span').text('下载: ' + media.songname + ' - ' + media.singername);
  1023. });
  1024. break;
  1025. case 'djye.com':
  1026. $('#djInfo').bind('DOMSubtreeModified', function () {
  1027. var a = $('a[href^="/down.html"]').attr('href', win.firstplay);
  1028. a.attr('title', '下载: ' + $('#play_musicname').text()).css({
  1029. 'background': 'url(/images/mp3_down.gif)',
  1030. 'padding': '3px 0 5px 9px'
  1031. }).find('img').remove();
  1032. a.clone().css({
  1033. 'background-position': '-184px',
  1034. 'padding': '3px 0 5px 34px'
  1035. }).insertAfter(a);
  1036. log($('a[title^="下载:"]'));
  1037. });
  1038. break;
  1039. case 'djcc.com':
  1040. var a = $('#formusicbox'),
  1041. b = a.clone().insertAfter(a);
  1042. a.parent().animate({
  1043. 'height': '+=27'
  1044. }, 1000);
  1045. b.removeAttr('onclick').text('下载该曲').css({
  1046. 'background-color': 'lightgrey'
  1047. });
  1048. $('.playbox .playstate').bind('DOMSubtreeModified', function () {
  1049. var song = win.jwplayer(win._$[16]).getPlaylistItem();
  1050. b.attr('title', '下载: ' + song.title).attr('href', song.file);
  1051. });
  1052. // Ad.Kill
  1053. $('.left').animate({
  1054. 'width': '0'
  1055. }, 1000, function () {
  1056. $(this).remove();
  1057. });
  1058. $('.left').animate({
  1059. 'width': '0'
  1060. }, 1000, function () {
  1061. $(this).remove();
  1062. });
  1063. $('.center').css({
  1064. 'margin-top': '12px',
  1065. 'margin-left': '240px'
  1066. });
  1067. $('.p3').css('background', 'none');
  1068. $('.right').animate({
  1069. 'width': '0',
  1070. 'left': '310'
  1071. }, 1000, function () {
  1072. $(this).remove();
  1073. });
  1074. $('[class*="banner"]').remove();
  1075. $('#playlistads').remove();
  1076. break;
  1077. // 短链接
  1078. case 'ref.so':
  1079. safeJump($('#btn_open a').attr('href'));
  1080. break;
  1081. case 'upan.so':
  1082. var selector = 'img[src*="liulan.jpg"]';
  1083. waitUnTil(function () {
  1084. return $(selector).length;
  1085. }, function () {
  1086. safeJump($(selector).parent().attr('href'));
  1087. });
  1088. break;
  1089. case 'dc2.us':
  1090. case 't00y.com':
  1091. var selector = '#skip_button, #downloadlist a';
  1092. waitUnTil(function () {
  1093. return $(selector).length;
  1094. }, function () {
  1095. $('iframe, embed, object').remove();
  1096. forceHideFrames();
  1097. clearCookie();
  1098. if (!safeJump($(selector).attr('href')) && win.jumpToURL)
  1099. win.jumpToURL();
  1100. });
  1101. break;
  1102. default:
  1103. // log ('该域名未获得匹配,请联系作者修正该问题!');
  1104. // Do nothing.
  1105. }
  1106. }, 1);
  1107. });
  1108. document.addEventListener('readystatechange', function () {
  1109. console.log('readystatechange: ' + document.readyState);
  1110. if (document.readyState != 'complete')
  1111. return;
  1112. log('网页已完整加载。');
  1113. switch (dhost) {
  1114. case "87pan.com":
  1115. case "bpan.net":
  1116. $('script,.view-gg,#view-gg').remove();
  1117. break;
  1118. case 'duole.com':
  1119. var a = $('#player_right .last'),
  1120. b = a.clone();
  1121. $('#player_right').animate({
  1122. 'width': '+=32'
  1123. }, 500);
  1124. $('a.music_info').css({
  1125. 'cursor': 'text'
  1126. }).bind('DOMAttrModified', function () {
  1127. if (this.hasAttribute('href'))
  1128. this.removeAttribute('href');
  1129. }).removeAttr('href');
  1130. b.insertBefore(a.prev()).removeClass('last').css({
  1131. 'width': '0',
  1132. 'display': 'inline',
  1133. 'background-position': '-150px -104px'
  1134. }).css(makeRotateCss(90)).animate({
  1135. 'width': '+=32'
  1136. }, 500).attr('target', '_blank');
  1137. var oldPlayNew = win.duolePlayer.playNew, rollid;
  1138. win.duolePlayer.playNew = function (t, n) {
  1139. b.attr({
  1140. href: t,
  1141. title: '单击下载: ' + this.curMusic.song_name,
  1142. // Firefox 下会因为不是同一域名而不让用指定的名字 && 提示下载 orz
  1143. download: this.curMusic.song_name + ' [' + this.curMusic.album_name + '] - '
  1144. + this.curMusic.singer_name + '.mp3'
  1145. });
  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. */