// ==UserScript==
// @name 阿里云盘会员青春版
// @author hmjz100、涛之雨
// @namespace github.com/hmjz100
// @version 1.0.0
// @description 《也许同类型中最好用?》系列 - 显示阿里云盘身份信息为会员,支持使用视频倍速、修改视频画质、修改头像、修改用户名等功能,自定义程度超高!需要修改头部代码来配置显示内容(非常简单!)
// @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABICAYAAABV7bNHAAAAAXNSR0IArs4c6QAAAARzQklUCAgICHwIZIgAABadSURBVHic7ZtpjJ3Xed9/Z3m3u8ydnUNySFEkLcmUJUuRDdmRg9BuGsNJ3LhIKaSAkdpo0w9FgCwtajhdosJt2vRTkaQfmqJ1G8d2A6aI67aJIzeoasWx1UZeZFsSLYocicNltru/69n64Y5RN7ZciaLkfpg/cDEzuJh3zvOb55zzPP9zLhzoQAc60IEOdKADHehABzrQgV5vie/XH37kkUfk3hNPRP0+SZy4nkQta+26CGmUsENV17tJlhXjE3vNv/qtJ62A8P0Y5+sK6MyZc/Fdi24dnz/kTPWuopzcn9f5al5XHWOMcsErRQiJUq4T62YhS0ZLreiF+Vb2hV6afJYkfooHzvYfeeQR/3qN+fUAJN7+9nPpkhfvrOrBXyuq0Xuu9XdaeVUr78ELQAhEAAgI7xHBowLEXtIWCW2dhNWetrettbZWF9VHUx3/h9OdtQsPnz/vXvPBv5YPP3v2rC6Hh9/ZofrwYHjjob3xILZ4iFvEaZc4aaN1CyU0IniCMzhT4UyJNSXO1GjjaZuYedehQ0Ka2nD4iB0fPy4/kfr4H//cZz97/bWcfq8ZoHtP/Z3Vbsf/A5rhB+rx1U4IJU1vjmxlnbnlY3S6iyQqRToBjUdaS7AN3lS4OqepJpTFkCIfUZdTqDxzdYtjZokVNDbb8Ysnp1eWlvnl5Y2533v46fPNaxHHawFInF78zJmVtehf+6h+sDJfknF0md7xY6ycOkNncQXtAz4vMJMcMy3A1ChvUSGgCcgQECGAM5imoizH5NMB0/EEUQROmCXuZgkrBoRD1+tD6+E3kr7+hw9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H8A3/u04uXq9bhILt9xvHciUa2fX1tYerjX6q26UMnCjKlsTV478sZTWqgMNHZ2rcUB3s+GFxCzGxxCoVSMlhlROk978TitlSO2nI4v9W9s/tZ4PPjtGzce/7+m+6vV6/lRBHlseXlNh+gDC935H13qrr6lHctESJSUTnhb0tiGxjoaHzAOnBcEJMgYqTNU3EMkvaDjtvNRPB0Ndx4f7l37tFLF+UuXnhzzGlwo/358mEUA0Wpv9Vgs4wdbWeuOOOq8KUpa96RxtpLoWMdaKS01QkicFL5xwjbB972zX67r8qm9vH/BWv0nm5vNNjw5M65fw8F+vyXgAX3o0GasC52GKG0pLeIoeGlS6SMXG40tBkZXx3ey+snXGMiBDnSgAx3oQAc60IEOdKADHehA/9/rfwMhhkaMcIfnyQAAAABJRU5ErkJggg==
// @license MIT
// @match *://*.aliyundrive.com/*
// @match *://*.alipan.com/*
// @run-at document-start
// @grant unsafeWindow
// ==/UserScript==
(function () {
var user = {
// 以下设置项中,常规项目(就是以//开头注释的项目)除非特殊说明,否则一般 0 为关闭,1 为开启
vip: 1, // 开启超级会员修改(总开关)
// 以下是自定义项目(以/*开头注释的项目),修改也非常简单
/*
自定义用户名与头像还有邮箱、手机号,留空则使用已登录账号数据
*/
name: "百见不如一试",
photo: "https://cdn.auth0.com/avatars/bj.png",
mail: "", // 最好不改,我怕影响支付
phone: "", // 最好不改,我怕影响支付
/*
会员过期时间 格式为Unix时间戳,可留空为""
1596211200 - 2020-08-01 00:00:00 (阿里云盘上线时)
2147483648 - 2038-01-19 11:14:08 (2038问题时)
253402185600 - 9999-12-31 00:00:00 (终极时)
*/
endtime: 253402185600,
// 以下的常规项目(就是以//开头注释的项目)均为独立功能,不受总开关控制
analytics: 0, // 允许阿里云盘网页分析浏览信息,建议 0,分析原理是以 new Image 或 navigator.sendBeacon 的形式让浏览器访问特殊的图片来给服务器传递信息
debug: 1, // 显示本脚本的调试信息到 JavaScript 控制台中,建议 0,另外,1 显示所有
}
var originalOpen = XMLHttpRequest.prototype.open;
var originalSendBeacon = navigator.sendBeacon;
unsafeWindow.XMLHttpRequest.prototype.open = function (method, url) {
url = new URL(url, location.origin).href;
this.url = url
if (url.includes('v2/user/get')) {
// 用户信息
user.vip ? this.addEventListener('readystatechange', function () {
if (this.readyState === 4 && this.status === 200) {
let res, oriRes
try {
res = JSON.parse(this.responseText), oriRes = JSON.parse(this.responseText)
} catch (e) {
res = this.response, oriRes = this.response
}
user.name ? res.nick_name = res.display_name = user.name : ""
user.photo ? res.avatar = user.photo : ""
user.mail ? res.email = user.mail : ""
user.phone ? res.phone = user.phone : ""
user.vip ? res.vip_identity = "svip" : ""
if (user.debug === 1) console.log("【阿里云盘会员青春版】Hook XHR", "\n请求地址:", url, "\n原始回复:", oriRes, "\n修改回复:", res)
Object.defineProperty(this, "responseText", {
writable: true,
});
Object.defineProperty(this, "response", {
writable: true,
});
this.response = JSON.stringify(res)
this.responseText = JSON.stringify(res)
}
}) : ""
} else if (url.includes('vip/info')) {
// 会员信息
user.vip ? this.addEventListener('readystatechange', function () {
if (this.readyState === 4 && this.status === 200) {
let res, oriRes
try {
res = JSON.parse(this.responseText), oriRes = JSON.parse(this.responseText)
} catch (e) {
res = this.response, oriRes = this.response
}
res.identity = "svip";
res.icon = "https://gw.alicdn.com/imgextra/i1/O1CN01Tk0oGw1xZoemH3Wyb_!!6000000006458-2-tps-72-72.png"
res.vipList = [
{
"name": "超级会员",
"code": "svip",
"promotedAt": 0,
"expire": user.endtime ? user.endtime : 9705273204
}
];
if (user.debug === 1) console.log("【阿里云盘会员青春版】Hook XHR", "\n请求地址:", url, "\n原始回复:", oriRes, "\n修改回复:", res)
Object.defineProperty(this, "responseText", {
writable: true,
});
Object.defineProperty(this, "response", {
writable: true,
});
this.response = JSON.stringify(res)
this.responseText = JSON.stringify(res)
}
}) : ""
} else if (url.includes('feature/list')) {
// 功能信息
user.vip ? this.addEventListener('readystatechange', function () {
if (this.readyState === 4 && this.status === 200) {
let res, oriRes
try {
res = JSON.parse(this.responseText), oriRes = JSON.parse(this.responseText)
} catch (e) {
res = this.response, oriRes = this.response
}
res.identity = 'svip';
/*function setInterceptFalse(feature) {
feature.intercept = false;
if (feature.features) {
feature.features = feature.features.map(subFeature => {
return setInterceptFalse(subFeature);
});
}
return feature;
}
res.features = res.features.map(feature => setInterceptFalse(feature));*/
res.features = [];
if (user.debug === 1) console.log("【阿里云盘会员青春版】Hook XHR", "\n请求地址:", url, "\n原始回复:", oriRes, "\n修改回复:", res)
Object.defineProperty(this, "responseText", {
writable: true,
});
Object.defineProperty(this, "response", {
writable: true,
});
this.response = JSON.stringify(res)
this.responseText = JSON.stringify(res)
}
}) : ""
}
return originalOpen.apply(this, arguments);
};
if (user.analytics === 0) unsafeWindow.Image = function () {
const img = new Image();
return new Proxy(img, {
set(target, prop, value) {
if (prop === 'src' && value.includes('web.action')) {
let url = new URL(value, location.origin);
if (user.debug === 1) console.warn("【阿里云盘会员青春版】unAnalytics", '\n类型:new Image\n禁止网页分析信息:', url.href);
return true; // 阻止设置
}
target[prop] = value; // 设置其他属性
return true;
},
get(target, prop) {
return target[prop]; // 获取属性值
}
});
};
if (user.analytics === 0) unsafeWindow.navigator.sendBeacon = function (src, data) {
let url = new URL(src, location.origin);
if (url.includes('jssdk/upload')) {
if (user.debug === 1) console.warn("【阿里云盘会员青春版】unAnalytics", '\n类型:navigator.sendBeacon\n禁止网页分析信息:', url.href)
return true;
}
return originalSendBeacon.apply(this, arguments);
};
})();