Skip to content

Commit

Permalink
修复:Keylol appid获取失败(#33);
Browse files Browse the repository at this point in the history
修复:License入库失败(#33)
  • Loading branch information
HCLonely committed Nov 6, 2024
1 parent 3b0c204 commit 92cb7e1
Show file tree
Hide file tree
Showing 20 changed files with 142 additions and 64 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/Release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ jobs:
uses: softprops/action-gh-release@v1
with:
prerelease: false
tag_name: v4.4.13
name: 4.4.13
tag_name: v4.4.14
name: 4.4.14
body: |-
- 修复:部分文本错误(#31)
- 修复:Gleam无法完成弹窗计时任务(#32)
- 修复:Keylol appid获取失败(#33)
- 修复:License入库失败(#33)
files: |-
dist/auto-task-v4-for-giveawaysu.user.js
dist/auto-task-v4.compatibility.user.js
Expand Down
4 changes: 2 additions & 2 deletions dist/auto-task-v4-for-giveawaysu.all.user.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/auto-task-v4-for-giveawaysu.user.js

Large diffs are not rendered by default.

28 changes: 21 additions & 7 deletions dist/auto-task-v4.all.user.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// ==UserScript==
// @name auto-task-v4
// @namespace auto-task-v4
// @version 4.4.13
// @version 4.4.14
// @description 自动完成 Freeanywhere,Giveawaysu,GiveeClub,Givekey,Gleam,Indiedb,keyhub,OpiumPulses,Opquests,SweepWidget 等网站的任务。
// @description:en Automatically complete the tasks of FreeAnyWhere, GiveawaySu, GiveeClub, Givekey, Gleam, Indiedb, keyhub, OpiumPulses, Opquests, SweepWidget websites.
// @author HCLonely
Expand Down Expand Up @@ -1379,6 +1379,7 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载');
tryChangeAreaNotice: '此功能无法检测游戏是否限区,因此会尝试换区后再入库,换区失败也不影响后续入库',
gettingUserLink: '正在获取Steam用户社区链接...',
retry: '重试',
owned: '已拥有',
initingASF: '正在初始化ASF...',
servers: '服务器',
joiningDiscordServer: '正在加入Discord服务器',
Expand Down Expand Up @@ -1659,6 +1660,7 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载');
versionNotMatched: 'The script manager version is too low, requiring TamperMonkey >= 5.2.0 or TamperMonkey Beta >= 5.2.6196',
gettingUserLink: 'Getting steam user community link...',
retry: 'Retry',
owned: 'Owned',
initingASF: 'Initing ASF...',
servers: 'Server',
joiningDiscordServer: 'Joining Discord Server',
Expand Down Expand Up @@ -6120,6 +6122,10 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载');
});
if (result === 'Success') {
if (data?.status === 200) {
if (data.responseText.includes('ds_owned_flag ds_flag') || data.responseText.includes('class="already_in_library"')) {
logStatus.success(i18n('owned'));
return false;
}
if (this.#area === 'CN' && data.responseText.includes('id="error_box"')) {
logStatus.warning(i18n('changeAreaNotice'));
const result = await this.#changeArea();
Expand All @@ -6128,7 +6134,12 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载');
}
return await this.#appid2subid(id);
}
const subid = data.responseText.match(/name="subid" value="([\d]+?)"/)?.[1];
let subid = data.responseText.match(/name="subid" value="([\d]+?)"/)?.[1];
if (subid) {
logStatus.success();
return subid;
}
subid = data.responseText.match(/AddFreeLicense\(\s*(\d+)/)?.[1];
if (subid) {
logStatus.success();
return subid;
Expand Down Expand Up @@ -6265,7 +6276,7 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载');
status,
data
} = await tools_httpRequest({
url: 'https://store.steampowered.com/checkout/addfreelicense',
url: `https://store.steampowered.com/freelicense/addfreelicense/${id}`,
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
Expand All @@ -6274,9 +6285,8 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载');
Referer: 'https://store.steampowered.com/account/licenses/'
},
data: $.param({
action: 'add_to_cart',
sessionid: this.#auth.storeSessionID,
subid: id
ajax: true,
sessionid: this.#auth.storeSessionID
}),
dataType: 'json'
});
Expand Down Expand Up @@ -8951,7 +8961,11 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载');
const asfLinks2 = mainPost.find('.blockcode:contains("addlicense"):visible');
if (asfLinks2.length > 0) {
for (const asfLink of asfLinks2) {
const subid = asfLink.innerText.match(/[\d]+/g);
const appid = [ ...asfLink.innerText.matchAll(/a(pp)?\/([\d]+)/g) ].map(matched => matched?.[2]).filter(id => id) || [];
if (appid.length > 0) {
this.#addBtn($(asfLink).children('em')[0], 'steam', 'licenseLinks', `appid-${appid.join(',')}`);
}
const subid = asfLink.innerText.match(/[\d]+/g)?.filter(matched => !appid.includes(matched));
if (!subid || subid.length === 0) {
continue;
}
Expand Down
6 changes: 3 additions & 3 deletions dist/auto-task-v4.compatibility.all.user.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions dist/auto-task-v4.compatibility.user.js

Large diffs are not rendered by default.

28 changes: 21 additions & 7 deletions dist/auto-task-v4.user.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// ==UserScript==
// @name auto-task-v4
// @namespace auto-task-v4
// @version 4.4.13
// @version 4.4.14
// @description 自动完成 Freeanywhere,Giveawaysu,GiveeClub,Givekey,Gleam,Indiedb,keyhub,OpiumPulses,Opquests,SweepWidget 等网站的任务。
// @description:en Automatically complete the tasks of FreeAnyWhere, GiveawaySu, GiveeClub, Givekey, Gleam, Indiedb, keyhub, OpiumPulses, Opquests, SweepWidget websites.
// @author HCLonely
Expand Down Expand Up @@ -1360,6 +1360,7 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载');
tryChangeAreaNotice: '此功能无法检测游戏是否限区,因此会尝试换区后再入库,换区失败也不影响后续入库',
gettingUserLink: '正在获取Steam用户社区链接...',
retry: '重试',
owned: '已拥有',
initingASF: '正在初始化ASF...',
servers: '服务器',
joiningDiscordServer: '正在加入Discord服务器',
Expand Down Expand Up @@ -1640,6 +1641,7 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载');
versionNotMatched: 'The script manager version is too low, requiring TamperMonkey >= 5.2.0 or TamperMonkey Beta >= 5.2.6196',
gettingUserLink: 'Getting steam user community link...',
retry: 'Retry',
owned: 'Owned',
initingASF: 'Initing ASF...',
servers: 'Server',
joiningDiscordServer: 'Joining Discord Server',
Expand Down Expand Up @@ -6101,6 +6103,10 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载');
});
if (result === 'Success') {
if (data?.status === 200) {
if (data.responseText.includes('ds_owned_flag ds_flag') || data.responseText.includes('class="already_in_library"')) {
logStatus.success(i18n('owned'));
return false;
}
if (this.#area === 'CN' && data.responseText.includes('id="error_box"')) {
logStatus.warning(i18n('changeAreaNotice'));
const result = await this.#changeArea();
Expand All @@ -6109,7 +6115,12 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载');
}
return await this.#appid2subid(id);
}
const subid = data.responseText.match(/name="subid" value="([\d]+?)"/)?.[1];
let subid = data.responseText.match(/name="subid" value="([\d]+?)"/)?.[1];
if (subid) {
logStatus.success();
return subid;
}
subid = data.responseText.match(/AddFreeLicense\(\s*(\d+)/)?.[1];
if (subid) {
logStatus.success();
return subid;
Expand Down Expand Up @@ -6246,7 +6257,7 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载');
status,
data
} = await tools_httpRequest({
url: 'https://store.steampowered.com/checkout/addfreelicense',
url: `https://store.steampowered.com/freelicense/addfreelicense/${id}`,
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
Expand All @@ -6255,9 +6266,8 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载');
Referer: 'https://store.steampowered.com/account/licenses/'
},
data: $.param({
action: 'add_to_cart',
sessionid: this.#auth.storeSessionID,
subid: id
ajax: true,
sessionid: this.#auth.storeSessionID
}),
dataType: 'json'
});
Expand Down Expand Up @@ -8932,7 +8942,11 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载');
const asfLinks2 = mainPost.find('.blockcode:contains("addlicense"):visible');
if (asfLinks2.length > 0) {
for (const asfLink of asfLinks2) {
const subid = asfLink.innerText.match(/[\d]+/g);
const appid = [ ...asfLink.innerText.matchAll(/a(pp)?\/([\d]+)/g) ].map(matched => matched?.[2]).filter(id => id) || [];
if (appid.length > 0) {
this.#addBtn($(asfLink).children('em')[0], 'steam', 'licenseLinks', `appid-${appid.join(',')}`);
}
const subid = asfLink.innerText.match(/[\d]+/g)?.filter(matched => !appid.includes(matched));
if (!subid || subid.length === 0) {
continue;
}
Expand Down
7 changes: 7 additions & 0 deletions doc/docs/logs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ lang: zh-CN

## V4.4

### V4.4.14

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

- 修复:Keylol appid获取失败([#33](https://github.com/HCLonely/auto-task-v4/issues/33))
- 修复:License入库失败([#33](https://github.com/HCLonely/auto-task-v4/issues/33))

### V4.4.13

[Release](https://github.com/HCLonely/auto-task-v4/releases/tag/v4.4.13)
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "auto-task-v4",
"version": "4.4.13",
"version": "4.4.14",
"change": [
"修复:部分文本错误(#31)",
"修复:Gleam无法完成弹窗计时任务(#32)"
"修复:Keylol appid获取失败(#33)",
"修复:License入库失败(#33)"
],
"description": "赠Key站自动任务脚本",
"main": "package.json",
Expand Down
4 changes: 2 additions & 2 deletions page/dist/auto-task-v4-for-giveawaysu.all.user.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions page/dist/auto-task-v4-for-giveawaysu.user.js

Large diffs are not rendered by default.

28 changes: 21 additions & 7 deletions page/dist/auto-task-v4.all.user.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// ==UserScript==
// @name auto-task-v4
// @namespace auto-task-v4
// @version 4.4.13
// @version 4.4.14
// @description 自动完成 Freeanywhere,Giveawaysu,GiveeClub,Givekey,Gleam,Indiedb,keyhub,OpiumPulses,Opquests,SweepWidget 等网站的任务。
// @description:en Automatically complete the tasks of FreeAnyWhere, GiveawaySu, GiveeClub, Givekey, Gleam, Indiedb, keyhub, OpiumPulses, Opquests, SweepWidget websites.
// @author HCLonely
Expand Down Expand Up @@ -1379,6 +1379,7 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载');
tryChangeAreaNotice: '此功能无法检测游戏是否限区,因此会尝试换区后再入库,换区失败也不影响后续入库',
gettingUserLink: '正在获取Steam用户社区链接...',
retry: '重试',
owned: '已拥有',
initingASF: '正在初始化ASF...',
servers: '服务器',
joiningDiscordServer: '正在加入Discord服务器',
Expand Down Expand Up @@ -1659,6 +1660,7 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载');
versionNotMatched: 'The script manager version is too low, requiring TamperMonkey >= 5.2.0 or TamperMonkey Beta >= 5.2.6196',
gettingUserLink: 'Getting steam user community link...',
retry: 'Retry',
owned: 'Owned',
initingASF: 'Initing ASF...',
servers: 'Server',
joiningDiscordServer: 'Joining Discord Server',
Expand Down Expand Up @@ -6120,6 +6122,10 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载');
});
if (result === 'Success') {
if (data?.status === 200) {
if (data.responseText.includes('ds_owned_flag ds_flag') || data.responseText.includes('class="already_in_library"')) {
logStatus.success(i18n('owned'));
return false;
}
if (this.#area === 'CN' && data.responseText.includes('id="error_box"')) {
logStatus.warning(i18n('changeAreaNotice'));
const result = await this.#changeArea();
Expand All @@ -6128,7 +6134,12 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载');
}
return await this.#appid2subid(id);
}
const subid = data.responseText.match(/name="subid" value="([\d]+?)"/)?.[1];
let subid = data.responseText.match(/name="subid" value="([\d]+?)"/)?.[1];
if (subid) {
logStatus.success();
return subid;
}
subid = data.responseText.match(/AddFreeLicense\(\s*(\d+)/)?.[1];
if (subid) {
logStatus.success();
return subid;
Expand Down Expand Up @@ -6265,7 +6276,7 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载');
status,
data
} = await tools_httpRequest({
url: 'https://store.steampowered.com/checkout/addfreelicense',
url: `https://store.steampowered.com/freelicense/addfreelicense/${id}`,
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
Expand All @@ -6274,9 +6285,8 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载');
Referer: 'https://store.steampowered.com/account/licenses/'
},
data: $.param({
action: 'add_to_cart',
sessionid: this.#auth.storeSessionID,
subid: id
ajax: true,
sessionid: this.#auth.storeSessionID
}),
dataType: 'json'
});
Expand Down Expand Up @@ -8951,7 +8961,11 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载');
const asfLinks2 = mainPost.find('.blockcode:contains("addlicense"):visible');
if (asfLinks2.length > 0) {
for (const asfLink of asfLinks2) {
const subid = asfLink.innerText.match(/[\d]+/g);
const appid = [ ...asfLink.innerText.matchAll(/a(pp)?\/([\d]+)/g) ].map(matched => matched?.[2]).filter(id => id) || [];
if (appid.length > 0) {
this.#addBtn($(asfLink).children('em')[0], 'steam', 'licenseLinks', `appid-${appid.join(',')}`);
}
const subid = asfLink.innerText.match(/[\d]+/g)?.filter(matched => !appid.includes(matched));
if (!subid || subid.length === 0) {
continue;
}
Expand Down
Loading

0 comments on commit 92cb7e1

Please sign in to comment.