脚本解析城通网盘下载地址

城通网盘下载一直都是一个令人头疼的事情。广告弹窗多,下载速度慢,一直都饱受诟病。可能是官方叫停的缘故,原本可用的解析工具目前也都人间蒸发。近期,城通网盘又变本加厉,限制了免费用户的下载次数,想方设法的让用户充值VIP。

本文更新于2020年4月14日

本文提供一个油猴脚本(你需要在Google Chrome等支持浏览器内安装Tamper Monkey,具体可以点击链接进行查看)

国内网络环境安装Chrome CRX插件可以参考:https://www.jianshu.com/p/23ceaccec17d

使用方法:

  • 打开添加新脚本的界面
  • 将文章末尾提供的代码复制进编辑框内,并点击保存。

此时,打开城通网盘任意的的页面,点击普通下载,可以直接解析出下载链接了。

代码内容:


// ==UserScript==
// @id           ctfile@405647825@qq.com
// @name         城通网盘、皮皮盘、牛盘显示正确下载地址
// @namespace    http://weibo.com/pendave
// @version      0.9.5
// @description  城通网盘、皮皮盘、牛盘显示正确下载地址!去掉遮挡的popjump透明层!自动跳到第二页!
// @author       405647825@qq.com
// @include      *ctfile.com*
// @include      *ctfile.net*
// @include      *pipipan.com*
// @include      *6pan.cc/file-*html
// @include      *666pan.cc/file-*html
// @include      *777pan.cc/file-*html
// @include      *888pan.cc/file-*html
// @grant        GM_xmlhttpRequest
// @grant        GM_setClipboard
// ==/UserScript==
//牛盘
if(location.href.match(/666pan\.cc|6pan\.cc|777pan\.cc|888pan\.cc/g) ){
        var fileCode = location.href.match(/(\d+)\./g)[0].replace('.','');
        //document.querySelector('div.file_item').childNodes[1].innerHTML += '&nbsp;<a id="free_down_link" class="color_btn btn_deep_blue txtwhite" href="http://www.777pan.cc/cd.php?file_id=' + fileCode + '" target="_blank">⇩ 直接下载</a><span>8分钟一次</span>';
        //document.querySelector('#free_down_link').click();
        location.href = 'http://www.777pan.cc/down-' + fileCode + '.html';
}
//城通网盘、皮皮盘
//第一页自动点击按钮
if(location.href.match(/ctfile\.com|pipipan\.com|ctfile\.net/g) && document.querySelector('#free_down_link')){
        document.querySelector('#free_down_link').click();
}
//有pop广告的移除
if(document.querySelector('a[href*="popjump.php"]') !== null){
        var popNode = document.querySelector('a[href*="popjump.php"]');
        popNode.remove();
}
if(document.querySelector('#infoModal') !== null){
        var popNode1 = document.querySelector('#infoModal');
        popNode1.remove();
}
if(document.querySelector('div.modal-backdrop.fade.in') !== null){
        var popNode2 = document.querySelector('div.modal-backdrop.fade.in');
        popNode2.remove();
}
document.querySelector('#page-content > hr').nextElementSibling.remove();
document.querySelector('div.row-fluid.text-center').remove();
var myArray = ["https://www.360banzou.com/sou/","https://www.mybanzou.net","https://www.medicaldupeng.com/zh/","https://medicaldupeng.com/zh/tag/%E5%8C%BB%E5%AD%A6%E6%8F%92%E7%94%BB%E5%B8%88", "https://medicaldupeng.com/zh/%E7%B2%BE%E5%BD%A9%E6%95%99%E7%A8%8B/%E7%8B%AC%E5%AE%B6%E8%AF%BE%E7%A8%8B%E3%80%90%E7%94%9F%E7%89%A9%E5%8C%BB%E5%AD%A6%E7%A7%91%E5%AD%A6%E6%8F%92%E7%94%BB%E5%9F%B9%E8%AE%AD-%E7%9F%A2%E9%87%8F%E5%9B%BE-%E9%AB%98%E8%83%BD%E7%BB%98%E5%9B%BE.html"];
var randomItem = myArray[Math.floor(Math.random()*myArray.length)];
document.querySelector('#page-content > hr').outerHTML += '<iframe style="border: 0px" src="' + randomItem + '" width="775" height="456"></iframe>';
//获取第二页里的真实下载地址 建立copy按钮
//var uid = location.href.match(/\d+/g)[0];
//var fid = location.href.match(/\d+/g)[1];
if(document.body.innerHTML.match(/uid=(\d+)\&fid=(\d+)/g)){
        var uidNfid = document.body.innerHTML.match(/uid=(\d+)\&fid=(\d+)/g)[0];
        //document.querySelector('div.pull-right').querySelector('a').href.match(/.+(uid=\d+&fid=\d+)&.+/)[1];
}
var chk = document.querySelector('#free_down_link').onclick.toString().match(/,\s'(.+)',\s/)[1];
var jsonUrl = location.href.match(/^.*\/\/[^\/]+/g)[0]+"/get_file_url.php?"+uidNfid+"&file_chk="+chk+"&verifycode=";
console.warn(jsonUrl);
GM_xmlhttpRequest({
        method: 'GET',
        url:  jsonUrl,
        headers: {
                'User-agent': 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.146 Safari/537.36',
                'Accept': 'text/javascript,application/json',
        },
        onload: function(responseDetails) {
                //console.warn(responseDetails.responseText);
                var jsonData = eval('(' + responseDetails.responseText + ')');
                //console.warn(jsonData);
                var downUrl = jsonData.downurl;
                unsafeWindow.copyJsonMenu = function() {
                        GM_setClipboard(downUrl);
                };
                setTimeout(document.querySelector('#free_down_link').nextSibling.innerHTML = '<button style="position: absolute; top: 0px; right: 0px; width: 100%; height: 100%; border: unset; background: rgba(23,160,94,0.8);" onclick="copyJsonMenu();this.style.background=\'rgba(247,206,37,0.8)\';">Copy真实下载地址</button>',200);
        }
});

发表评论

邮箱地址不会被公开。 必填项已用*标注