@irfanshadikrishad/anilist 1.2.12 ā 1.2.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -6
- package/bin/helpers/auth.js +16 -7
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -35,12 +35,12 @@ Create an API client from [anilist developer setting](https://anilist.co/setting
|
|
|
35
35
|
|
|
36
36
|
To login:
|
|
37
37
|
|
|
38
|
-
```
|
|
38
|
+
```bash
|
|
39
39
|
anilist login -i <client-id> -s <client-secret>
|
|
40
40
|
```
|
|
41
41
|
|
|
42
42
|
> [!NOTE]
|
|
43
|
-
> here `<client-id>` and `<client-secret>` should be replaced by the ones that you recieved from the developer setting.
|
|
43
|
+
> here `<client-id>` and `<client-secret>` should be replaced by the ones that you recieved from the developer setting. Also don't include `<>`, this only indicates need-to-be-replaced data.
|
|
44
44
|
|
|
45
45
|
#### CLI Commands Overview
|
|
46
46
|
|
|
@@ -85,10 +85,10 @@ anilist logout
|
|
|
85
85
|
|
|
86
86
|
- Description: End the current session and log out from your AniList account.
|
|
87
87
|
|
|
88
|
-
#### `
|
|
88
|
+
#### `whoami`:
|
|
89
89
|
|
|
90
90
|
```bash
|
|
91
|
-
anilist
|
|
91
|
+
anilist whoami
|
|
92
92
|
```
|
|
93
93
|
|
|
94
94
|
- Description: Retrieve and display information about the currently logged-in user, including stats and profile details.
|
|
@@ -163,13 +163,13 @@ anilist ls -a
|
|
|
163
163
|
#### `delete` _(alias: `del`)_:
|
|
164
164
|
|
|
165
165
|
```bash
|
|
166
|
-
anilist del -
|
|
166
|
+
anilist del -s,
|
|
167
167
|
```
|
|
168
168
|
|
|
169
169
|
- Options:
|
|
170
170
|
- `-a, --anime`: Delete your specific anime collection that you want.
|
|
171
171
|
- `-m, --manga`: Delete your specific manga collection that you want.
|
|
172
|
-
- `-
|
|
172
|
+
- `-s,, --activity`: Delete all or any type of activities you want.
|
|
173
173
|
- Description: Delete the entire anime or manga collection from the logged-in user's profile.
|
|
174
174
|
|
|
175
175
|
#### `anime`
|
package/bin/helpers/auth.js
CHANGED
|
@@ -575,11 +575,12 @@ class Social {
|
|
|
575
575
|
*/
|
|
576
576
|
static follow() {
|
|
577
577
|
return __awaiter(this, void 0, void 0, function* () {
|
|
578
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
578
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
579
579
|
try {
|
|
580
580
|
let pager = 1;
|
|
581
581
|
let hasNextPage = true;
|
|
582
582
|
let allFollowerUsers = [];
|
|
583
|
+
let followedBack = 0;
|
|
583
584
|
spinner.start("Fetching all the followers...");
|
|
584
585
|
while (hasNextPage) {
|
|
585
586
|
const followerUsers = yield fetcher(userFollowersQuery, {
|
|
@@ -612,12 +613,16 @@ class Social {
|
|
|
612
613
|
console.log(`${String(`[${nf.id}]`).padEnd(maxIdLength)}` +
|
|
613
614
|
`\t${String(`[${(_k = (_j = follow === null || follow === void 0 ? void 0 : follow.data) === null || _j === void 0 ? void 0 : _j.ToggleFollow) === null || _k === void 0 ? void 0 : _k.name}]`).padEnd(maxNameLength)}` +
|
|
614
615
|
`\t${((_m = (_l = follow === null || follow === void 0 ? void 0 : follow.data) === null || _l === void 0 ? void 0 : _l.ToggleFollow) === null || _m === void 0 ? void 0 : _m.id) ? "ā
" : "šµ"}`);
|
|
616
|
+
// Count the followed back users
|
|
617
|
+
if ((_p = (_o = follow === null || follow === void 0 ? void 0 : follow.data) === null || _o === void 0 ? void 0 : _o.ToggleFollow) === null || _p === void 0 ? void 0 : _p.id) {
|
|
618
|
+
followedBack++;
|
|
619
|
+
}
|
|
615
620
|
}
|
|
616
621
|
catch (error) {
|
|
617
622
|
console.log(`automate_follow_toggle_follow: ${error.message}`);
|
|
618
623
|
}
|
|
619
624
|
}
|
|
620
|
-
console.log(`\nā
Followed back ${
|
|
625
|
+
console.log(`\nā
Followed back ${followedBack} users.`);
|
|
621
626
|
}
|
|
622
627
|
catch (error) {
|
|
623
628
|
console.log(`\nautomate_follow ${error.message}`);
|
|
@@ -629,18 +634,19 @@ class Social {
|
|
|
629
634
|
*/
|
|
630
635
|
static unfollow() {
|
|
631
636
|
return __awaiter(this, void 0, void 0, function* () {
|
|
632
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
637
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
633
638
|
try {
|
|
634
639
|
let pager = 1;
|
|
635
640
|
let hasNextPage = true;
|
|
636
641
|
let allFollowingUsers = [];
|
|
642
|
+
let unfollowedUsers = 0;
|
|
637
643
|
spinner.start("Fetching all following users...");
|
|
638
644
|
while (hasNextPage) {
|
|
639
645
|
const followingUsers = yield fetcher(userFollowingQuery, {
|
|
640
646
|
userId: yield Auth.MyUserId(),
|
|
641
647
|
page: pager,
|
|
642
648
|
});
|
|
643
|
-
spinner.update(`Fetched page ${pager} of ${(_c = (_b = (_a = followingUsers === null || followingUsers === void 0 ? void 0 : followingUsers.data) === null || _a === void 0 ? void 0 : _a.Page) === null || _b === void 0 ? void 0 : _b.pageInfo) === null || _c === void 0 ? void 0 : _c.lastPage}
|
|
649
|
+
spinner.update(`Fetched page ${pager} of ${(_c = (_b = (_a = followingUsers === null || followingUsers === void 0 ? void 0 : followingUsers.data) === null || _a === void 0 ? void 0 : _a.Page) === null || _b === void 0 ? void 0 : _b.pageInfo) === null || _c === void 0 ? void 0 : _c.lastPage}...`);
|
|
644
650
|
if (!((_f = (_e = (_d = followingUsers === null || followingUsers === void 0 ? void 0 : followingUsers.data) === null || _d === void 0 ? void 0 : _d.Page) === null || _e === void 0 ? void 0 : _e.pageInfo) === null || _f === void 0 ? void 0 : _f.hasNextPage)) {
|
|
645
651
|
hasNextPage = false;
|
|
646
652
|
}
|
|
@@ -653,8 +659,7 @@ class Social {
|
|
|
653
659
|
.filter((user) => !user.isFollower)
|
|
654
660
|
.map((u3r) => ({ id: u3r.id, name: u3r.name }));
|
|
655
661
|
if (notFollowingMe.length <= 0) {
|
|
656
|
-
|
|
657
|
-
spinner.stop(`No users to unfollow. Aborting process...`);
|
|
662
|
+
spinner.stop(`No users to unfollow. Exiting operation...`);
|
|
658
663
|
return;
|
|
659
664
|
}
|
|
660
665
|
spinner.stop(`Unfollow process activated with ${notFollowingMe.length} users.`);
|
|
@@ -667,12 +672,16 @@ class Social {
|
|
|
667
672
|
userId: nfm.id,
|
|
668
673
|
});
|
|
669
674
|
console.log(`[${nfm.id}]\t[${(_k = (_j = unfollow === null || unfollow === void 0 ? void 0 : unfollow.data) === null || _j === void 0 ? void 0 : _j.ToggleFollow) === null || _k === void 0 ? void 0 : _k.name}]\t${((_m = (_l = unfollow === null || unfollow === void 0 ? void 0 : unfollow.data) === null || _l === void 0 ? void 0 : _l.ToggleFollow) === null || _m === void 0 ? void 0 : _m.id) ? "ā
" : "šµ"}`);
|
|
675
|
+
// Count the unfollowed users
|
|
676
|
+
if ((_p = (_o = unfollow === null || unfollow === void 0 ? void 0 : unfollow.data) === null || _o === void 0 ? void 0 : _o.ToggleFollow) === null || _p === void 0 ? void 0 : _p.id) {
|
|
677
|
+
unfollowedUsers++;
|
|
678
|
+
}
|
|
670
679
|
}
|
|
671
680
|
catch (error) {
|
|
672
681
|
console.log(`unfollow_toggle_follow. ${error.message}`);
|
|
673
682
|
}
|
|
674
683
|
}
|
|
675
|
-
console.log(`\nTotal Unfollowed: ${nfmCount}
|
|
684
|
+
console.log(`\nTotal Unfollowed: ${unfollowedUsers} of ${nfmCount} users.`);
|
|
676
685
|
}
|
|
677
686
|
catch (error) {
|
|
678
687
|
console.error(`\nautomate_unfollow: ${error.message}`);
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@irfanshadikrishad/anilist",
|
|
3
3
|
"description": "Minimalist unofficial AniList CLI for Anime and Manga Enthusiasts",
|
|
4
4
|
"author": "Irfan Shadik Rishad",
|
|
5
|
-
"version": "1.2.
|
|
5
|
+
"version": "1.2.14",
|
|
6
6
|
"main": "./bin/index.js",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"types": "./bin/index.d.ts",
|