Last active
June 22, 2016 20:38
-
-
Save markx/b6879af1f79df6bff3ad to your computer and use it in GitHub Desktop.
upload mulitple ed2k resources
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Baidupan Multi-post | |
// @namespace http://use.i.E.your.homepage/ | |
// @version 0.1 | |
// @description enter something useful | |
// @match http*://pan.baidu.com/disk* | |
// @copyright 2012+, Ke Xu <[email protected]> | |
// @run-at document-end | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
var d = function(){ | |
var input=prompt('输入链接,用换行隔开'); | |
if(!input) { return ;} | |
var links=input.split('\n'); | |
console.log(links); | |
var url= "//pan.baidu.com/rest/2.0/services/cloud_dl?bdstoken=a3f3179f6d15258458deaaed11bf1cec&channel=chunlei&clienttype=0&web=1"; | |
for(var i in links){ | |
var xhr = new XMLHttpRequest(); | |
xhr.open("POST", url); | |
xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); | |
xhr.send("method=add_task&app_id=250528&source_url="+links[i]+"&save_path=%2F&type=3"); | |
} | |
}; | |
var span = document.createElement('span'); | |
span.className='g-button-right'; | |
span.textContent='批量离线'; | |
var btn = document.createElement('a'); | |
btn.className='g-button'; | |
btn.onclick=d; | |
btn.appendChild(span); | |
var bar = document.querySelector('#layoutMain > div.module-toolbar.g-clearfix > div.default-dom > div.bar > div:nth-child(2)'); | |
bar.appendChild(btn); | |
})(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Baidupan Multi-post | |
// @namespace http://use.i.E.your.homepage/ | |
// @version 0.1 | |
// @description enter something useful | |
// @match http://pan.baidu.com/disk* | |
// @copyright 2012+, markwithk <[email protected]> | |
// @updateURL https://gist.github.com/markwithk/b6879af1f79df6bff3ad#file-baidupanpost-js | |
// @run-at document-end | |
// ==/UserScript== | |
var d = function(){ | |
var input=prompt('输入链接,用换行隔开'); | |
if(!input) { return ;} | |
var links=input.split('\n'); | |
var url= "http://pan.baidu.com/rest/2.0/services/cloud_dl?bdstoken=a3f3179f6d15258458deaaed11bf1cec&channel=chunlei&clienttype=0&web=1" | |
for(var i in links){ | |
var xhr = new XMLHttpRequest(); | |
xhr.open("POST", url); | |
xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); | |
xhr.send("method=add_task&app_id=250528&source_url="+links[i]+"&save_path=%2F&type=3"); | |
}; | |
}; | |
var bar = document.getElementById('yao-main').children[0].children[0].children[1]; | |
var btn = document.createElement('a'); | |
btn.className='icon-btn-download'; | |
btn.textContent='批量离线'; | |
btn.onclick=d; | |
bar.appendChild(btn); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment