删除失效工具
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 34 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 45 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 2.1 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 2.1 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 2.9 KiB |
@@ -1,18 +0,0 @@
|
||||
(function() {
|
||||
var table = [0x00000000, 0x77073096, 0xEE0E612C, 0x990951BA, 0x076DC419, 0x706AF48F, 0xE963A535, 0x9E6495A3, 0x0EDB8832, 0x79DCB8A4, 0xE0D5E91E, 0x97D2D988, 0x09B64C2B, 0x7EB17CBD, 0xE7B82D07, 0x90BF1D91, 0x1DB71064, 0x6AB020F2, 0xF3B97148, 0x84BE41DE, 0x1ADAD47D, 0x6DDDE4EB, 0xF4D4B551, 0x83D385C7, 0x136C9856, 0x646BA8C0, 0xFD62F97A, 0x8A65C9EC, 0x14015C4F, 0x63066CD9, 0xFA0F3D63, 0x8D080DF5, 0x3B6E20C8, 0x4C69105E, 0xD56041E4, 0xA2677172, 0x3C03E4D1, 0x4B04D447, 0xD20D85FD, 0xA50AB56B, 0x35B5A8FA, 0x42B2986C, 0xDBBBC9D6, 0xACBCF940, 0x32D86CE3, 0x45DF5C75, 0xDCD60DCF, 0xABD13D59, 0x26D930AC, 0x51DE003A, 0xC8D75180, 0xBFD06116, 0x21B4F4B5, 0x56B3C423, 0xCFBA9599, 0xB8BDA50F, 0x2802B89E, 0x5F058808, 0xC60CD9B2, 0xB10BE924, 0x2F6F7C87, 0x58684C11, 0xC1611DAB, 0xB6662D3D, 0x76DC4190, 0x01DB7106, 0x98D220BC, 0xEFD5102A, 0x71B18589, 0x06B6B51F, 0x9FBFE4A5, 0xE8B8D433, 0x7807C9A2, 0x0F00F934, 0x9609A88E, 0xE10E9818, 0x7F6A0DBB, 0x086D3D2D, 0x91646C97, 0xE6635C01, 0x6B6B51F4, 0x1C6C6162, 0x856530D8, 0xF262004E, 0x6C0695ED, 0x1B01A57B, 0x8208F4C1, 0xF50FC457, 0x65B0D9C6, 0x12B7E950, 0x8BBEB8EA, 0xFCB9887C, 0x62DD1DDF, 0x15DA2D49, 0x8CD37CF3, 0xFBD44C65, 0x4DB26158, 0x3AB551CE, 0xA3BC0074, 0xD4BB30E2, 0x4ADFA541, 0x3DD895D7, 0xA4D1C46D, 0xD3D6F4FB, 0x4369E96A, 0x346ED9FC, 0xAD678846, 0xDA60B8D0, 0x44042D73, 0x33031DE5, 0xAA0A4C5F, 0xDD0D7CC9, 0x5005713C, 0x270241AA, 0xBE0B1010, 0xC90C2086, 0x5768B525, 0x206F85B3, 0xB966D409, 0xCE61E49F, 0x5EDEF90E, 0x29D9C998, 0xB0D09822, 0xC7D7A8B4, 0x59B33D17, 0x2EB40D81, 0xB7BD5C3B, 0xC0BA6CAD, 0xEDB88320, 0x9ABFB3B6, 0x03B6E20C, 0x74B1D29A, 0xEAD54739, 0x9DD277AF, 0x04DB2615, 0x73DC1683, 0xE3630B12, 0x94643B84, 0x0D6D6A3E, 0x7A6A5AA8, 0xE40ECF0B, 0x9309FF9D, 0x0A00AE27, 0x7D079EB1, 0xF00F9344, 0x8708A3D2, 0x1E01F268, 0x6906C2FE, 0xF762575D, 0x806567CB, 0x196C3671, 0x6E6B06E7, 0xFED41B76, 0x89D32BE0, 0x10DA7A5A, 0x67DD4ACC, 0xF9B9DF6F, 0x8EBEEFF9, 0x17B7BE43, 0x60B08ED5, 0xD6D6A3E8, 0xA1D1937E, 0x38D8C2C4, 0x4FDFF252, 0xD1BB67F1, 0xA6BC5767, 0x3FB506DD, 0x48B2364B, 0xD80D2BDA, 0xAF0A1B4C, 0x36034AF6, 0x41047A60, 0xDF60EFC3, 0xA867DF55, 0x316E8EEF, 0x4669BE79, 0xCB61B38C, 0xBC66831A, 0x256FD2A0, 0x5268E236, 0xCC0C7795, 0xBB0B4703, 0x220216B9, 0x5505262F, 0xC5BA3BBE, 0xB2BD0B28, 0x2BB45A92, 0x5CB36A04, 0xC2D7FFA7, 0xB5D0CF31, 0x2CD99E8B, 0x5BDEAE1D, 0x9B64C2B0, 0xEC63F226, 0x756AA39C, 0x026D930A, 0x9C0906A9, 0xEB0E363F, 0x72076785, 0x05005713, 0x95BF4A82, 0xE2B87A14, 0x7BB12BAE, 0x0CB61B38, 0x92D28E9B, 0xE5D5BE0D, 0x7CDCEFB7, 0x0BDBDF21, 0x86D3D2D4, 0xF1D4E242, 0x68DDB3F8, 0x1FDA836E, 0x81BE16CD, 0xF6B9265B, 0x6FB077E1, 0x18B74777, 0x88085AE6, 0xFF0F6A70, 0x66063BCA, 0x11010B5C, 0x8F659EFF, 0xF862AE69, 0x616BFFD3, 0x166CCF45, 0xA00AE278, 0xD70DD2EE, 0x4E048354, 0x3903B3C2, 0xA7672661, 0xD06016F7, 0x4969474D, 0x3E6E77DB, 0xAED16A4A, 0xD9D65ADC, 0x40DF0B66, 0x37D83BF0, 0xA9BCAE53, 0xDEBB9EC5, 0x47B2CF7F, 0x30B5FFE9, 0xBDBDF21C, 0xCABAC28A, 0x53B39330, 0x24B4A3A6, 0xBAD03605, 0xCDD70693, 0x54DE5729, 0x23D967BF, 0xB3667A2E, 0xC4614AB8, 0x5D681B02, 0x2A6F2B94, 0xB40BBE37, 0xC30C8EA1, 0x5A05DF1B, 0x2D02EF8D];
|
||||
|
||||
/* Number */
|
||||
crc32 = function( /* Uint8Array */ uint8Array, /* Number */ crc ) {
|
||||
if( crc == window.undefined ) crc = 0;
|
||||
|
||||
var n = 0; //a number between 0 and 255
|
||||
var x = 0; //an hex number
|
||||
|
||||
crc = crc ^ (-1);
|
||||
for( var i = 0, iTop = uint8Array.byteLength; i < iTop; i++ ) {
|
||||
n = ( crc ^ (uint8Array[i]) ) & 0xFF;
|
||||
crc = ( crc >>> 8 ) ^ (table[n]);
|
||||
}
|
||||
return crc ^ (-1);
|
||||
};
|
||||
})();
|
||||
@@ -1,211 +0,0 @@
|
||||
$().ready(function () {
|
||||
getUnique = function () {
|
||||
var uniquecnt = 0;
|
||||
|
||||
function getUnique() {
|
||||
return (uniquecnt++);
|
||||
}
|
||||
|
||||
return getUnique;
|
||||
}();
|
||||
|
||||
function decimalToHexString(number) {
|
||||
if (number < 0) {
|
||||
number = 0xFFFFFFFF + number + 1;
|
||||
}
|
||||
|
||||
return number;
|
||||
}
|
||||
|
||||
function digits(number, dig) {
|
||||
var shift = Math.pow(10, dig);
|
||||
return Math.floor(number * shift) / shift;
|
||||
}
|
||||
|
||||
function escapeHtml(text) {
|
||||
return $('<div/>').text(text).html();
|
||||
}
|
||||
|
||||
function swapendian32(val) {
|
||||
return (((val & 0xFF) << 24)
|
||||
| ((val & 0xFF00) << 8)
|
||||
| ((val >> 8) & 0xFF00)
|
||||
| ((val >> 24) & 0xFF)) >>> 0;
|
||||
|
||||
}
|
||||
function arrayBufferToWordArray(arrayBuffer) {
|
||||
var fullWords = Math.floor(arrayBuffer.byteLength / 4);
|
||||
var bytesLeft = arrayBuffer.byteLength % 4;
|
||||
|
||||
var u32 = new Uint32Array(arrayBuffer, 0, fullWords);
|
||||
var u8 = new Uint8Array(arrayBuffer);
|
||||
|
||||
var cp = [];
|
||||
for (var i = 0; i < fullWords; ++i) {
|
||||
cp.push(swapendian32(u32[i]));
|
||||
}
|
||||
|
||||
if (bytesLeft) {
|
||||
var pad = 0;
|
||||
for (var i = bytesLeft; i > 0; --i) {
|
||||
pad = pad << 8;
|
||||
pad += u8[u8.byteLength - i];
|
||||
}
|
||||
|
||||
for (var i = 0; i < 4 - bytesLeft; ++i) {
|
||||
pad = pad << 8;
|
||||
}
|
||||
|
||||
cp.push(pad);
|
||||
}
|
||||
|
||||
return CryptoJS.lib.WordArray.create(cp, arrayBuffer.byteLength);
|
||||
};
|
||||
|
||||
function bytes2si(bytes, outputdigits) {
|
||||
if (bytes < 1024) { // Bytes
|
||||
return digits(bytes, outputdigits) + " b";
|
||||
}
|
||||
else if (bytes < 1048576) { // KiB
|
||||
return digits(bytes / 1024, outputdigits) + " KiB";
|
||||
}
|
||||
|
||||
return digits(bytes / 1048576, outputdigits) + " MiB";
|
||||
}
|
||||
|
||||
function bytes2si2(bytes1, bytes2, outputdigits) {
|
||||
var big = Math.max(bytes1, bytes2);
|
||||
|
||||
if (big < 1024) { // Bytes
|
||||
return bytes1 + "/" + bytes2 + " b";
|
||||
}
|
||||
else if (big < 1048576) { // KiB
|
||||
return digits(bytes1 / 1024, outputdigits) + "/" +
|
||||
digits(bytes2 / 1024, outputdigits) + " KiB";
|
||||
}
|
||||
|
||||
return digits(bytes1 / 1048576, outputdigits) + "/" +
|
||||
digits(bytes2 / 1048576, outputdigits) + " MiB";
|
||||
}
|
||||
|
||||
function progressiveRead(file, work, done) {
|
||||
var chunkSize = 262144; // 256KiB at a time
|
||||
var pos = 0;
|
||||
var reader = new FileReader();
|
||||
|
||||
function progressiveReadNext() {
|
||||
var end = Math.min(pos + chunkSize, file.size);
|
||||
|
||||
reader.onload = function (e) {
|
||||
pos = end;
|
||||
work(e.target.result, pos, file);
|
||||
if (pos < file.size) {
|
||||
progressiveReadNext();
|
||||
}
|
||||
else {
|
||||
// Done
|
||||
done(file);
|
||||
}
|
||||
}
|
||||
|
||||
if (file.slice) {
|
||||
var blob = file.slice(pos, end);
|
||||
}
|
||||
else if (file.webkitSlice) {
|
||||
var blob = file.webkitSlice(pos, end);
|
||||
}
|
||||
reader.readAsArrayBuffer(blob);
|
||||
}
|
||||
|
||||
progressiveReadNext();
|
||||
};
|
||||
|
||||
var algorithms = [
|
||||
{ name: "MD5", type: CryptoJS.algo.MD5 }
|
||||
];
|
||||
function selectFile(f) {
|
||||
(function () {
|
||||
var start = (new Date).getTime();
|
||||
var lastprogress = 0;
|
||||
|
||||
var contentMd5 = CryptoJS.algo.MD5.create();
|
||||
var sliceMd5 = CryptoJS.algo.MD5.create();
|
||||
var slice = 0;
|
||||
|
||||
var crc32intermediate = 0;
|
||||
var uid = "filehash" + getUnique();
|
||||
$("#showTable").append('<tr><td class="hash_file_info" id="'+uid+'"></td></tr>');
|
||||
progressiveRead(f,
|
||||
function (data, pos, file) {
|
||||
// Work
|
||||
// Easiest way to get this up and running ;-) Obvious optimization potential there.
|
||||
var wordArray = arrayBufferToWordArray(data);
|
||||
|
||||
contentMd5.update(wordArray);
|
||||
if(slice==0){
|
||||
sliceMd5.update(wordArray);
|
||||
slice = 1;
|
||||
}
|
||||
|
||||
crc32intermediate = crc32(new Uint8Array(data), crc32intermediate);
|
||||
|
||||
// Update progress display
|
||||
var progress = Math.floor((pos / file.size) * 100);
|
||||
if (progress > lastprogress) {
|
||||
$(file.previewElement).find('.dz-progress .dz-upload').css('width', progress + '%');
|
||||
|
||||
var took = ((new Date).getTime() - start) / 1000;
|
||||
$('#' + uid).html('<font color="blue">' + file.name +'</font>('+ bytes2si2(pos, file.size, 2)+')| 耗时: ' + digits(took, 2) + 's @ ' + bytes2si(pos / took, 2) + '/s<br/><div class="progress-bar progress-bar-striped active" role="progressbar" aria-valuenow="' + progress + '" aria-valuemin="0" aria-valuemax="100" style="width: ' + progress + '%">' + progress + '%</div>')
|
||||
lastprogress = progress;
|
||||
}
|
||||
},
|
||||
function (file) {
|
||||
// Done
|
||||
$(file.previewElement).removeClass('dz-progressing');
|
||||
$(file.previewElement).addClass('dz-success dz-complete');
|
||||
$('#' + uid).addClass('hashlink');
|
||||
|
||||
var took = ((new Date).getTime() - start) / 1000;
|
||||
|
||||
var results = 'bdpan://|' + file.name + '|' + contentMd5.finalize() + '|' + sliceMd5.finalize() + '|' + decimalToHexString(crc32intermediate) + '|' + file.size + '|/';
|
||||
|
||||
if(localStorage.getItem('historylink')){
|
||||
localStorage.setItem('historylink', localStorage.getItem('historylink')+'*'+results);
|
||||
}else{
|
||||
localStorage.setItem('historylink', results);
|
||||
}
|
||||
|
||||
$("#" + uid).html(results);
|
||||
});
|
||||
})();
|
||||
}
|
||||
|
||||
function compatible() {
|
||||
try {
|
||||
// Check for FileApi
|
||||
if (typeof FileReader == "undefined") return false;
|
||||
|
||||
// Check for Blob and slice api
|
||||
if (typeof Blob == "undefined") return false;
|
||||
var blob = new Blob();
|
||||
if (!blob.slice && !blob.webkitSlice) return false;
|
||||
|
||||
// Check for Drag-and-drop
|
||||
if (!('draggable' in document.createElement('span'))) return false;
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!compatible()) {
|
||||
alert('请更换高级浏览器,以支持本工具功能!');
|
||||
}
|
||||
Dropzone.autoDiscover = false;
|
||||
var hashFile = new Dropzone("#hash_file");
|
||||
hashFile.options.maxFilesize = 204800; // 不限制大小
|
||||
hashFile.options.autoProcessQueue = false;
|
||||
hashFile.on("addedfile", function(file) {
|
||||
selectFile(file);
|
||||
});
|
||||
});
|
||||
@@ -1,13 +0,0 @@
|
||||
var CryptoJS=CryptoJS||function(s,p){var m={},l=m.lib={},n=function(){},r=l.Base={extend:function(b){n.prototype=this;var h=new n;b&&h.mixIn(b);h.hasOwnProperty("init")||(h.init=function(){h.$super.init.apply(this,arguments)});h.init.prototype=h;h.$super=this;return h},create:function(){var b=this.extend();b.init.apply(b,arguments);return b},init:function(){},mixIn:function(b){for(var h in b)b.hasOwnProperty(h)&&(this[h]=b[h]);b.hasOwnProperty("toString")&&(this.toString=b.toString)},clone:function(){return this.init.prototype.extend(this)}},
|
||||
q=l.WordArray=r.extend({init:function(b,h){b=this.words=b||[];this.sigBytes=h!=p?h:4*b.length},toString:function(b){return(b||t).stringify(this)},concat:function(b){var h=this.words,a=b.words,j=this.sigBytes;b=b.sigBytes;this.clamp();if(j%4)for(var g=0;g<b;g++)h[j+g>>>2]|=(a[g>>>2]>>>24-8*(g%4)&255)<<24-8*((j+g)%4);else if(65535<a.length)for(g=0;g<b;g+=4)h[j+g>>>2]=a[g>>>2];else h.push.apply(h,a);this.sigBytes+=b;return this},clamp:function(){var b=this.words,h=this.sigBytes;b[h>>>2]&=4294967295<<
|
||||
32-8*(h%4);b.length=s.ceil(h/4)},clone:function(){var b=r.clone.call(this);b.words=this.words.slice(0);return b},random:function(b){for(var h=[],a=0;a<b;a+=4)h.push(4294967296*s.random()|0);return new q.init(h,b)}}),v=m.enc={},t=v.Hex={stringify:function(b){var a=b.words;b=b.sigBytes;for(var g=[],j=0;j<b;j++){var k=a[j>>>2]>>>24-8*(j%4)&255;g.push((k>>>4).toString(16));g.push((k&15).toString(16))}return g.join("")},parse:function(b){for(var a=b.length,g=[],j=0;j<a;j+=2)g[j>>>3]|=parseInt(b.substr(j,
|
||||
2),16)<<24-4*(j%8);return new q.init(g,a/2)}},a=v.Latin1={stringify:function(b){var a=b.words;b=b.sigBytes;for(var g=[],j=0;j<b;j++)g.push(String.fromCharCode(a[j>>>2]>>>24-8*(j%4)&255));return g.join("")},parse:function(b){for(var a=b.length,g=[],j=0;j<a;j++)g[j>>>2]|=(b.charCodeAt(j)&255)<<24-8*(j%4);return new q.init(g,a)}},u=v.Utf8={stringify:function(b){try{return decodeURIComponent(escape(a.stringify(b)))}catch(g){throw Error("Malformed UTF-8 data");}},parse:function(b){return a.parse(unescape(encodeURIComponent(b)))}},
|
||||
g=l.BufferedBlockAlgorithm=r.extend({reset:function(){this._data=new q.init;this._nDataBytes=0},_append:function(b){"string"==typeof b&&(b=u.parse(b));this._data.concat(b);this._nDataBytes+=b.sigBytes},_process:function(b){var a=this._data,g=a.words,j=a.sigBytes,k=this.blockSize,m=j/(4*k),m=b?s.ceil(m):s.max((m|0)-this._minBufferSize,0);b=m*k;j=s.min(4*b,j);if(b){for(var l=0;l<b;l+=k)this._doProcessBlock(g,l);l=g.splice(0,b);a.sigBytes-=j}return new q.init(l,j)},clone:function(){var b=r.clone.call(this);
|
||||
b._data=this._data.clone();return b},_minBufferSize:0});l.Hasher=g.extend({cfg:r.extend(),init:function(b){this.cfg=this.cfg.extend(b);this.reset()},reset:function(){g.reset.call(this);this._doReset()},update:function(b){this._append(b);this._process();return this},finalize:function(b){b&&this._append(b);return this._doFinalize()},blockSize:16,_createHelper:function(b){return function(a,g){return(new b.init(g)).finalize(a)}},_createHmacHelper:function(b){return function(a,g){return(new k.HMAC.init(b,
|
||||
g)).finalize(a)}}});var k=m.algo={};return m}(Math);
|
||||
(function(s){function p(a,k,b,h,l,j,m){a=a+(k&b|~k&h)+l+m;return(a<<j|a>>>32-j)+k}function m(a,k,b,h,l,j,m){a=a+(k&h|b&~h)+l+m;return(a<<j|a>>>32-j)+k}function l(a,k,b,h,l,j,m){a=a+(k^b^h)+l+m;return(a<<j|a>>>32-j)+k}function n(a,k,b,h,l,j,m){a=a+(b^(k|~h))+l+m;return(a<<j|a>>>32-j)+k}for(var r=CryptoJS,q=r.lib,v=q.WordArray,t=q.Hasher,q=r.algo,a=[],u=0;64>u;u++)a[u]=4294967296*s.abs(s.sin(u+1))|0;q=q.MD5=t.extend({_doReset:function(){this._hash=new v.init([1732584193,4023233417,2562383102,271733878])},
|
||||
_doProcessBlock:function(g,k){for(var b=0;16>b;b++){var h=k+b,w=g[h];g[h]=(w<<8|w>>>24)&16711935|(w<<24|w>>>8)&4278255360}var b=this._hash.words,h=g[k+0],w=g[k+1],j=g[k+2],q=g[k+3],r=g[k+4],s=g[k+5],t=g[k+6],u=g[k+7],v=g[k+8],x=g[k+9],y=g[k+10],z=g[k+11],A=g[k+12],B=g[k+13],C=g[k+14],D=g[k+15],c=b[0],d=b[1],e=b[2],f=b[3],c=p(c,d,e,f,h,7,a[0]),f=p(f,c,d,e,w,12,a[1]),e=p(e,f,c,d,j,17,a[2]),d=p(d,e,f,c,q,22,a[3]),c=p(c,d,e,f,r,7,a[4]),f=p(f,c,d,e,s,12,a[5]),e=p(e,f,c,d,t,17,a[6]),d=p(d,e,f,c,u,22,a[7]),
|
||||
c=p(c,d,e,f,v,7,a[8]),f=p(f,c,d,e,x,12,a[9]),e=p(e,f,c,d,y,17,a[10]),d=p(d,e,f,c,z,22,a[11]),c=p(c,d,e,f,A,7,a[12]),f=p(f,c,d,e,B,12,a[13]),e=p(e,f,c,d,C,17,a[14]),d=p(d,e,f,c,D,22,a[15]),c=m(c,d,e,f,w,5,a[16]),f=m(f,c,d,e,t,9,a[17]),e=m(e,f,c,d,z,14,a[18]),d=m(d,e,f,c,h,20,a[19]),c=m(c,d,e,f,s,5,a[20]),f=m(f,c,d,e,y,9,a[21]),e=m(e,f,c,d,D,14,a[22]),d=m(d,e,f,c,r,20,a[23]),c=m(c,d,e,f,x,5,a[24]),f=m(f,c,d,e,C,9,a[25]),e=m(e,f,c,d,q,14,a[26]),d=m(d,e,f,c,v,20,a[27]),c=m(c,d,e,f,B,5,a[28]),f=m(f,c,
|
||||
d,e,j,9,a[29]),e=m(e,f,c,d,u,14,a[30]),d=m(d,e,f,c,A,20,a[31]),c=l(c,d,e,f,s,4,a[32]),f=l(f,c,d,e,v,11,a[33]),e=l(e,f,c,d,z,16,a[34]),d=l(d,e,f,c,C,23,a[35]),c=l(c,d,e,f,w,4,a[36]),f=l(f,c,d,e,r,11,a[37]),e=l(e,f,c,d,u,16,a[38]),d=l(d,e,f,c,y,23,a[39]),c=l(c,d,e,f,B,4,a[40]),f=l(f,c,d,e,h,11,a[41]),e=l(e,f,c,d,q,16,a[42]),d=l(d,e,f,c,t,23,a[43]),c=l(c,d,e,f,x,4,a[44]),f=l(f,c,d,e,A,11,a[45]),e=l(e,f,c,d,D,16,a[46]),d=l(d,e,f,c,j,23,a[47]),c=n(c,d,e,f,h,6,a[48]),f=n(f,c,d,e,u,10,a[49]),e=n(e,f,c,d,
|
||||
C,15,a[50]),d=n(d,e,f,c,s,21,a[51]),c=n(c,d,e,f,A,6,a[52]),f=n(f,c,d,e,q,10,a[53]),e=n(e,f,c,d,y,15,a[54]),d=n(d,e,f,c,w,21,a[55]),c=n(c,d,e,f,v,6,a[56]),f=n(f,c,d,e,D,10,a[57]),e=n(e,f,c,d,t,15,a[58]),d=n(d,e,f,c,B,21,a[59]),c=n(c,d,e,f,r,6,a[60]),f=n(f,c,d,e,z,10,a[61]),e=n(e,f,c,d,j,15,a[62]),d=n(d,e,f,c,x,21,a[63]);b[0]=b[0]+c|0;b[1]=b[1]+d|0;b[2]=b[2]+e|0;b[3]=b[3]+f|0},_doFinalize:function(){var a=this._data,k=a.words,b=8*this._nDataBytes,h=8*a.sigBytes;k[h>>>5]|=128<<24-h%32;var l=s.floor(b/
|
||||
4294967296);k[(h+64>>>9<<4)+15]=(l<<8|l>>>24)&16711935|(l<<24|l>>>8)&4278255360;k[(h+64>>>9<<4)+14]=(b<<8|b>>>24)&16711935|(b<<24|b>>>8)&4278255360;a.sigBytes=4*(k.length+1);this._process();a=this._hash;k=a.words;for(b=0;4>b;b++)h=k[b],k[b]=(h<<8|h>>>24)&16711935|(h<<24|h>>>8)&4278255360;return a},clone:function(){var a=t.clone.call(this);a._hash=this._hash.clone();return a}});r.MD5=t._createHelper(q);r.HmacMD5=t._createHmacHelper(q)})(Math);
|
||||
Binary file not shown.
@@ -1,176 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* 百度网盘操作类
|
||||
*
|
||||
* @author 消失的彩虹海
|
||||
* @website www.cccyun.cc
|
||||
* @version 2.1
|
||||
*/
|
||||
class Baidupan
|
||||
{
|
||||
public $msg;
|
||||
private $cookie;
|
||||
private $mstring = 'devuid=257744010452368&clienttype=1&channel=android_4.4.2_MI%206%20_bd-netdisk_1523a&version=8.5.0&vip=2&network_type=wifi&apn_id=1_0&freeisp=0&queryfree=0';
|
||||
public function __construct($bduss)
|
||||
{
|
||||
$this->cookie='BDUSS='.$bduss.';';
|
||||
}
|
||||
|
||||
/**
|
||||
* 检测BUDSS是否有效
|
||||
* @return int
|
||||
*/
|
||||
public function checkcookie() {
|
||||
$url='https://pan.baidu.com/api/quota?clienttype=1&app_id=250528&web=1';
|
||||
$data=$this->get_curl($url,0,0,$this->cookie);
|
||||
$arr=json_decode($data,true);
|
||||
if($arr['errno']==0){
|
||||
return true;
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取文件列表
|
||||
* @param string $path 文件路径
|
||||
* @param int $num 显示数量
|
||||
* @param string $order 按什么排序
|
||||
* @param int $desc 是否为降序
|
||||
* @param int $page 页数
|
||||
* @return array
|
||||
*/
|
||||
public function getlist($path='/', $num=100, $order='name', $desc=0, $page=1) {
|
||||
$url='https://pan.baidu.com/api/list?dir='.urlencode($path).'&num='.$num.'&order='.$order.'&desc='.$desc.'&showempty=0&page='.$page.'&web=1&'.$this->mstring;
|
||||
$data=$this->get_curl($url,0,0,$this->cookie);
|
||||
$arr=json_decode($data,true);
|
||||
if(array_key_exists('errno',$arr) && $arr['errno']==0){
|
||||
return $arr['list'];
|
||||
}elseif($arr['errno']==-6){
|
||||
$this->msg='BDUSS已经失效';
|
||||
return false;
|
||||
}elseif($arr['errno']==-9){
|
||||
$this->msg='路径不存在';
|
||||
return false;
|
||||
}else{
|
||||
$this->msg='参数错误';
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取单个文件信息
|
||||
* @param string $path 文件路径
|
||||
* @param int $media 是否多媒体文件
|
||||
* @return array
|
||||
*/
|
||||
public function getmeta($path, $media=0) {
|
||||
$target=urlencode('['.json_encode($path).']');
|
||||
$url='https://pan.baidu.com/api/filemetas?target='.$target.'&media='.$media.'&dlink=1&'.$this->mstring;
|
||||
$data=$this->get_curl($url,0,0,$this->cookie);
|
||||
$arr=json_decode($data,true);
|
||||
if(array_key_exists('errno',$arr) && $arr['errno']==0){
|
||||
return $arr['info'];
|
||||
}elseif($arr['errno']==-6){
|
||||
$this->msg='BDUSS已经失效';
|
||||
return false;
|
||||
}elseif($arr['errno']==12){
|
||||
$this->msg='该文件不存在';
|
||||
return false;
|
||||
}else{
|
||||
$this->msg='参数错误';
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取文件下载直链
|
||||
* @param string $path 文件路径
|
||||
* @return string
|
||||
*/
|
||||
public function getlink($path) {
|
||||
$url='https://d.pcs.baidu.com/rest/2.0/pcs/file?method=locatedownload&path='.urlencode($path).'&ver=2.0&dtype=0&esl=1&ehps=0&app_id=250528&check_blue=1&'.$this->mstring.'&time='.time().'225&cuid=E5043F7C37B7BB71B2A94D932F30B2AE%7C257744010452368';
|
||||
$data=$this->get_curl($url,0,0,$this->cookie,0,$_SERVER['HTTP_USER_AGENT']);
|
||||
$arr=json_decode($data,true);
|
||||
if(array_key_exists('urls',$arr)){
|
||||
return $arr['urls'][0]['url'].'&vip=2';
|
||||
}elseif($arr['error_code']==31045){
|
||||
$this->msg='BDUSS已经失效';
|
||||
return false;
|
||||
}elseif($arr['error_code']==31066){
|
||||
$this->msg='该文件不存在';
|
||||
return false;
|
||||
}else{
|
||||
$this->msg='['.$arr['errno'].']'.$arr['error_msg'];
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 极速秒传
|
||||
* @param string $path 上传的文件路径
|
||||
* @param string $content_md5 文件的MD5
|
||||
* @param string $slice_md5 文件校验段的MD5(校验段为文件的前256KB)
|
||||
* @param string $content_crc32 文件的CRC32
|
||||
* @param string $content_length 文件大小(字节)
|
||||
* @return string
|
||||
*/
|
||||
public function rapidupload($path,$content_md5,$slice_md5,$content_crc32,$content_length) {
|
||||
$url='https://pan.baidu.com/api/rapidupload?clienttype=6&version=2.0.0.3';
|
||||
$post='path='.urlencode($path).'&content-md5='.$content_md5.'&slice-md5='.$slice_md5.'&content-crc32='.$content_crc32.'&content-length='.$content_length;
|
||||
$data=$this->get_curl($url,$post,0,$this->cookie,0,'netdisk;2.0.0.3;PC;PC-Windows;10.0.16299;uploadplugin');
|
||||
$arr=json_decode($data,true);
|
||||
if(array_key_exists('errno',$arr) && $arr['errno']==0){
|
||||
return $arr['info']['path'];
|
||||
}elseif($arr['errno']==404){
|
||||
$this->msg='该链接已失效';
|
||||
return false;
|
||||
}elseif($arr['errno']==-6){
|
||||
$this->msg='BDUSS已经失效';
|
||||
return false;
|
||||
}elseif($arr['errno']==-8){
|
||||
$this->msg='已存在重名文件';
|
||||
return false;
|
||||
}else{
|
||||
$this->msg='转存失败['.$arr['errno'].']';
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public function get_curl($url,$post=0,$referer=0,$cookie=0,$header=0,$ua=0,$nobaody=0){
|
||||
$ch = curl_init();
|
||||
curl_setopt($ch, CURLOPT_URL,$url);
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
|
||||
$httpheader[] = "Accept:*/*";
|
||||
$httpheader[] = "Accept-Language:zh-CN,zh;q=0.8";
|
||||
$httpheader[] = "Connection:close";
|
||||
curl_setopt($ch, CURLOPT_HTTPHEADER, $httpheader);
|
||||
if($post){
|
||||
curl_setopt($ch, CURLOPT_POST, 1);
|
||||
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
|
||||
}
|
||||
if($header){
|
||||
curl_setopt($ch, CURLOPT_HEADER, TRUE);
|
||||
}
|
||||
if($cookie){
|
||||
curl_setopt($ch, CURLOPT_COOKIE, $cookie);
|
||||
}
|
||||
if($referer){
|
||||
curl_setopt($ch, CURLOPT_REFERER, $referer);
|
||||
}
|
||||
if($ua){
|
||||
curl_setopt($ch, CURLOPT_USERAGENT,$ua);
|
||||
}else{
|
||||
curl_setopt($ch, CURLOPT_USERAGENT,'Mozilla/5.0 (Linux; Android 4.4.2; zh-cn) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/30.0.0.0 Mobile Safari/537.36');
|
||||
}
|
||||
if($nobaody){
|
||||
curl_setopt($ch, CURLOPT_NOBODY,1);
|
||||
}
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
|
||||
$ret = curl_exec($ch);
|
||||
curl_close($ch);
|
||||
return $ret;
|
||||
}
|
||||
}
|
||||
@@ -1,126 +0,0 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<title>百度网盘免和谐分享</title>
|
||||
<meta name="description" content="百度网盘免和谐分享平台,利用百度网盘秒传机制,实现任意文件分享链接生成与批量转存">
|
||||
<meta name="keywords" content="百度网盘免和谐分享,百度网盘分享平台,百度网盘分享链接生成,百度网盘直链,bdpan://分享链接一键转存">
|
||||
<link href="//lib.baomitu.com/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
|
||||
<link rel="stylesheet" href="//lib.baomitu.com/dropzone/4.3.0/min/dropzone.min.css">
|
||||
<!--[if lt IE 9]>
|
||||
<script src="//lib.baomitu.com/html5shiv/3.7.3/html5shiv.min.js"></script>
|
||||
<script src="//lib.baomitu.com/respond.js/1.4.2/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
<style>
|
||||
body {font-size: 14px !important; font-family: '微软雅黑' !important;}
|
||||
.c_top {margin-top: 60px; padding: 0px !important;}
|
||||
#hash_file {border: 2px solid rgb(66,158,158);}
|
||||
.hashlink {color: green!important;font-weight: bold;word-break:break-all;}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="navbar navbar-inverse navbar-fixed-top" role="navigation">
|
||||
<div class="container">
|
||||
<div class="navbar-header">
|
||||
<button data-target=".navbar-collapse" data-toggle="collapse" class="navbar-toggle" type="button">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<a href="/" class="navbar-brand">百度网盘免和谐分享</a>
|
||||
</div>
|
||||
<div class="navbar-collapse collapse" id="navbar-main">
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li>
|
||||
<a href="./">一键转存</a>
|
||||
</li>
|
||||
<li class="active">
|
||||
<a href="./create.html">一键分享</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="./help.html">帮助</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container c_top">
|
||||
<div class="col-md-12">
|
||||
<div class="panel panel-primary">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title text-center">百度网盘文件分享链接生成</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<div class="alert alert-success" role="alert"><strong>请先将要分享的文件上传到百度网盘</strong>,然后将要分享的文件拖到下方区域,即可生成bdpan://文件分享链接。</div>
|
||||
<div class="alert alert-info" role="alert">文件分享链接的计算生成全部在浏览器完成,<strong>不会产生任何网络流量</strong>。生成时间视文件大小而定,如果文件较大请耐心等待,理论支持3G以下的文件。</div>
|
||||
<form action="#" class="dropzone dz-clickable" id="hash_file">
|
||||
<div class="dz-message" >
|
||||
Drop files here or click to create link.<br>
|
||||
<span class="note">(文件拖放到这里或者点击选择文件 <strong>计算文件分享链接</strong>)</span>
|
||||
</div>
|
||||
</form>
|
||||
<hr/>
|
||||
<table class="table table-hover">
|
||||
<tbody id="showTable">
|
||||
<tr class="th">
|
||||
<th>已生成的分享链接:</th>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<button class="btn btn-primary btn-sm" id="copyLink"/>复制全部链接</button> <button class="btn btn-danger btn-sm" id="clearLink"/>清空生成记录</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<footer class="footer">
|
||||
<div class="panel-footer text-center">
|
||||
<p>Copyright © 2022 <a href="./" title="百度网盘免和谐分享">百度网盘免和谐分享</a>
|
||||
</div>
|
||||
</footer>
|
||||
<script src="//lib.baomitu.com/jquery/1.12.4/jquery.min.js"></script>
|
||||
<script src="//lib.baomitu.com/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
|
||||
<script src="//lib.baomitu.com/layer/2.3/layer.js"></script>
|
||||
<script src="//lib.baomitu.com/clipboard.js/1.7.1/clipboard.min.js"></script>
|
||||
<script src="//lib.baomitu.com/dropzone/4.3.0/min/dropzone.min.js"></script>
|
||||
<script type="text/javascript" src="assets/js/md5.js"></script>
|
||||
<script type="text/javascript" src="assets/js/crc32.js"></script>
|
||||
<script type="text/javascript" src="assets/js/html5hash.js"></script>
|
||||
<script>
|
||||
var clipboard = new Clipboard('#copyLink', {
|
||||
text: function() {
|
||||
var data = '';
|
||||
$(".hashlink").each(function(){
|
||||
data += $(this).text() + "\r\n";
|
||||
});
|
||||
return data;
|
||||
}
|
||||
});
|
||||
clipboard.on('success', function (e) {
|
||||
layer.msg('复制成功!');
|
||||
});
|
||||
clipboard.on('error', function (e) {
|
||||
layer.msg('复制失败,请长按链接后手动复制');
|
||||
});
|
||||
$(document).ready(function(){
|
||||
$("#clearLink").click(function(){
|
||||
$("#showTable").html('<tr class="th"><th>已生成的分享链接:</th></tr>');
|
||||
$(".dz-preview").remove();
|
||||
$("#hash_file").removeClass("dz-started");
|
||||
localStorage.removeItem('historylink');
|
||||
layer.msg('清空成功!');
|
||||
});
|
||||
if(localStorage.getItem('historylink')){
|
||||
var uniquecnt = 0;
|
||||
$.each(localStorage.getItem('historylink').split('*'), function(i, v) {
|
||||
var uid = "ofilehash" + (uniquecnt++);
|
||||
$("#showTable").append('<tr><td class="hash_file_info hashlink" id="'+uid+'">'+v+'</td></tr>');
|
||||
});
|
||||
}
|
||||
})
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,37 +0,0 @@
|
||||
<?php
|
||||
require 'inc.php';
|
||||
|
||||
$act=daddslashes($_GET['act']);
|
||||
|
||||
if($act=='save'){
|
||||
|
||||
$bduss=trim(daddslashes($_POST['bduss']));
|
||||
$path=trim(daddslashes($_POST['path']));
|
||||
$link=trim(daddslashes($_POST['link']));
|
||||
if(empty($path))$path='/';
|
||||
if(substr($path,0,1)!='/')exit('{"code":-1,"msg":"路径填写错误,路径如果需要自定义请以/开头"}');
|
||||
|
||||
$link_arr = parselink($link);
|
||||
if(!$link_arr)exit('{"code":-1,"msg":"分享链接错误,请填写以bdpan://开头的专用分享链接"}');
|
||||
|
||||
$x=new Baidupan($bduss);
|
||||
|
||||
if(substr($path,-1,1)!='/')$path=$path.'/';
|
||||
$path = '/'.$path.$link_arr['filename'];
|
||||
|
||||
if($result = $x->rapidupload($path,$link_arr['content_md5'],$link_arr['slice_md5'],$link_arr['content_crc32'],$link_arr['content_length'])){
|
||||
$result=array('code'=>0,'filename'=>$link_arr['filename'],'msg'=>'转存成功','path'=>$result);
|
||||
}else{
|
||||
$result=array('code'=>-2,'filename'=>$link_arr['filename'],'msg'=>$x->msg);
|
||||
}
|
||||
echo json_encode($result);
|
||||
|
||||
}elseif($act=='check'){
|
||||
$bduss=trim(daddslashes($_POST['bduss']));
|
||||
$x=new Baidupan($bduss);
|
||||
if($x->checkcookie()){
|
||||
exit('{"code":0}');
|
||||
}else{
|
||||
exit('{"code":-1}');
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 4.2 KiB |
@@ -1,89 +0,0 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<title>百度网盘免和谐分享</title>
|
||||
<meta name="description" content="百度网盘免和谐分享平台,利用百度网盘秒传机制,实现任意文件分享链接生成与批量转存">
|
||||
<meta name="keywords" content="百度网盘免和谐分享,百度网盘分享平台,百度网盘分享链接生成,百度网盘直链,bdpan://分享链接一键转存">
|
||||
<link href="//lib.baomitu.com/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
|
||||
<!--[if lt IE 9]>
|
||||
<script src="//lib.baomitu.com/html5shiv/3.7.3/html5shiv.min.js"></script>
|
||||
<script src="//lib.baomitu.com/respond.js/1.4.2/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
<style>
|
||||
body {font-size: 14px !important; font-family: '微软雅黑' !important;}
|
||||
.c_top {margin-top: 60px; padding: 0px !important;}
|
||||
.jumbotron{position:relative;padding:40px 0;color:#fff;text-align:center;text-shadow:0 1px 3px rgba(0,0,0,.4),0 0 30px rgba(0,0,0,.075);background:#020031;background:-webkit-gradient(linear,left bottom,right top,color-stop(0,#020031),color-stop(100%,#6d3353));background:-webkit-linear-gradient(45deg,#020031 0,#6d3353 100%);background:-o-linear-gradient(45deg,#020031 0,#6d3353 100%);background:linear-gradient(45deg,#020031 0,#6d3353 100%);-webkit-box-shadow:inset 0 3px 7px rgba(0,0,0,.2),inset 0 -3px 7px rgba(0,0,0,.2);box-shadow:inset 0 3px 7px rgba(0,0,0,.2),inset 0 -3px 7px rgba(0,0,0,.2);text-align:left}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="navbar navbar-inverse navbar-fixed-top" role="navigation">
|
||||
<div class="container">
|
||||
<div class="navbar-header">
|
||||
<button data-target=".navbar-collapse" data-toggle="collapse" class="navbar-toggle" type="button">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<a href="/" class="navbar-brand">百度网盘免和谐分享</a>
|
||||
</div>
|
||||
<div class="navbar-collapse collapse" id="navbar-main">
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li>
|
||||
<a href="./">一键转存</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="./create.html">一键分享</a>
|
||||
</li>
|
||||
<li class="active">
|
||||
<a href="./help.html">帮助</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<header class="jumbotron">
|
||||
<div class="container">
|
||||
<h1>帮助与介绍</h1>
|
||||
</div>
|
||||
</header>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
<h3>百度网盘免和谐分享介绍</h3>
|
||||
<blockquote>百度网盘免和谐分享利用百度网盘秒传机制,实现任意文件分享链接生成与批量转存。在一键分享页面可以生成bdpan://专用链,该专用链包含文件的特征值;在一键转存页面可以输入别人分享的bdpan://专用链,批量转存到自己的网盘。
|
||||
</blockquote>
|
||||
<h3>生成分享链接时浏览器卡住</h3>
|
||||
<blockquote>生成分享链接需要 Chrome 、Edge 或 Chromium 内核的浏览器,不支持IE浏览器。如果文件太大请耐心等待,具体生成时间与电脑配置有关。
|
||||
</blockquote>
|
||||
<h3>一键转存时提示"该链接已失效"</h3>
|
||||
<blockquote>说明该链接是无效链接,分享者在生成该链接的时候没有先将文件上传到百度网盘,或者百度网盘已经屏蔽该文件的上传。
|
||||
</blockquote>
|
||||
<h3>如何分享多个文件夹</h3>
|
||||
<blockquote>生成分享链接之后,在开头增加一条链接 <b>bdfolder://文件夹名称</b> ,这样这一条链接下面跟着的所有bdpan://链接都会转存到该文件夹,直到出现下一个bdfolder://链接定义新的目录为止。支持多级目录,例如 <font color="blue">bdfolder://我的应用/游戏/策略类游戏</font> ,转到根目录为 <font color="blue">bdfolder://</font>
|
||||
</blockquote>
|
||||
<h3 id="bduss">手动获取BDUSS的方法</h3>
|
||||
<blockquote>1.使用 Chrome 或 Chromium 内核的浏览器
|
||||
<br/><br/>2.下载插件 EditThisCookie <a href="./assets/tool/bduss.crx">立即下载</a>
|
||||
<br/><br/>下载该插件并运行,提示添加(无法添加说明浏览器不支持),添加完成后浏览器右上角会多个饼干图标
|
||||
<br/><br/>3.打开百度登录页面 <a href="https://passport.baidu.com/" target="_blank" rel="noreferrer">立即下载</a>
|
||||
<br/><br/>4.在登录页面登录后,点击浏览器右上角的饼干图标,找到BDUSS,复制内容即可
|
||||
<br/><br/><a href="assets/img/bduss.png" target="_blank"><img src="assets/img/bduss.png" style="display:block;max-width:100%;height:auto;"></a>
|
||||
|
||||
</blockquote>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<footer class="footer">
|
||||
<div class="panel-footer text-center">
|
||||
<p>Copyright © 2022 <a href="./" title="百度网盘免和谐分享">百度网盘免和谐分享</a>
|
||||
</div>
|
||||
</footer>
|
||||
<script src="//lib.baomitu.com/jquery/1.12.4/jquery.min.js"></script>
|
||||
<script src="//lib.baomitu.com/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,38 +0,0 @@
|
||||
<?php
|
||||
//error_reporting(E_ALL); ini_set("display_errors", 1);
|
||||
error_reporting(0);
|
||||
define('ROOT', dirname(__FILE__).'/');
|
||||
date_default_timezone_set('Asia/Shanghai');
|
||||
$date = date("Y-m-d H:i:s");
|
||||
|
||||
require_once(ROOT."baidupan.class.php");
|
||||
|
||||
|
||||
function daddslashes($string, $force = 0, $strip = FALSE) {
|
||||
!defined('MAGIC_QUOTES_GPC') && define('MAGIC_QUOTES_GPC', get_magic_quotes_gpc());
|
||||
if(!MAGIC_QUOTES_GPC || $force) {
|
||||
if(is_array($string)) {
|
||||
foreach($string as $key => $val) {
|
||||
$string[$key] = daddslashes($val, $force, $strip);
|
||||
}
|
||||
} else {
|
||||
$string = addslashes($strip ? stripslashes($string) : $string);
|
||||
}
|
||||
}
|
||||
return $string;
|
||||
}
|
||||
|
||||
function parselink($link){
|
||||
if(substr($link,0,8)!='bdpan://')return false;
|
||||
$arr = explode('|',$link);
|
||||
$filename = $arr[1];
|
||||
$content_md5 = $arr[2];
|
||||
$slice_md5 = $arr[3];
|
||||
$content_crc32 = $arr[4];
|
||||
$content_length = $arr[5];
|
||||
if($filename && $content_md5 && $slice_md5 && $content_crc32 && $content_length){
|
||||
return array('filename'=>$filename, 'content_md5'=>$content_md5, 'slice_md5'=>$slice_md5, 'content_crc32'=>$content_crc32, 'content_length'=>$content_length);
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -1,210 +0,0 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<title>百度网盘免和谐分享</title>
|
||||
<meta name="description" content="百度网盘免和谐分享平台,利用百度网盘秒传机制,实现任意文件分享链接生成与批量转存">
|
||||
<meta name="keywords" content="百度网盘免和谐分享,百度网盘分享平台,百度网盘分享链接生成,百度网盘直链,bdpan://分享链接一键转存">
|
||||
<link href="//lib.baomitu.com/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
|
||||
<!--[if lt IE 9]>
|
||||
<script src="//lib.baomitu.com/html5shiv/3.7.3/html5shiv.min.js"></script>
|
||||
<script src="//lib.baomitu.com/respond.js/1.4.2/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
<style>
|
||||
body {font-size: 14px !important; font-family: '微软雅黑' !important;}
|
||||
.c_top {margin-top: 60px; padding: 0px !important;}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="navbar navbar-inverse navbar-fixed-top" role="navigation">
|
||||
<div class="container">
|
||||
<div class="navbar-header">
|
||||
<button data-target=".navbar-collapse" data-toggle="collapse" class="navbar-toggle" type="button">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<a href="/" class="navbar-brand">百度网盘免和谐分享</a>
|
||||
</div>
|
||||
<div class="navbar-collapse collapse" id="navbar-main">
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li class="active">
|
||||
<a href="./">一键转存</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="./create.html">一键分享</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="./help.html">帮助</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" align="left" id="getbduss" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
|
||||
<h4 class="modal-title" id="myModalLabel">BDUSS获取方法(以下方法选一种即可)</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<p>① BUDSS在线获取:<a href="https://tool.cccyun.cc/tool/bduss/" target="_blank">点击进入</a><br/>
|
||||
② Chrome浏览器获取方法 <a href="help.html#bduss" target="_blank">查看教程</a></p>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container c_top">
|
||||
<div class="col-md-12">
|
||||
<div class="panel panel-primary">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title text-center">bdpan://分享链接一键转存</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<form id="form1">
|
||||
<div class="input-group">
|
||||
<div class="input-group-addon">BDUSS</div>
|
||||
<input id="bduss" type="text" placeholder="请输入你的百度BDUSS" onkeydown="if(event.keyCode==13){$('#creatlink').click()}" class="form-control">
|
||||
<span class="input-group-btn"><a href="#getbduss" target="_blank" data-toggle="modal" class="btn btn-warning"><i class="glyphicon glyphicon-exclamation-sign"></i></a></span>
|
||||
</div><br/>
|
||||
<div class="input-group">
|
||||
<div class="input-group-addon">网盘路径</div>
|
||||
<input id="path" type="text" placeholder="保存文件的路径,留空默认为根目录" onkeydown="if(event.keyCode==13){$('#creatlink').click()}" class="form-control">
|
||||
</div><br/>
|
||||
<div class="input-group">
|
||||
<div class="input-group-addon">分享链接</div>
|
||||
<textarea id="link" rows="6" class="form-control" placeholder="bdpan://开头的专用分享链接,一行一个"></textarea>
|
||||
</div><br/>
|
||||
<button id="saveFile" class="btn btn-primary btn-block" type="button">立即转存</button>
|
||||
</form>
|
||||
<hr/>
|
||||
<table class="table table-hover">
|
||||
<tbody id="showTable" style="display:none;">
|
||||
<tr class="th">
|
||||
<th width="75%">文件名</th><th width="25%">转存结果</th>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<footer class="footer">
|
||||
<div class="panel-footer text-center">
|
||||
<p>Copyright © 2022 <a href="./" title="百度网盘免和谐分享">百度网盘免和谐分享</a>
|
||||
</div>
|
||||
</footer>
|
||||
<script src="//lib.baomitu.com/jquery/1.12.4/jquery.min.js"></script>
|
||||
<script src="//lib.baomitu.com/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
|
||||
<script src="//lib.baomitu.com/layer/2.3/layer.js"></script>
|
||||
<script src="//lib.baomitu.com/jquery-cookie/1.4.1/jquery.cookie.min.js"></script>
|
||||
<script>
|
||||
function trim(str){ //去掉头尾空格
|
||||
return str.replace(/(^\s*)|(\s*$)/g, "");
|
||||
}
|
||||
$(document).ready(function(){
|
||||
$("#saveFile").click(function(){
|
||||
var self = $(this);
|
||||
var bduss=$("#bduss").val();
|
||||
var path=$("#path").val();
|
||||
var link=$("#link").val();
|
||||
if(bduss=='' || link==''){layer.alert('请确保每项不能为空!');return false;}
|
||||
if(path=='')path='/';
|
||||
if(path.substr(0,1)!='/'){layer.alert('路径填写错误,路径如果需要自定义请以/开头');return false;}
|
||||
if(path.substr(-1,1)!='/')path=path+'/';
|
||||
$("#showTable").html('<tr class="th"><th width="75%">文件名</th><th width="25%">转存结果</th></tr>');
|
||||
$('#showTable').show();
|
||||
$('#saveFile').html('Loading');
|
||||
var count = 0;
|
||||
var success = 0;
|
||||
if (self.attr("data-lock") === "true") return;
|
||||
else self.attr("data-lock", "true");
|
||||
link = link.replace(/\r\n/g, "*").replace(/\n/g, "*").replace(/\r/g, "*");
|
||||
var sum = link.split("*").length;
|
||||
var filepath = path;
|
||||
$.each(link.split("*"), function(i, v) {
|
||||
var url = trim(v);
|
||||
if(url.substr(0,11)=='bdfolder://'){
|
||||
filepath = path + url.substr(11);
|
||||
}
|
||||
if(v=='' || url=='' || url.substr(0,8)!='bdpan://'){sum--;return true;}
|
||||
var ii = layer.load(2, {shade:[0.1,'#fff']});
|
||||
$.ajax({
|
||||
type : "POST",
|
||||
url : "do.php?act=save",
|
||||
data : {bduss:bduss,path:filepath,link:url},
|
||||
dataType : 'json',
|
||||
success : function(data) {
|
||||
layer.close(ii);
|
||||
$('#saveFile').html('立即转存');
|
||||
self.attr("data-lock", "false");
|
||||
if(data.code == 0){
|
||||
$("#showTable").append('<tr><td><font color="blue">'+data.filename+'</font></td><td><font color="green">转存成功</font></td></tr>');
|
||||
success++;
|
||||
}else{
|
||||
$("#showTable").append('<tr><td><font color="blue">'+data.filename+'</font></td><td><font color="red">'+data.msg+'</font></td></tr>');
|
||||
}
|
||||
if (++count === sum) {
|
||||
if(success>0){
|
||||
layer.confirm('本次成功转存<b>'+success+'</b>个文件', {
|
||||
btn: ['进入百度网盘查看','关闭']
|
||||
}, function(){
|
||||
window.open('https://pan.baidu.com/disk/main#/index?category=all&path='+encodeURIComponent(path));
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
$("#bduss").blur(function () {
|
||||
var bduss=$("#bduss").val();
|
||||
if(bduss=='')return;
|
||||
if(bduss.length<10){layer.alert('BDUSS不正确!');return false;}
|
||||
var ii = layer.load(2, {shade:[0.1,'#fff']});
|
||||
$.ajax({
|
||||
type : "POST",
|
||||
url : "do.php?act=check",
|
||||
data : {bduss:bduss},
|
||||
dataType : 'json',
|
||||
success : function(data) {
|
||||
layer.close(ii);
|
||||
if(data.code == -1){
|
||||
layer.alert('BDUSS已经失效!');
|
||||
}else{
|
||||
$.cookie('bduss', bduss);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
if($.cookie('bduss')){
|
||||
var bduss=$.cookie('bduss');
|
||||
if(bduss=='' || bduss.length<10)return;
|
||||
var ii = layer.load(2, {shade:[0.1,'#fff']});
|
||||
$.ajax({
|
||||
type : "POST",
|
||||
url : "do.php?act=check",
|
||||
data : {bduss:bduss},
|
||||
dataType : 'json',
|
||||
success : function(data) {
|
||||
layer.close(ii);
|
||||
if(data.code == -1){
|
||||
$.removeCookie('bduss');
|
||||
}else{
|
||||
$("#bduss").val(bduss);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user