获取百度网盘分享链接

百度网盘分享页面,快速获取已经分享的链接地址

  1. // ==UserScript==
  2. // @name 获取百度网盘分享链接
  3. // @author 林岑影
  4. // @website http://www.cyxiaowu.com
  5. // @description 百度网盘分享页面,快速获取已经分享的链接地址
  6. // @namespace
  7. // @icon http://disk.yun.uc.cn/favicon.ico
  8. // @license GPL version 3
  9. // @encoding utf-8
  10. // @date 15/08/2015
  11. // @modified 12/09/2015
  12. // @include http://pan.baidu.com/share/*
  13. // @require http://libs.baidu.com/jquery/2.0.0/jquery.min.js
  14. // @grant unsafeWindow
  15. // @grant GM_setClipboard
  16. // @run-at document-end
  17. // @version 1.0.2
  18. // ==/UserScript==
  19.  
  20. var getbaidushares = function(){
  21. this.linktype = localStorage.getItem('qs_linktype') || "link"; //输出链接格式: ubb = ubb代码 | link = 链接 | html = html代码
  22. this.index = 0;
  23. this.arrUrl = [];
  24. this.arrName = [];
  25. this.setTime = null;
  26. this.btn = '<a node-type="btn-getshare" data-key="getshare" class="btn share-btn" style="display: inline-block;"><span class="ico"></span><span class="btn-val">获取链接</span></a>';
  27. };
  28. getbaidushares.prototype = {
  29. init: function(){
  30. var that = this;
  31. $('[data-key="unshare"]').after(that.btn);
  32. $('[data-key="getshare"]').on("click", function(){
  33. that.arrUrl = [];
  34. that.arrName = [];
  35. that.index = 0;
  36. $('[node-type="list"]').children(".item-active").each(function(){
  37. dataurl = $(this).find('[node-type="copy-bar"]').text();
  38. dataname = $(this).find('[node-type="name"]').attr("title");
  39. that.arrUrl.push(dataurl);
  40. that.arrName.push(dataname);
  41. });
  42. that.dialog();
  43. that.post();
  44. });
  45. },
  46. post: function(){
  47. var that = this,
  48. $return = "";
  49. $.each(this.arrUrl, function(i, j){
  50. j = j.replace(/[\s]+/g, " ");
  51. j = j.replace("复制", "");
  52. j = j.replace("链接: ", "");
  53. if (that.linktype == "ubb") {
  54. j = j.replace(/http:\/\/(.*?) /g, "[url=http://$1]百度网盘下载:"+that.arrName[i]+"[/url] ");
  55. } else if (that.linktype == "html") {
  56. j = j.replace(/http:\/\/(.*?) /g, "<a href='http://$1'>百度网盘下载:"+that.arrName[i]+"</a> ");
  57. }
  58. $return = $return + j + "\r\n";
  59. });
  60. $("#getshareresult").val($return);
  61. },
  62. dialog: function() {
  63. var that = this,
  64. html = "",
  65. w = 576,
  66. h = 514,
  67. ww = $(window).width(),
  68. hh = $(window).height();
  69. var l = (ww - w) / 2,
  70. t = (hh - h) / 2;
  71. html+='<div class="b-panel b-dialog box-shadow4 bdr-rnd-3 add-yun-device-dialog common-dialog" style="display: block; left: '+l+'px; top: '+t+'px;">';
  72. html+=' <div class="dlg-hd b-rlv"><span class="dlg-cnr dlg-cnr-l"></span>';
  73. html+=' <a href="javascript:void(0);" title="关闭" id="closeGetShareDailog" class="dlg-cnr dlg-cnr-r"></a>';
  74. html+=' <h3><em></em>分享结果</h3>';
  75. html+=' </div>';
  76. html+=' <div class="dlg-bd global-clearfix __dlgBd" style="visibility: visible;">';
  77. html+=' <div class="add-yun-device-list">';
  78. html+=' <textarea style="width:100%; height:400px;" id="getshareresult"></textarea>';
  79. html+=' </div>';
  80. html+=' </div>';
  81. html+='</div>';
  82. $("body").append(html).find("#closeGetShareDailog").click(function(){
  83. $(this).parents(".b-dialog").remove();
  84. });
  85. }
  86. };
  87. var geturl = new getbaidushares();
  88. geturl.init();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址