Skip to content

Commit 3905808

Browse files
committed
修复:Steam换区失败
1 parent 9b98a1f commit 3905808

18 files changed

+2523
-2373
lines changed

.github/workflows/Release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ jobs:
2121
uses: softprops/action-gh-release@v1
2222
with:
2323
prerelease: false
24-
tag_name: v4.2.35
25-
name: 4.2.35
24+
tag_name: v4.2.36
25+
name: 4.2.36
2626
body: '- 修复:Steam换区失败'
2727
files: |-
2828
dist/auto-task-v4-for-giveawaysu.user.js

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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 40 additions & 18 deletions
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.2.35
4+
// @version 4.2.36
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
@@ -4438,9 +4438,31 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载');
44384438
});
44394439
if (result === 'Success') {
44404440
if ((data === null || data === void 0 ? void 0 : data.status) === 200) {
4441-
var _data$responseText$ma5;
4442-
const currentArea = (_data$responseText$ma5 = data.responseText.match(/<input id="usercountrycurrency".*?value="(.+?)"/)) === null || _data$responseText$ma5 === void 0 ? void 0 : _data$responseText$ma5[1];
4443-
const areas = [ ...data.responseText.matchAll(/<div class="currency_change_option .*?" data-country="(.+?)" >/g) ].map(search => search[1]);
4441+
var _data$responseText$ma5, _data$responseText$ma6;
4442+
const cartConfigRaw = (_data$responseText$ma5 = data.responseText.match(/data-cart_config="(.*?)"/)) === null || _data$responseText$ma5 === void 0 ? void 0 : _data$responseText$ma5[1];
4443+
const temp = document.createElement('div');
4444+
temp.innerHTML = cartConfigRaw || '{}';
4445+
const cartConfigStr = temp.textContent || temp.innerText;
4446+
let cartConfig;
4447+
try {
4448+
cartConfig = JSON.parse(cartConfigStr);
4449+
} catch (error) {
4450+
logStatus.error('Error: get country info filed');
4451+
console.error(error);
4452+
}
4453+
const userInfoRaw = (_data$responseText$ma6 = data.responseText.match(/data-userinfo="(.*?)"/)) === null || _data$responseText$ma6 === void 0 ? void 0 : _data$responseText$ma6[1];
4454+
const temp1 = document.createElement('div');
4455+
temp1.innerHTML = userInfoRaw || '{}';
4456+
const userInfoStr = temp1.textContent || temp1.innerText;
4457+
let userInfo;
4458+
try {
4459+
userInfo = JSON.parse(userInfoStr);
4460+
} catch (error) {
4461+
logStatus.error('Error: get country info filed');
4462+
console.error(error);
4463+
}
4464+
const currentArea = userInfo.country_code;
4465+
const areas = Object.keys(cartConfig.rgUserCountryOptions).filter(area => area !== 'help');
44444466
if (currentArea && areas.length > 0) {
44454467
this.#area = currentArea;
44464468
logStatus.success();
@@ -4664,8 +4686,8 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载');
46644686
});
46654687
if (result === 'Success') {
46664688
if ((data === null || data === void 0 ? void 0 : data.status) === 200) {
4667-
var _data$responseText$ma6;
4668-
const groupId = (_data$responseText$ma6 = data.responseText.match(/OpenGroupChat\( '([0-9]+)'/)) === null || _data$responseText$ma6 === void 0 ? void 0 : _data$responseText$ma6[1];
4689+
var _data$responseText$ma7;
4690+
const groupId = (_data$responseText$ma7 = data.responseText.match(/OpenGroupChat\( '([0-9]+)'/)) === null || _data$responseText$ma7 === void 0 ? void 0 : _data$responseText$ma7[1];
46694691
if (groupId) {
46704692
this.#setCache('group', groupName, groupId);
46714693
logStatus.success();
@@ -4704,10 +4726,10 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载');
47044726
});
47054727
if (result === 'Success') {
47064728
if ((data === null || data === void 0 ? void 0 : data.status) === 200 && !data.responseText.includes('id="publicGroupJoin"')) {
4707-
var _data$responseText$ma7;
4729+
var _data$responseText$ma8;
47084730
logStatus.success();
47094731
this.tasks.officialGroups = unique([ ...this.tasks.officialGroups, gameId ]);
4710-
const groupId = (_data$responseText$ma7 = data.responseText.match(/steam:\/\/friends\/joinchat\/([0-9]+)/)) === null || _data$responseText$ma7 === void 0 ? void 0 : _data$responseText$ma7[1];
4732+
const groupId = (_data$responseText$ma8 = data.responseText.match(/steam:\/\/friends\/joinchat\/([0-9]+)/)) === null || _data$responseText$ma8 === void 0 ? void 0 : _data$responseText$ma8[1];
47114733
if (groupId) {
47124734
this.#setCache('officialGroup', gameId, groupId);
47134735
}
@@ -4818,8 +4840,8 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载');
48184840
});
48194841
if (result === 'Success') {
48204842
if ((data === null || data === void 0 ? void 0 : data.status) === 200) {
4821-
var _data$responseText$ma8;
4822-
const groupId = (_data$responseText$ma8 = data.responseText.match(/steam:\/\/friends\/joinchat\/([0-9]+)/)) === null || _data$responseText$ma8 === void 0 ? void 0 : _data$responseText$ma8[1];
4843+
var _data$responseText$ma9;
4844+
const groupId = (_data$responseText$ma9 = data.responseText.match(/steam:\/\/friends\/joinchat\/([0-9]+)/)) === null || _data$responseText$ma9 === void 0 ? void 0 : _data$responseText$ma9[1];
48234845
if (groupId) {
48244846
this.#setCache('officialGroup', gameId, groupId);
48254847
logStatus.success();
@@ -5137,8 +5159,8 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载');
51375159
});
51385160
if (result === 'Success') {
51395161
if ((data === null || data === void 0 ? void 0 : data.status) === 200) {
5140-
var _data$responseText, _data$responseText$ma9;
5141-
const forumId = (_data$responseText = data.responseText) === null || _data$responseText === void 0 ? void 0 : (_data$responseText$ma9 = _data$responseText.match(/General_([\d]+(_[\d]+)?)/)) === null || _data$responseText$ma9 === void 0 ? void 0 : _data$responseText$ma9[1];
5162+
var _data$responseText, _data$responseText$ma10;
5163+
const forumId = (_data$responseText = data.responseText) === null || _data$responseText === void 0 ? void 0 : (_data$responseText$ma10 = _data$responseText.match(/General_([\d]+(_[\d]+)?)/)) === null || _data$responseText$ma10 === void 0 ? void 0 : _data$responseText$ma10[1];
51425164
if (forumId) {
51435165
this.#setCache('forum', gameId, forumId);
51445166
logStatus.success();
@@ -5233,8 +5255,8 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载');
52335255
});
52345256
if (result === 'Success') {
52355257
if ((data === null || data === void 0 ? void 0 : data.status) === 200) {
5236-
var _data$responseText$ma10;
5237-
const appId = (_data$responseText$ma10 = data.responseText.match(/<input type="hidden" name="appid" value="([\d]+?)" \/>/)) === null || _data$responseText$ma10 === void 0 ? void 0 : _data$responseText$ma10[1];
5258+
var _data$responseText$ma11;
5259+
const appId = (_data$responseText$ma11 = data.responseText.match(/<input type="hidden" name="appid" value="([\d]+?)" \/>/)) === null || _data$responseText$ma11 === void 0 ? void 0 : _data$responseText$ma11[1];
52385260
if (appId) {
52395261
this.#setCache('workshop', id, appId);
52405262
logStatus.success();
@@ -5366,8 +5388,8 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载');
53665388
});
53675389
if (result === 'Success') {
53685390
if ((data === null || data === void 0 ? void 0 : data.status) === 200) {
5369-
var _data$responseText$ma11;
5370-
const curatorId = (_data$responseText$ma11 = data.responseText.match(/g_pagingData.*?"clanid":([\d]+)/)) === null || _data$responseText$ma11 === void 0 ? void 0 : _data$responseText$ma11[1];
5391+
var _data$responseText$ma12;
5392+
const curatorId = (_data$responseText$ma12 = data.responseText.match(/g_pagingData.*?"clanid":([\d]+)/)) === null || _data$responseText$ma12 === void 0 ? void 0 : _data$responseText$ma12[1];
53715393
if (curatorId) {
53725394
this.#setCache('curator', `${path}/${name}`, curatorId);
53735395
logStatus.success();
@@ -5531,7 +5553,7 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载');
55315553
});
55325554
if (result === 'Success') {
55335555
if ((data === null || data === void 0 ? void 0 : data.status) === 200) {
5534-
var _data$responseText$ma12;
5556+
var _data$responseText$ma13;
55355557
if (this.#area === 'CN' && data.responseText.includes('id="error_box"')) {
55365558
logStatus.warning(i18n('changeAreaNotice'));
55375559
const result = await this.#changeArea();
@@ -5540,7 +5562,7 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载');
55405562
}
55415563
return await this.#appid2subid(id);
55425564
}
5543-
const subid = (_data$responseText$ma12 = data.responseText.match(/name="subid" value="([\d]+?)"/)) === null || _data$responseText$ma12 === void 0 ? void 0 : _data$responseText$ma12[1];
5565+
const subid = (_data$responseText$ma13 = data.responseText.match(/name="subid" value="([\d]+?)"/)) === null || _data$responseText$ma13 === void 0 ? void 0 : _data$responseText$ma13[1];
55445566
if (subid) {
55455567
logStatus.success();
55465568
return subid;

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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/auto-task-v4.user.js

Lines changed: 40 additions & 18 deletions
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.2.35
4+
// @version 4.2.36
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
@@ -4419,9 +4419,31 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载');
44194419
});
44204420
if (result === 'Success') {
44214421
if ((data === null || data === void 0 ? void 0 : data.status) === 200) {
4422-
var _data$responseText$ma5;
4423-
const currentArea = (_data$responseText$ma5 = data.responseText.match(/<input id="usercountrycurrency".*?value="(.+?)"/)) === null || _data$responseText$ma5 === void 0 ? void 0 : _data$responseText$ma5[1];
4424-
const areas = [ ...data.responseText.matchAll(/<div class="currency_change_option .*?" data-country="(.+?)" >/g) ].map(search => search[1]);
4422+
var _data$responseText$ma5, _data$responseText$ma6;
4423+
const cartConfigRaw = (_data$responseText$ma5 = data.responseText.match(/data-cart_config="(.*?)"/)) === null || _data$responseText$ma5 === void 0 ? void 0 : _data$responseText$ma5[1];
4424+
const temp = document.createElement('div');
4425+
temp.innerHTML = cartConfigRaw || '{}';
4426+
const cartConfigStr = temp.textContent || temp.innerText;
4427+
let cartConfig;
4428+
try {
4429+
cartConfig = JSON.parse(cartConfigStr);
4430+
} catch (error) {
4431+
logStatus.error('Error: get country info filed');
4432+
console.error(error);
4433+
}
4434+
const userInfoRaw = (_data$responseText$ma6 = data.responseText.match(/data-userinfo="(.*?)"/)) === null || _data$responseText$ma6 === void 0 ? void 0 : _data$responseText$ma6[1];
4435+
const temp1 = document.createElement('div');
4436+
temp1.innerHTML = userInfoRaw || '{}';
4437+
const userInfoStr = temp1.textContent || temp1.innerText;
4438+
let userInfo;
4439+
try {
4440+
userInfo = JSON.parse(userInfoStr);
4441+
} catch (error) {
4442+
logStatus.error('Error: get country info filed');
4443+
console.error(error);
4444+
}
4445+
const currentArea = userInfo.country_code;
4446+
const areas = Object.keys(cartConfig.rgUserCountryOptions).filter(area => area !== 'help');
44254447
if (currentArea && areas.length > 0) {
44264448
this.#area = currentArea;
44274449
logStatus.success();
@@ -4645,8 +4667,8 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载');
46454667
});
46464668
if (result === 'Success') {
46474669
if ((data === null || data === void 0 ? void 0 : data.status) === 200) {
4648-
var _data$responseText$ma6;
4649-
const groupId = (_data$responseText$ma6 = data.responseText.match(/OpenGroupChat\( '([0-9]+)'/)) === null || _data$responseText$ma6 === void 0 ? void 0 : _data$responseText$ma6[1];
4670+
var _data$responseText$ma7;
4671+
const groupId = (_data$responseText$ma7 = data.responseText.match(/OpenGroupChat\( '([0-9]+)'/)) === null || _data$responseText$ma7 === void 0 ? void 0 : _data$responseText$ma7[1];
46504672
if (groupId) {
46514673
this.#setCache('group', groupName, groupId);
46524674
logStatus.success();
@@ -4685,10 +4707,10 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载');
46854707
});
46864708
if (result === 'Success') {
46874709
if ((data === null || data === void 0 ? void 0 : data.status) === 200 && !data.responseText.includes('id="publicGroupJoin"')) {
4688-
var _data$responseText$ma7;
4710+
var _data$responseText$ma8;
46894711
logStatus.success();
46904712
this.tasks.officialGroups = unique([ ...this.tasks.officialGroups, gameId ]);
4691-
const groupId = (_data$responseText$ma7 = data.responseText.match(/steam:\/\/friends\/joinchat\/([0-9]+)/)) === null || _data$responseText$ma7 === void 0 ? void 0 : _data$responseText$ma7[1];
4713+
const groupId = (_data$responseText$ma8 = data.responseText.match(/steam:\/\/friends\/joinchat\/([0-9]+)/)) === null || _data$responseText$ma8 === void 0 ? void 0 : _data$responseText$ma8[1];
46924714
if (groupId) {
46934715
this.#setCache('officialGroup', gameId, groupId);
46944716
}
@@ -4799,8 +4821,8 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载');
47994821
});
48004822
if (result === 'Success') {
48014823
if ((data === null || data === void 0 ? void 0 : data.status) === 200) {
4802-
var _data$responseText$ma8;
4803-
const groupId = (_data$responseText$ma8 = data.responseText.match(/steam:\/\/friends\/joinchat\/([0-9]+)/)) === null || _data$responseText$ma8 === void 0 ? void 0 : _data$responseText$ma8[1];
4824+
var _data$responseText$ma9;
4825+
const groupId = (_data$responseText$ma9 = data.responseText.match(/steam:\/\/friends\/joinchat\/([0-9]+)/)) === null || _data$responseText$ma9 === void 0 ? void 0 : _data$responseText$ma9[1];
48044826
if (groupId) {
48054827
this.#setCache('officialGroup', gameId, groupId);
48064828
logStatus.success();
@@ -5118,8 +5140,8 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载');
51185140
});
51195141
if (result === 'Success') {
51205142
if ((data === null || data === void 0 ? void 0 : data.status) === 200) {
5121-
var _data$responseText, _data$responseText$ma9;
5122-
const forumId = (_data$responseText = data.responseText) === null || _data$responseText === void 0 ? void 0 : (_data$responseText$ma9 = _data$responseText.match(/General_([\d]+(_[\d]+)?)/)) === null || _data$responseText$ma9 === void 0 ? void 0 : _data$responseText$ma9[1];
5143+
var _data$responseText, _data$responseText$ma10;
5144+
const forumId = (_data$responseText = data.responseText) === null || _data$responseText === void 0 ? void 0 : (_data$responseText$ma10 = _data$responseText.match(/General_([\d]+(_[\d]+)?)/)) === null || _data$responseText$ma10 === void 0 ? void 0 : _data$responseText$ma10[1];
51235145
if (forumId) {
51245146
this.#setCache('forum', gameId, forumId);
51255147
logStatus.success();
@@ -5214,8 +5236,8 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载');
52145236
});
52155237
if (result === 'Success') {
52165238
if ((data === null || data === void 0 ? void 0 : data.status) === 200) {
5217-
var _data$responseText$ma10;
5218-
const appId = (_data$responseText$ma10 = data.responseText.match(/<input type="hidden" name="appid" value="([\d]+?)" \/>/)) === null || _data$responseText$ma10 === void 0 ? void 0 : _data$responseText$ma10[1];
5239+
var _data$responseText$ma11;
5240+
const appId = (_data$responseText$ma11 = data.responseText.match(/<input type="hidden" name="appid" value="([\d]+?)" \/>/)) === null || _data$responseText$ma11 === void 0 ? void 0 : _data$responseText$ma11[1];
52195241
if (appId) {
52205242
this.#setCache('workshop', id, appId);
52215243
logStatus.success();
@@ -5347,8 +5369,8 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载');
53475369
});
53485370
if (result === 'Success') {
53495371
if ((data === null || data === void 0 ? void 0 : data.status) === 200) {
5350-
var _data$responseText$ma11;
5351-
const curatorId = (_data$responseText$ma11 = data.responseText.match(/g_pagingData.*?"clanid":([\d]+)/)) === null || _data$responseText$ma11 === void 0 ? void 0 : _data$responseText$ma11[1];
5372+
var _data$responseText$ma12;
5373+
const curatorId = (_data$responseText$ma12 = data.responseText.match(/g_pagingData.*?"clanid":([\d]+)/)) === null || _data$responseText$ma12 === void 0 ? void 0 : _data$responseText$ma12[1];
53525374
if (curatorId) {
53535375
this.#setCache('curator', `${path}/${name}`, curatorId);
53545376
logStatus.success();
@@ -5512,7 +5534,7 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载');
55125534
});
55135535
if (result === 'Success') {
55145536
if ((data === null || data === void 0 ? void 0 : data.status) === 200) {
5515-
var _data$responseText$ma12;
5537+
var _data$responseText$ma13;
55165538
if (this.#area === 'CN' && data.responseText.includes('id="error_box"')) {
55175539
logStatus.warning(i18n('changeAreaNotice'));
55185540
const result = await this.#changeArea();
@@ -5521,7 +5543,7 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载');
55215543
}
55225544
return await this.#appid2subid(id);
55235545
}
5524-
const subid = (_data$responseText$ma12 = data.responseText.match(/name="subid" value="([\d]+?)"/)) === null || _data$responseText$ma12 === void 0 ? void 0 : _data$responseText$ma12[1];
5546+
const subid = (_data$responseText$ma13 = data.responseText.match(/name="subid" value="([\d]+?)"/)) === null || _data$responseText$ma13 === void 0 ? void 0 : _data$responseText$ma13[1];
55255547
if (subid) {
55265548
logStatus.success();
55275549
return subid;

doc/docs/logs/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ lang: zh-CN
55

66
## V4.2
77

8+
### V4.2.36
9+
10+
[Release](https://github.com/HCLonely/auto-task-v4/releases/tag/v4.2.36)
11+
12+
- 修复:Steam换区失败
13+
814
### V4.2.35
915

1016
[Release](https://github.com/HCLonely/auto-task-v4/releases/tag/v4.2.35)

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "auto-task-v4",
3-
"version": "4.2.35",
3+
"version": "4.2.36",
44
"change": [
55
"修复:Steam换区失败"
66
],

0 commit comments

Comments
 (0)