Skip to content

Commit d8ab7ad

Browse files
committed
修复: Twitter转推失败;
优化: 部分说明文本
1 parent fa172ff commit d8ab7ad

20 files changed

+200
-63
lines changed

.github/workflows/Release.yml

+5-3
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,11 @@ jobs:
2121
uses: softprops/action-gh-release@v1
2222
with:
2323
prerelease: false
24-
tag_name: v4.7.7
25-
name: 4.7.7
26-
body: '- 修复: 部分非标准Steam群组链接处理错误'
24+
tag_name: v4.7.8
25+
name: 4.7.8
26+
body: |-
27+
- 修复: Twitter转推失败
28+
- 优化: 部分说明文本
2729
files: |-
2830
dist/auto-task-v4-for-giveawaysu.user.js
2931
dist/auto-task-v4.compatibility.user.js

dist/auto-task-v4-for-giveawaysu.all.user.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/auto-task-v4-for-giveawaysu.user.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/auto-task-v4.all.user.js

+38-7
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// ==UserScript==
22
// @name auto-task-v4
33
// @namespace auto-task-v4
4-
// @version 4.7.7
4+
// @version 4.7.8
55
// @description 自动完成 Freeanywhere,Giveawaysu,GiveeClub,Givekey,Gleam,Indiedb,keyhub,OpiumPulses,Opquests,SweepWidget 等网站的任务。
66
// @description:en Automatically complete the tasks of FreeAnyWhere, GiveawaySu, GiveeClub, Givekey, Gleam, Indiedb, keyhub, OpiumPulses, Opquests, SweepWidget websites.
77
// @author HCLonely
@@ -273,6 +273,7 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载');
273273
axiosGM
274274
} = __webpack_require__(945);
275275
const {
276+
getIndices,
276277
getAnimationKey
277278
} = __webpack_require__(702);
278279
const {
@@ -299,7 +300,7 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载');
299300
const verification = decodeBase64(content);
300301
const frames = root.querySelectorAll('[id^=\'loading-x-anim\']');
301302
const svgArray = svgKey(verification, frames);
302-
const indexKey = [ 38, 29, 43, 3 ];
303+
const indexKey = await getIndices(html);
303304
const animationKey = getAnimationKey(svgArray, verification, indexKey);
304305
return {
305306
get: (method, path) => generateTransactionId(method, path, content, animationKey.join(''))
@@ -342,7 +343,10 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载');
342343
___CSS_LOADER_EXPORT___.push([ module.id, `.colorful-button,#auto-task-buttons a.auto-task-website-btn,.show-button-div a.auto-task-website-btn,body.auto-task-options .auto-task-form table button{position:relative;padding:5px 10px;text-align:center;color:#fff;-webkit-text-decoration:none;text-decoration:none;background:linear-gradient(90deg, #03a9f4, #f441a5, #ffeb3b, #03a9f4);border-radius:30px;background-size:400%;text-transform:capitalize}.colorful-button:hover,#auto-task-buttons a.auto-task-website-btn:hover,.show-button-div a.auto-task-website-btn:hover,body.auto-task-options .auto-task-form table button:hover{transform:scale(1.05);box-shadow:0 6px 20px rgba(0,0,0,.3);cursor:pointer}.colorful-button:hover::before,#auto-task-buttons a.auto-task-website-btn:hover::before,.show-button-div a.auto-task-website-btn:hover::before,body.auto-task-options .auto-task-form table button:hover::before{filter:blur(10px);opacity:1}.colorful-button::before,#auto-task-buttons a.auto-task-website-btn::before,.show-button-div a.auto-task-website-btn::before,body.auto-task-options .auto-task-form table button::before{content:"";position:absolute;top:-5px;left:-5px;right:-5px;bottom:-5px;z-index:-1;background:linear-gradient(90deg, #03a9f4, #f441a5, #ffeb3b, #03a9f4);border-radius:40px;background-size:400%;opacity:-1}#auto-task-info{position:fixed;bottom:10px;right:10px;width:60%;max-width:500px;max-height:60%;overflow-y:auto;color:#000;background-color:#fff;padding-left:5px;z-index:999999999 !important;border:solid 2px #add8e6;border-radius:10px}#auto-task-info li{text-align:left}#auto-task-info li a.high-light{color:#00aeff;font-weight:bold}#auto-task-info .success{color:green}#auto-task-info .error{color:red}#auto-task-info .warning{color:blue}#auto-task-info .info{color:#ff0}#auto-task-info .update-text{color:green;border:solid 2px #8dcb69;margin:5px 10px 5px 20px;border-radius:10px;padding:5px 20px}.auto-task-keylol{display:inline-block;text-transform:capitalize;margin-left:10px;-webkit-text-decoration:none !important;text-decoration:none !important;border:solid 1px;border-radius:5px;padding:0 2px}.auto-task-keylol[selected=selected]{background-color:blue !important;color:#fff !important}.auto-task-form table{font-family:verdana,arial,sans-serif;font-size:11px;color:#333;border-width:1px;border-color:#999;border-collapse:collapse;width:100%}.auto-task-form table thead td{border-width:1px;padding:8px;border-style:solid;border-color:#a9c6c9;font-weight:bold;background-color:#fff}.auto-task-form table tbody tr{background-color:#d4e3e5}.auto-task-form table tbody tr:hover{background-color:#ff6 !important}.auto-task-form table tbody tr th{background-color:#c3dde0;border-width:1px;padding:8px;border-style:solid;border-color:#a9c6c9;text-transform:capitalize}.auto-task-form table tbody tr td{border-width:1px;padding:8px;border-style:solid;border-color:#a9c6c9}.swal2-modal{width:70% !important;max-width:1000px !important}body.auto-task-options{padding-top:10px;text-align:center}body.auto-task-options .auto-task-form{width:80%;max-width:1000px;margin:0 auto;padding-bottom:20px}body.auto-task-options .auto-task-form table input.editOption{width:80%}body.auto-task-options .auto-task-form table #getTwitterUserId,body.auto-task-options .auto-task-form table #getYoutubeChannelId{margin-top:5px}body.auto-task-options .auto-task-form table button{z-index:1}body.auto-task-options .auto-task-form table input[type=text]{outline-style:none;border:1px solid #ccc;border-radius:3px;padding:5px 10px;font-size:14px}body.auto-task-options .auto-task-form table input[type=text]:focus{border-color:#66afe9;outline:0;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6)}body.auto-task-options .auto-task-form table label{position:relative;width:160px;height:80px;cursor:pointer;transform:scale(0.25);margin:-25% 0;top:-30px;display:inline-block}body.auto-task-options .auto-task-form table label input{position:relative;z-index:1;appearance:none}body.auto-task-options .auto-task-form table label input:checked~span{background:#05be05;box-shadow:0 15px 25px rgba(5,190,5,.4)}body.auto-task-options .auto-task-form table label input:checked~span i{left:84px}body.auto-task-options .auto-task-form table label input:checked~span i::before{background:#05be05;box-shadow:35px 0 0 #05be05}body.auto-task-options .auto-task-form table label input:checked~span i::after{bottom:12px;height:15px;border-bottom-left-radius:15px;border-bottom-right-radius:15px;background:#05be05}body.auto-task-options .auto-task-form table label span{position:absolute;top:0;left:0;width:100%;height:100%;background:#fe0000;border-radius:80px;transition:.5s;box-shadow:0 15px 25px rgba(254,0,0,.4)}body.auto-task-options .auto-task-form table label span i{position:absolute;top:4px;left:4px;width:72px;height:72px;background:#fff;border-radius:50%}body.auto-task-options .auto-task-form table label span i::before{content:"";position:absolute;top:22px;left:12px;width:12px;height:12px;border-radius:50%;background:#fe0000;box-shadow:35px 0 0 #fe0000;transition:.5s}body.auto-task-options .auto-task-form table label span i::after{content:"";position:absolute;bottom:15px;left:calc(50% - 15px);width:30px;height:6px;border-radius:6px;background:#fe0000;transition:.5s}body.auto-task-history{font-size:15px;font-weight:400;line-height:1.5}body.auto-task-history .container a{color:#007bff;-webkit-text-decoration:none;text-decoration:none;background-color:rgba(0,0,0,0)}body.auto-task-history .container .card{width:80%;max-width:800px;border-radius:10px;background:rgba(118,118,118,.1019607843);border-top:1px solid hsla(0,0%,100%,.5019607843);-webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px);box-shadow:0 15px 25px rgba(0,0,0,.1019607843);margin:20px auto;position:relative;display:flex;flex-direction:column;word-wrap:break-word;-webkit-background-clip:border-box;background-clip:border-box;border:1px solid rgba(0,0,0,.125);border-radius:.25rem}body.auto-task-history .container .card .title{text-align:center;font-size:30px;font-weight:bold;margin:5px 0}body.auto-task-history .container .card .title a:hover{-webkit-text-decoration:none;text-decoration:none;background:#93e1ff;border-radius:10px;padding:3px}body.auto-task-history .container .card ul{margin-bottom:25px}body.auto-task-history .container .card ul li{margin-bottom:5px;line-height:20px}body.auto-task-history .container .card ul a:hover{-webkit-text-decoration:underline;text-decoration:underline}body.auto-task-history .container .card .delete-task{right:10px;width:38px;height:35px;position:absolute;font-size:24px;cursor:pointer;border-radius:10px}body.auto-task-history .container .card .delete-task:hover{background:#fff}body.auto-task-history .container .card .time{right:5px;position:absolute;bottom:0;color:#e83e8c;font-family:'SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace';font-size:15px}#auto-task-buttons,.show-button-div{position:fixed;top:30px;right:15px;width:124px;z-index:999999999 !important;transform:scale(0.85)}#auto-task-buttons p,.show-button-div p{line-height:30px;height:40px;text-align:center;margin:5px !important}#auto-task-buttons a.auto-task-website-btn,.show-button-div a.auto-task-website-btn{width:105px;line-height:27px;font-size:20px;display:block}.show-button-div{width:20px}.auto-task-capitalize{text-transform:capitalize !important}.swal2-file:focus,.swal2-input:focus,.swal2-textarea:focus{box-shadow:inset 0px 0px 4px 1px rgba(100,150,200,.5) !important}.swal2-checkbox-custom{align-items:center;justify-content:center;background:#fff;color:inherit;margin:1em auto}.swal2-checkbox-custom input{flex-shrink:0;margin:0 .4em}.giveaway-actions #getKey{display:none !important}.auto-task-giveaway-status{color:#fff;border-radius:10px;padding:0 5px;margin-left:5px}.auto-task-giveaway-status.active{background-color:#5cb85c}.auto-task-giveaway-status.not-active{background-color:#d9534f}`, '' ]);
343344
const __WEBPACK_DEFAULT_EXPORT__ = ___CSS_LOADER_EXPORT___.toString();
344345
},
345-
702: function(module) {
346+
702: function(module, __unused_webpack_exports, __webpack_require__) {
347+
const {
348+
axiosGM
349+
} = __webpack_require__(945);
346350
const totalTime = 4096;
347351
const calculateScaledValue = (scalingFactor, baseValue, targetValue, roundToInteger) => {
348352
const result = scalingFactor * (targetValue - baseValue) / 255 + baseValue;
@@ -454,7 +458,32 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载');
454458
}
455459
return hexArray;
456460
};
461+
const getIndices = async html => {
462+
const ON_DEMAND_FILE_REGEX = /['"](ondemand\.s)['"]:\s*['"]([\w]*)['"]/gim;
463+
const INDICES_REGEX = /\(\w\[(\d{1,2})\],\s*16\)/gim;
464+
const onDemandMatch = ON_DEMAND_FILE_REGEX.exec(html);
465+
const keyByteIndices = [];
466+
if (onDemandMatch) {
467+
const url = `https://abs.twimg.com/responsive-web/client-web/ondemand.s.${onDemandMatch[2]}a.js`;
468+
try {
469+
const {
470+
data
471+
} = await axiosGM.get(url);
472+
const matches = data.matchAll(INDICES_REGEX);
473+
for (const match of matches) {
474+
keyByteIndices.push(parseInt(match[1], 10));
475+
}
476+
} catch (error) {
477+
console.error('Failed to fetch ondemand file:', error);
478+
}
479+
}
480+
if (keyByteIndices.length < 4) {
481+
throw new Error('Couldn\'t get KEY_BYTE indices');
482+
}
483+
return keyByteIndices;
484+
};
457485
module.exports = {
486+
getIndices: getIndices,
458487
getAnimationKey: getAnimationKey
459488
};
460489
},
@@ -1964,7 +1993,8 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载');
19641993
tasksNotCompleted: '任务未完成',
19651994
notConnect: '社交平台未连接,跳过任务',
19661995
tgTaskNotice: '检测到Telegram任务,需要手动完成',
1967-
confirmingTask: '正在跳过警告页面...'
1996+
confirmingTask: '正在跳过警告页面...',
1997+
unSupporttedTaskType: '不支持的任务类型'
19681998
};
19691999
const zh_CN = data;
19702000
const en_US_data = {
@@ -2253,7 +2283,8 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载');
22532283
tasksNotCompleted: 'Tasks Not Completed',
22542284
notConnect: 'Social platform is not connectted, skip',
22552285
tgTaskNotice: 'The telegram task is checked, need to do it yourself!',
2256-
confirmingTask: 'Confirming task...'
2286+
confirmingTask: 'Confirming task...',
2287+
unSupporttedTaskType: 'Unsupportted task type'
22572288
};
22582289
const en_US = en_US_data;
22592290
const languages = {
@@ -3689,7 +3720,7 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载');
36893720
});
36903721
if (result === 'Success') {
36913722
if (data?.status === 200 || data?.status === 403 && data.response?.errors?.[0]?.code === 327) {
3692-
if (data.response?.errors) {
3723+
if (data.response?.errors && data.response?.errors?.[0]?.code !== 327) {
36933724
logStatus.error(`Error:${data.response?.errors?.[0]?.message}`);
36943725
return false;
36953726
}
@@ -9796,7 +9827,7 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载');
97969827
this.undoneTasks.twitter.userLinks.push(link);
97979828
} else if (link.includes('//x.com/') && link.includes('status') && /Repost/gim.test(taskDes)) {
97989829
this.undoneTasks.twitter.retweetLinks.push(link);
9799-
} else if (/clash.gg/.test(link)) {
9830+
} else if (/clash\.gg/.test(link)) {
98009831
scripts_echoLog({}).warning(`${i18n('unSupporttedTaskType')}: ${taskDes}(${link})`);
98019832
} else {
98029833
scripts_echoLog({}).warning(`${i18n('unKnownTaskType')}: ${taskDes}(${link})`);

dist/auto-task-v4.compatibility.all.user.js

+4-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/auto-task-v4.compatibility.user.js

+4-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)