Greasy Fork is available in English.

Bypass Wait, Code, & Login For Chrome

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

05.05.2014 itibariyledir. En son verisyonu görün.

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