function generateSubscriptionUrl() {
const getCookie = (name) => {
const value = '; ' + document.cookie;
const parts = value.split('; ' + name + '=');
if (parts.length === 2) {
return parts.pop().split(';').shift();
}
};
const main_login = getCookie('main_login');
if (main_login) {
let url;
if (main_login === 'qq') {
const vqq_appid = getCookie('vqq_appid');
const vqq_openid = getCookie('vqq_openid');
const vqq_access_token = getCookie('vqq_access_token');
if (vqq_appid && vqq_openid && vqq_access_token) {
url = `https://livednow.org/tencent/list?main_login=${main_login}&vqq_appid=${vqq_appid}&vqq_openid=${vqq_openid}&vqq_access_token=${vqq_access_token}`;
console.log('你的订阅配置为:', url);
return url;
} else {
console.log('One or more QQ cookies are missing');
}
} else if (main_login === 'wx') {
const appid = getCookie('appid');
const openid = getCookie('openid');
const access_token = getCookie('access_token');
const vuserid = getCookie('vuserid');
const refresh_token = getCookie('refresh_token');
if (appid && openid && access_token && vuserid && refresh_token) {
url = `https://livednow.org/tencent/list?main_login=${main_login}&appid=${appid}&openid=${openid}&access_token=${access_token}&vuserid=${vuserid}&refresh_token=${refresh_token}`;
console.log('你的订阅配置为:', url);
return url;
} else {
console.log('One or more WeChat cookies are missing');
}
}
} else {
console.log('main_login cookie is missing');
}
}
generateSubscriptionUrl();