本帖最后由 好鸭 于 2022-5-17 17:06 编辑
- curl -L "https://xxxx-my.sharepoint.com/personal/xxxxxxxxxxxxxxxxxx"
- -A "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.84 Safari/537.36" -s -I|grep set-cookie|grep FedAuth
复制代码
链接改成分享链接(不然很可能获取不到cookie,重复提一次,是分享链接)
适合在那种一个分享链接里文件特别多的,获取了直链配合脚本来用
比如那个暴力猴脚本https://github.com/kaaass/sharepoint-list-plugin
复制了很多链接后
wget -x可以保留目录结构
- echo -e "https://https://xxxx-my.sharepoint.com/personal/xxxxxxxxxxxxxxxxxx/1.mp4
- https://https://xxxx-my.sharepoint.com/personal/xxxxxxxxxxxxxxxxxx/2.mp4
- https://https://xxxx-my.sharepoint.com/personal/xxxxxxxxxxxxxxxxxx/3.mp4
- https://https://xxxx-my.sharepoint.com/personal/xxxxxxxxxxxxxxxxxx/4.mp4"|while read url;do
-
- cookie="`curl -L "https://mianmail-my.sharepoint.com/personal/larry01_mianmail_onmicrosoft_com/_layouts/15/guestaccess.aspx?folderid=0409c294f842a45efbf1fca0edeae1a81&authkey=AQNtcjUo9YH1oFShAnHapgU&e=ph0MUw" -A "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.84 Safari/537.36" -s -I|grep set-cookie|grep FedAuth|sed ‘s/set-cookie: //’`"
-
- wget –header "cookie: $cookie" -x "$url"
-
- done
复制代码
如果文件不是特别多,一两个小时可以下完的,直接写死cookie就行了(脚本里获取是怕cookie过期)
- echo -e "https://https://xxxx-my.sharepoint.com/personal/xxxxxxxxxxxxxxxxxx/1.mp4
- https://https://xxxx-my.sharepoint.com/personal/xxxxxxxxxxxxxxxxxx/2.mp4
- https://https://xxxx-my.sharepoint.com/personal/xxxxxxxxxxxxxxxxxx/3.mp4
- https://https://xxxx-my.sharepoint.com/personal/xxxxxxxxxxxxxxxxxx/4.mp4"|while read url;do
-
- cookie=’FedAuth=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx;’
-
- wget –header "cookie: $cookie" -x "$url"
-
- done
复制代码
|