免登录下载天翼云盘分享文件的方法

2020年04月24日

转载自:hostloc社区,作者:MikuSama

脚本地址:https://greasyfork.org/zh-CN/scripts/401709
开源地址:https://github.com/Aruelius/Cloud189_Greasyfork

用法:
1. 脚本会在没有登录的时候运行,登录了不会执行任何操作
2. 当分享的内容为目录时,需要单独点击文件下载,不能打包下载。
3. 当分享的内容问单个文件时,可以直接点击下载按钮下载,不需要点击文件。

如果没有油猴插件或者不想安装脚本的(比如我),你也可以这样做。
1. 新建一个书签,名字叫做【免登录天翼云盘】
2. 网址就填:以下代码
3. 然后每次打开分享链接之后,都点一下这个书签,也可以达到跟安装脚本一样的操作。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
javascript:(function(){'use strict';function sleep(ms){return new Promise(resolve=>setTimeout(resolve,ms))};async function main(ms){while(true){if(document.cookie.indexOf("COOKIE_LOGIN_USE")!=-1){break;};let title=document.getElementsByClassName("title")[0].innerText;let saveAs=document.getElementsByClassName("btn btn-save-as")[0].innerText;if(title!="属于私密分享,请输入访问码后查看"){console.log(title);if(saveAs=="转存当前目录"){let cookie_name="shareId_"+_shareId;let passcode=get_code(cookie_name);get_download_url(passcode);break;}else if(saveAs=="转存到云盘"){document.getElementsByClassName("btn btn-download")[0].target="_blank";document.getElementsByClassName("btn btn-download")[0].href=downloadUrl;document.getElementsByClassName("btn btn-download")[0].className="btn btn-download download";break;};};await sleep(ms);}};function get_code(cookie_name){let ck=document.cookie.split(';');for(let i=0;i<ck.length;i++){let cookie="ck[i].trim();if(cookie.indexOf(cookie_name)==0){return" cookie.split('=")[1];}}};function get_download_url(passcode){let urlArray=new Array();let url=&quot;https://cloud.189.cn/v2/listShareDir.action?shareId=&quot;+_shareId+&quot;&accessCode=&quot;+passcode+&quot;&verifyCode=&quot;+_verifyCode+&quot;&orderBy=1&order=ASC&pageNum=1&pageSize=60&quot;;fetch(url,{method:&quot;GET&quot;}).then(response=>response.json()).then(data=>{for(let i in data.data){let download_url=&quot;https:&quot;+data.data[i].downloadUrl;console.log(download_url);document.getElementsByClassName(&quot;file-icon&quot;)[i].onclick=function(){window.open(download_url);};urlArray[i]=download_url;};return urlArray;});};main(1000);})();
</pre>
<p> <br />
<a href=&quot;https://www.myzhenai.com.cn/wp-content/uploads/2020/04/U53fb9a3684594035baec9d5f14c4e879P.png&quot;><img fetchpriority=&quot;high&quot; decoding=&quot;async&quot; src=&quot;https://www.myzhenai.com.cn/wp-content/uploads/2020/04/U53fb9a3684594035baec9d5f14c4e879P.png&quot; alt=&quot;&quot; width=&quot;719&quot; height=&quot;153&quot; class=&quot;aligncenter size-full wp-image-3276&quot; srcset=&quot;https://myzhenai.com/wp-content/uploads/2020/04/U53fb9a3684594035baec9d5f14c4e879P.png 719w, https://myzhenai.com/wp-content/uploads/2020/04/U53fb9a3684594035baec9d5f14c4e879P-300x64.png 300w&quot; sizes=&quot;(max-width: 719px) 100vw, 719px&quot; /></a></p>
<div class=&quot;wbp-cbm&quot; wb-share-url=&quot;https://myzhenai.com/?p=3275&quot;><div class=&quot;dwqr-inner&quot;><a class=&quot;wb-btn-dwqr wb-btn-donate j-dwqr-donate-btn&quot; rel=&quot;nofollow&quot;><svg class=&quot;wb-icon wbsico-donate&quot;><use xlink:href=&quot;#wbsico-dwqr-donate&quot;></use></svg><span>打赏</span></a><a class=&quot;wb-btn-dwqr wb-btn-like j-dwqr-like-btn&quot; data-count=&quot;1&quot; rel=&quot;nofollow&quot;><svg class=&quot;wb-icon wbsico-like&quot;><use xlink:href=&quot;#wbsico-dwqr-like&quot;></use></svg><span class=&quot;like-count&quot;>赞(1)</span></a><a class=&quot;wb-btn-dwqr wb-share-poster j-dwqr-poster-btn&quot; rel=&quot;nofollow&quot;><svg class=&quot;wb-icon wbsico-poster&quot;><use xlink:href=&quot;#wbsico-dwqr-poster&quot;></use></svg><span>微海报</span></a><a class=&quot;wb-btn-dwqr wb-btn-share j-dwqr-social-btn&quot; rel=&quot;nofollow&quot;><svg class=&quot;wb-icon wbsico-share&quot;><use xlink:href=&quot;#wbsico-dwqr-share&quot;></use></svg><span>分享</span></a></div></div> <!-- chong zhe li kai chi -->
<br><font color=&quot;#7fcce5&quot;>sicnature</font> <font>---------------------------------------------------------------------</font>
<br>
I P 地 址: 216.73.216.234 <br>
区 域 位 置: 美国加利福尼亚洛杉矶 <br>
系 统 信 息: <img src=&quot;https://myzhenai.com/wp-content/themes/book-rev-lite/images/nation/us.png&quot; alt=&quot;美国&quot; title=&quot;美国&quot; width=&quot;16&quot; /> <br><b>Original content, please indicate the source:</b>
<br><a target=&quot;_blank&quot; href=&quot;https://www.myzhenai.com/&quot;>同福客栈论坛</a> | <a target=&quot;_blank&quot;
href=&quot;https://www.python.hn.cn/&quot;>蟒蛇科普</a>
| <a target=&quot;_blank&quot; href=&quot;https://www.haikou-china.com/&quot;>海南乡情论坛</a> | <a target=&quot;_blank&quot;
href=&quot;https://jiayu.mybabya.com/&quot;>JiaYu
Blog</a>
<br><font color=&quot;#7fcce5&quot;>sicnature</font> <font>---------------------------------------------------------------------</font>
<div>
Welcome to reprint. Please indicate the source https://myzhenai.com/post/3275.html </div>
<!-- dao zhe li jie shu -->
<div class=&quot;article-tags&quot;>
<i class=&quot;fa fa-tags&quot;></i>
标签:<a href=&quot;https://myzhenai.com/post/tag/%e5%85%8d%e7%99%bb%e5%bd%95&quot; rel=&quot;tag&quot;>免登录</a>、<a href=&quot;https://myzhenai.com/post/tag/%e5%a4%a9%e7%bf%bc%e4%ba%91%e7%9b%98&quot; rel=&quot;tag&quot;>天翼云盘</a>、<a href=&quot;https://myzhenai.com/post/tag/%e6%b2%b9%e7%8c%b4&quot; rel=&quot;tag&quot;>油猴</a><br /> </div>
</article>
<nav class=&quot;nav-single link-pages&quot;>
<span class=&quot;nav-previous&quot;><a href=&quot;https://myzhenai.com/post/3271.html&quot; rel=&quot;prev&quot;><span class=&quot;meta-nav&quot;>←</span> 安装爱奇艺客户端发现的问题</a></span>
<span class=&quot;nav-next&quot;><a href=&quot;https://myzhenai.com/post/3280.html&quot; rel=&quot;next&quot;>css效果:图片圆形并鼠标悬停时图片360度转动 <span class=&quot;meta-nav&quot;>→</span></a></span>
<div style=&quot;clear:both;&quot;></div>
</nav><!-- .nav-single -->
<section id=&quot;comments-section&quot;>
<header>
<h2>没有评论</h2>
</header>
<div id=&quot;respond&quot; class=&quot;comment-respond&quot;>
<h3 id=&quot;reply-title&quot; class=&quot;comment-reply-title&quot;>发表回复 <small><a rel=&quot;nofollow&quot; id=&quot;cancel-comment-reply-link&quot; href=&quot;/post/3275.html#respond&quot; style=&quot;display:none;&quot;>取消回复</a></small></h3><form action=&quot;https://myzhenai.com/wp-comments-post.php&quot; method=&quot;post&quot; id=&quot;commentform&quot; class=&quot;comment-form&quot;><p class=&quot;comment-notes&quot;><span id=&quot;email-notes&quot;>您的邮箱地址不会被公开。</span> <span class=&quot;required-field-message&quot;>必填项已用 <span class=&quot;required&quot;>*</span> 标注</span></p><p class=&quot;comment-form-comment&quot;><label for=&quot;comment&quot;>评论 <span class=&quot;required&quot;>*</span></label> <textarea id=&quot;comment&quot; name=&quot;comment&quot; cols=&quot;45&quot; rows=&quot;8&quot; maxlength=&quot;65525&quot; required=&quot;required&quot;></textarea></p><p class=&quot;comment-form-author&quot;><label for=&quot;author&quot;>显示名称 <span class=&quot;required&quot;>*</span></label> <input id=&quot;author&quot; name=&quot;author&quot; type=&quot;text&quot; value=&quot;&quot; size=&quot;30&quot; maxlength=&quot;245&quot; autocomplete=&quot;name&quot; required=&quot;required&quot; /></p>
<p class=&quot;comment-form-email&quot;><label for=&quot;email&quot;>邮箱 <span class=&quot;required&quot;>*</span></label> <input id=&quot;email&quot; name=&quot;email&quot; type=&quot;text&quot; value=&quot;&quot; size=&quot;30&quot; maxlength=&quot;100&quot; aria-describedby=&quot;email-notes&quot; autocomplete=&quot;email&quot; required=&quot;required&quot; /></p>
<p class=&quot;comment-form-url&quot;><label for=&quot;url&quot;>网站</label> <input id=&quot;url&quot; name=&quot;url&quot; type=&quot;text&quot; value=&quot;&quot; size=&quot;30&quot; maxlength=&quot;200&quot; autocomplete=&quot;url&quot; /></p>
<p class=&quot;comment-form-cookies-consent&quot;><input id=&quot;wp-comment-cookies-consent&quot; name=&quot;wp-comment-cookies-consent&quot; type=&quot;checkbox&quot; value=&quot;yes&quot; /> <label for=&quot;wp-comment-cookies-consent&quot;>在此浏览器中保存我的显示名称、邮箱地址和网站地址,以便下次评论时使用。</label></p>
<p class=&quot;form-submit&quot;><input name=&quot;submit&quot; type=&quot;submit&quot; id=&quot;submit&quot; class=&quot;submit&quot; value=&quot;发表评论&quot; /> <input type=" hidden'="" name="comment_post_ID" value="3275" id="comment_post_ID">
<input type="hidden" name="comment_parent" id="comment_parent" value="0">
<p></p><p style="display: none;"><input type="hidden" id="akismet_comment_nonce" name="akismet_comment_nonce" value="46c28e631c"></p><p style="display: none !important;" class="akismet-fields-container" data-prefix="ak_"><label>Δ<textarea name="ak_hp_textarea" cols="45" rows="8" maxlength="100"></textarea></label><input type="hidden" id="ak_js_1" name="ak_js" value="1749287765148"><script>document.getElementById( "ak_js_1" ).setAttribute( "value", ( new Date() ).getTime() );</script></p> </ck.length;i++){let>
javascript:(function(){'use strict';function sleep(ms){return new Promise(resolve=>setTimeout(resolve,ms))};async function main(ms){while(true){if(document.cookie.indexOf("COOKIE_LOGIN_USE")!=-1){break;};let title=document.getElementsByClassName("title")[0].innerText;let saveAs=document.getElementsByClassName("btn btn-save-as")[0].innerText;if(title!="属于私密分享,请输入访问码后查看"){console.log(title);if(saveAs=="转存当前目录"){let cookie_name="shareId_"+_shareId;let passcode=get_code(cookie_name);get_download_url(passcode);break;}else if(saveAs=="转存到云盘"){document.getElementsByClassName("btn btn-download")[0].target="_blank";document.getElementsByClassName("btn btn-download")[0].href=downloadUrl;document.getElementsByClassName("btn btn-download")[0].className="btn btn-download download";break;};};await sleep(ms);}};function get_code(cookie_name){let ck=document.cookie.split(';');for(let i=0;i<ck.length;i++){let cookie="ck[i].trim();if(cookie.indexOf(cookie_name)==0){return" cookie.split('=")[1];}}};function get_download_url(passcode){let urlArray=new Array();let url=&quot;https://cloud.189.cn/v2/listShareDir.action?shareId=&quot;+_shareId+&quot;&accessCode=&quot;+passcode+&quot;&verifyCode=&quot;+_verifyCode+&quot;&orderBy=1&order=ASC&pageNum=1&pageSize=60&quot;;fetch(url,{method:&quot;GET&quot;}).then(response=>response.json()).then(data=>{for(let i in data.data){let download_url=&quot;https:&quot;+data.data[i].downloadUrl;console.log(download_url);document.getElementsByClassName(&quot;file-icon&quot;)[i].onclick=function(){window.open(download_url);};urlArray[i]=download_url;};return urlArray;});};main(1000);})(); </pre> <p> <br /> <a href=&quot;https://www.myzhenai.com.cn/wp-content/uploads/2020/04/U53fb9a3684594035baec9d5f14c4e879P.png&quot;><img fetchpriority=&quot;high&quot; decoding=&quot;async&quot; src=&quot;https://www.myzhenai.com.cn/wp-content/uploads/2020/04/U53fb9a3684594035baec9d5f14c4e879P.png&quot; alt=&quot;&quot; width=&quot;719&quot; height=&quot;153&quot; class=&quot;aligncenter size-full wp-image-3276&quot; srcset=&quot;https://myzhenai.com/wp-content/uploads/2020/04/U53fb9a3684594035baec9d5f14c4e879P.png 719w, https://myzhenai.com/wp-content/uploads/2020/04/U53fb9a3684594035baec9d5f14c4e879P-300x64.png 300w&quot; sizes=&quot;(max-width: 719px) 100vw, 719px&quot; /></a></p> <div class=&quot;wbp-cbm&quot; wb-share-url=&quot;https://myzhenai.com/?p=3275&quot;><div class=&quot;dwqr-inner&quot;><a class=&quot;wb-btn-dwqr wb-btn-donate j-dwqr-donate-btn&quot; rel=&quot;nofollow&quot;><svg class=&quot;wb-icon wbsico-donate&quot;><use xlink:href=&quot;#wbsico-dwqr-donate&quot;></use></svg><span>打赏</span></a><a class=&quot;wb-btn-dwqr wb-btn-like j-dwqr-like-btn&quot; data-count=&quot;1&quot; rel=&quot;nofollow&quot;><svg class=&quot;wb-icon wbsico-like&quot;><use xlink:href=&quot;#wbsico-dwqr-like&quot;></use></svg><span class=&quot;like-count&quot;>赞(1)</span></a><a class=&quot;wb-btn-dwqr wb-share-poster j-dwqr-poster-btn&quot; rel=&quot;nofollow&quot;><svg class=&quot;wb-icon wbsico-poster&quot;><use xlink:href=&quot;#wbsico-dwqr-poster&quot;></use></svg><span>微海报</span></a><a class=&quot;wb-btn-dwqr wb-btn-share j-dwqr-social-btn&quot; rel=&quot;nofollow&quot;><svg class=&quot;wb-icon wbsico-share&quot;><use xlink:href=&quot;#wbsico-dwqr-share&quot;></use></svg><span>分享</span></a></div></div> <!-- chong zhe li kai chi --> <br><font color=&quot;#7fcce5&quot;>sicnature</font> <font>---------------------------------------------------------------------</font> <br> I P 地 址: 216.73.216.234 <br> 区 域 位 置: 美国加利福尼亚洛杉矶 <br> 系 统 信 息: <img src=&quot;https://myzhenai.com/wp-content/themes/book-rev-lite/images/nation/us.png&quot; alt=&quot;美国&quot; title=&quot;美国&quot; width=&quot;16&quot; /> <br><b>Original content, please indicate the source:</b> <br><a target=&quot;_blank&quot; href=&quot;https://www.myzhenai.com/&quot;>同福客栈论坛</a> | <a target=&quot;_blank&quot; href=&quot;https://www.python.hn.cn/&quot;>蟒蛇科普</a> | <a target=&quot;_blank&quot; href=&quot;https://www.haikou-china.com/&quot;>海南乡情论坛</a> | <a target=&quot;_blank&quot; href=&quot;https://jiayu.mybabya.com/&quot;>JiaYu Blog</a> <br><font color=&quot;#7fcce5&quot;>sicnature</font> <font>---------------------------------------------------------------------</font> <div> Welcome to reprint. Please indicate the source https://myzhenai.com/post/3275.html </div> <!-- dao zhe li jie shu --> <div class=&quot;article-tags&quot;> <i class=&quot;fa fa-tags&quot;></i> 标签:<a href=&quot;https://myzhenai.com/post/tag/%e5%85%8d%e7%99%bb%e5%bd%95&quot; rel=&quot;tag&quot;>免登录</a>、<a href=&quot;https://myzhenai.com/post/tag/%e5%a4%a9%e7%bf%bc%e4%ba%91%e7%9b%98&quot; rel=&quot;tag&quot;>天翼云盘</a>、<a href=&quot;https://myzhenai.com/post/tag/%e6%b2%b9%e7%8c%b4&quot; rel=&quot;tag&quot;>油猴</a><br /> </div> </article> <nav class=&quot;nav-single link-pages&quot;> <span class=&quot;nav-previous&quot;><a href=&quot;https://myzhenai.com/post/3271.html&quot; rel=&quot;prev&quot;><span class=&quot;meta-nav&quot;>←</span> 安装爱奇艺客户端发现的问题</a></span> <span class=&quot;nav-next&quot;><a href=&quot;https://myzhenai.com/post/3280.html&quot; rel=&quot;next&quot;>css效果:图片圆形并鼠标悬停时图片360度转动 <span class=&quot;meta-nav&quot;>→</span></a></span> <div style=&quot;clear:both;&quot;></div> </nav><!-- .nav-single --> <section id=&quot;comments-section&quot;> <header> <h2>没有评论</h2> </header> <div id=&quot;respond&quot; class=&quot;comment-respond&quot;> <h3 id=&quot;reply-title&quot; class=&quot;comment-reply-title&quot;>发表回复 <small><a rel=&quot;nofollow&quot; id=&quot;cancel-comment-reply-link&quot; href=&quot;/post/3275.html#respond&quot; style=&quot;display:none;&quot;>取消回复</a></small></h3><form action=&quot;https://myzhenai.com/wp-comments-post.php&quot; method=&quot;post&quot; id=&quot;commentform&quot; class=&quot;comment-form&quot;><p class=&quot;comment-notes&quot;><span id=&quot;email-notes&quot;>您的邮箱地址不会被公开。</span> <span class=&quot;required-field-message&quot;>必填项已用 <span class=&quot;required&quot;>*</span> 标注</span></p><p class=&quot;comment-form-comment&quot;><label for=&quot;comment&quot;>评论 <span class=&quot;required&quot;>*</span></label> <textarea id=&quot;comment&quot; name=&quot;comment&quot; cols=&quot;45&quot; rows=&quot;8&quot; maxlength=&quot;65525&quot; required=&quot;required&quot;></textarea></p><p class=&quot;comment-form-author&quot;><label for=&quot;author&quot;>显示名称 <span class=&quot;required&quot;>*</span></label> <input id=&quot;author&quot; name=&quot;author&quot; type=&quot;text&quot; value=&quot;&quot; size=&quot;30&quot; maxlength=&quot;245&quot; autocomplete=&quot;name&quot; required=&quot;required&quot; /></p> <p class=&quot;comment-form-email&quot;><label for=&quot;email&quot;>邮箱 <span class=&quot;required&quot;>*</span></label> <input id=&quot;email&quot; name=&quot;email&quot; type=&quot;text&quot; value=&quot;&quot; size=&quot;30&quot; maxlength=&quot;100&quot; aria-describedby=&quot;email-notes&quot; autocomplete=&quot;email&quot; required=&quot;required&quot; /></p> <p class=&quot;comment-form-url&quot;><label for=&quot;url&quot;>网站</label> <input id=&quot;url&quot; name=&quot;url&quot; type=&quot;text&quot; value=&quot;&quot; size=&quot;30&quot; maxlength=&quot;200&quot; autocomplete=&quot;url&quot; /></p> <p class=&quot;comment-form-cookies-consent&quot;><input id=&quot;wp-comment-cookies-consent&quot; name=&quot;wp-comment-cookies-consent&quot; type=&quot;checkbox&quot; value=&quot;yes&quot; /> <label for=&quot;wp-comment-cookies-consent&quot;>在此浏览器中保存我的显示名称、邮箱地址和网站地址,以便下次评论时使用。</label></p> <p class=&quot;form-submit&quot;><input name=&quot;submit&quot; type=&quot;submit&quot; id=&quot;submit&quot; class=&quot;submit&quot; value=&quot;发表评论&quot; /> <input type=" hidden'="" name="comment_post_ID" value="3275" id="comment_post_ID"> <input type="hidden" name="comment_parent" id="comment_parent" value="0"> <p></p><p style="display: none;"><input type="hidden" id="akismet_comment_nonce" name="akismet_comment_nonce" value="46c28e631c"></p><p style="display: none !important;" class="akismet-fields-container" data-prefix="ak_"><label>Δ<textarea name="ak_hp_textarea" cols="45" rows="8" maxlength="100"></textarea></label><input type="hidden" id="ak_js_1" name="ak_js" value="1749287765148"><script>document.getElementById( "ak_js_1" ).setAttribute( "value", ( new Date() ).getTime() );</script></p> </ck.length;i++){let>
javascript:(function(){'use strict';function sleep(ms){return new Promise(resolve=>setTimeout(resolve,ms))};async function main(ms){while(true){if(document.cookie.indexOf("COOKIE_LOGIN_USE")!=-1){break;};let title=document.getElementsByClassName("title")[0].innerText;let saveAs=document.getElementsByClassName("btn btn-save-as")[0].innerText;if(title!="属于私密分享,请输入访问码后查看"){console.log(title);if(saveAs=="转存当前目录"){let cookie_name="shareId_"+_shareId;let passcode=get_code(cookie_name);get_download_url(passcode);break;}else if(saveAs=="转存到云盘"){document.getElementsByClassName("btn btn-download")[0].target="_blank";document.getElementsByClassName("btn btn-download")[0].href=downloadUrl;document.getElementsByClassName("btn btn-download")[0].className="btn btn-download download";break;};};await sleep(ms);}};function get_code(cookie_name){let ck=document.cookie.split(';');for(let i=0;i