@irfanshadikrishad/anilist 1.0.0-forbidden.3 ā 1.0.0-forbidden.4
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/LICENSE.md +382 -382
- package/README.md +266 -255
- package/bin/helpers/auth.js +16 -7
- package/bin/helpers/lists.d.ts +1 -0
- package/bin/helpers/lists.js +29 -2
- package/bin/helpers/queries.d.ts +2 -1
- package/bin/helpers/queries.js +9 -1
- package/bin/helpers/types.d.ts +31 -4
- package/bin/helpers/workers.d.ts +3 -2
- package/bin/helpers/workers.js +7 -1
- package/bin/index.js +7 -0
- package/package.json +84 -84
package/README.md
CHANGED
|
@@ -1,255 +1,266 @@
|
|
|
1
|
-
#### @irfanshadikrishad/anilist
|
|
2
|
-
|
|
3
|
-
Minimalist unofficial AniList CLI for Anime and Manga Enthusiasts.
|
|
4
|
-
|
|
5
|
-

|
|
6
|
-

|
|
7
|
-

|
|
8
|
-
|
|
9
|
-
#### How to install?
|
|
10
|
-
|
|
11
|
-
Make sure [Node.js](https://nodejs.org/en) and [npm](https://www.npmjs.com) are already installed in your system.
|
|
12
|
-
Verify installation using
|
|
13
|
-
|
|
14
|
-
```bash
|
|
15
|
-
node -v
|
|
16
|
-
npm -v
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
If you see the version then its installed. Otherwise install nodejs and npm should already be installed with nodejs.
|
|
20
|
-
Then install the package by running
|
|
21
|
-
|
|
22
|
-
```bash
|
|
23
|
-
npm install -g @irfanshadikrishad/anilist
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
This will install the package globally. And you have to use commands like
|
|
27
|
-
|
|
28
|
-
```bash
|
|
29
|
-
anilist tr -c 15
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
#### How to use?
|
|
33
|
-
|
|
34
|
-
Create an API client from [anilist developer setting](https://anilist.co/settings/developer) with an application name and redirect url as `https://anilist.co/api/v2/oauth/pin`. After creating the client you will get `Client ID` and `Client Secret` which is required in order to login from CLI.
|
|
35
|
-
|
|
36
|
-
To login:
|
|
37
|
-
|
|
38
|
-
```
|
|
39
|
-
anilist login -i <client-id> -s <client-secret>
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
> [!NOTE]
|
|
43
|
-
> here `<client-id>` and `<client-secret>` should be replaced by the ones that you recieved from the developer setting.
|
|
44
|
-
|
|
45
|
-
#### CLI Commands Overview
|
|
46
|
-
|
|
47
|
-
| **Command** | **Options** | **Description** |
|
|
48
|
-
| --------------------------------------- | ----------------------------------------------------------------------- | ------------------------------------------------------------------------------------------ |
|
|
49
|
-
| `login` | `-i, --id` `-s, --secret` | Log in with your AniList credentials |
|
|
50
|
-
| `logout` | _None_ | Log out from your AniList account |
|
|
51
|
-
| `whoami` | _None_ | Display information about the logged-in user |
|
|
52
|
-
| `-V, --version` | _None_ | Display the current version of the CLI |
|
|
53
|
-
| `-h, --help` | _None_ | Display available commands and options |
|
|
54
|
-
| `trending` <br> _(alias: `tr`)_ | `-c (default: 10)` | Fetch trending anime (default count is 10) |
|
|
55
|
-
| `popular` <br> _(alias: `plr`)_ | `-c (default: 10)` | Fetch popular anime (default count is 10) |
|
|
56
|
-
| `user` | `<username>` | Get information about a specific AniList user |
|
|
57
|
-
| `lists` <br> _(alias: `ls`)_ | `-a, --anime` <br> `-m, --manga` | Fetch anime or manga lists of the logged-in user |
|
|
58
|
-
| `delete` <br> _(alias: `del`)_ | `-a, --anime` <br> `-m, --manga` <br> `-s, --activity` | Delete collections of anime, manga or activities |
|
|
59
|
-
| `upcoming` <br> _(alias:`up`)_ | `-c (default: 10)` | Fetch upcoming anime (default count is 10) |
|
|
60
|
-
| `anime` | `<anime-id>` | Get anime details by Anime Id |
|
|
61
|
-
| `
|
|
62
|
-
| `
|
|
63
|
-
| `
|
|
64
|
-
| `
|
|
65
|
-
| `
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
- `-
|
|
78
|
-
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
- `-
|
|
161
|
-
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
- `-
|
|
172
|
-
- `-
|
|
173
|
-
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
```
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
-
|
|
205
|
-
-
|
|
206
|
-
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
-
|
|
217
|
-
- Description:
|
|
218
|
-
|
|
219
|
-
#### `
|
|
220
|
-
|
|
221
|
-
```bash
|
|
222
|
-
anilist
|
|
223
|
-
```
|
|
224
|
-
|
|
225
|
-
- Options:
|
|
226
|
-
- `-a, --anime`: To
|
|
227
|
-
- `-m, --manga`: To
|
|
228
|
-
- Description:
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
####
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
1
|
+
#### @irfanshadikrishad/anilist
|
|
2
|
+
|
|
3
|
+
Minimalist unofficial AniList CLI for Anime and Manga Enthusiasts.
|
|
4
|
+
|
|
5
|
+

|
|
6
|
+

|
|
7
|
+

|
|
8
|
+
|
|
9
|
+
#### How to install?
|
|
10
|
+
|
|
11
|
+
Make sure [Node.js](https://nodejs.org/en) and [npm](https://www.npmjs.com) are already installed in your system.
|
|
12
|
+
Verify installation using
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
node -v
|
|
16
|
+
npm -v
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
If you see the version then its installed. Otherwise install nodejs and npm should already be installed with nodejs.
|
|
20
|
+
Then install the package by running
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
npm install -g @irfanshadikrishad/anilist
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
This will install the package globally. And you have to use commands like
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
anilist tr -c 15
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
#### How to use?
|
|
33
|
+
|
|
34
|
+
Create an API client from [anilist developer setting](https://anilist.co/settings/developer) with an application name and redirect url as `https://anilist.co/api/v2/oauth/pin`. After creating the client you will get `Client ID` and `Client Secret` which is required in order to login from CLI.
|
|
35
|
+
|
|
36
|
+
To login:
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
anilist login -i <client-id> -s <client-secret>
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
> [!NOTE]
|
|
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
|
+
|
|
45
|
+
#### CLI Commands Overview
|
|
46
|
+
|
|
47
|
+
| **Command** | **Options** | **Description** |
|
|
48
|
+
| --------------------------------------- | ----------------------------------------------------------------------- | ------------------------------------------------------------------------------------------ |
|
|
49
|
+
| `login` | `-i, --id` `-s, --secret` | Log in with your AniList credentials |
|
|
50
|
+
| `logout` | _None_ | Log out from your AniList account |
|
|
51
|
+
| `whoami` | _None_ | Display information about the logged-in user |
|
|
52
|
+
| `-V, --version` | _None_ | Display the current version of the CLI |
|
|
53
|
+
| `-h, --help` | _None_ | Display available commands and options |
|
|
54
|
+
| `trending` <br> _(alias: `tr`)_ | `-c (default: 10)` | Fetch trending anime (default count is 10) |
|
|
55
|
+
| `popular` <br> _(alias: `plr`)_ | `-c (default: 10)` | Fetch popular anime (default count is 10) |
|
|
56
|
+
| `user` | `<username>` | Get information about a specific AniList user |
|
|
57
|
+
| `lists` <br> _(alias: `ls`)_ | `-a, --anime` <br> `-m, --manga` | Fetch anime or manga lists of the logged-in user |
|
|
58
|
+
| `delete` <br> _(alias: `del`)_ | `-a, --anime` <br> `-m, --manga` <br> `-s, --activity` | Delete collections of anime, manga or activities |
|
|
59
|
+
| `upcoming` <br> _(alias:`up`)_ | `-c (default: 10)` | Fetch upcoming anime (default count is 10) |
|
|
60
|
+
| `anime` | `<anime-id>` | Get anime details by Anime Id |
|
|
61
|
+
| `manga` | `<manga-id>` | Get manga details by Manga ID |
|
|
62
|
+
| `search` <br> _(alias:`srch`/`find`)_ | `<query>` <br> `-a, --anime` <br> `-m, --manga` <br> `-c (default: 10)` | Get anime/manga search results |
|
|
63
|
+
| `status` <br> _(alias: `write`/`post`)_ | `<status>` | Write a status... (text/markdown/html) |
|
|
64
|
+
| `export` <br> _(alias: `exp`)_ | `-a, --anime` <br> `-m, --manga` | Export anime or manga list in JSON, CSV or XML (MyAnimeList/AniDB) |
|
|
65
|
+
| `import` <br> _(alias: `imp`)_ | `-a, --anime` <br> `-m, --manga` | Import anime or manga list from exported JSON, MyAnimeList (XML) or AniDB (json-large) |
|
|
66
|
+
| `social` <br> _(alias: `sol`)_ | `-f, --follow` <br> `-u, --unfollow` | Follow users who follows you or Unfollow who doesn't follow you back with a simple command |
|
|
67
|
+
|
|
68
|
+
#### Command Breakdown:
|
|
69
|
+
|
|
70
|
+
#### `login`:
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
anilist login -i <client-id> -s <client-secret>
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
- Options:
|
|
77
|
+
- `-i, --id`: Specify AniList Client ID
|
|
78
|
+
- `-s, --secret`: Provide the AniList Client Secret
|
|
79
|
+
- Usage: Authenticate and log in to AniList using your ID and secret credentials.
|
|
80
|
+
|
|
81
|
+
#### `logout`:
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
anilist logout
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
- Description: End the current session and log out from your AniList account.
|
|
88
|
+
|
|
89
|
+
#### `whoami`:
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
anilist whoami
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
- Description: Retrieve and display information about the currently logged-in user, including stats and profile details.
|
|
96
|
+
|
|
97
|
+
#### `-V, --version`:
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
anilist -V
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
- Description: Quickly check which version of the CLI you are running.
|
|
104
|
+
|
|
105
|
+
#### `-h, --help`:
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
anilist -h
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
- Description: List all available commands and their usage details for quick reference.
|
|
112
|
+
|
|
113
|
+
#### `trending` _(alias: `tr`)_:
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
anilist tr -c 15
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
- Options:
|
|
120
|
+
- `-c (count)`: Specify how many trending anime to fetch (default: 10).
|
|
121
|
+
- Description: Fetch the current trending anime series, with the option to customize how many results to display.
|
|
122
|
+
|
|
123
|
+
#### `popular` _(alias: `plr`)_:
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
anilist popular
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
- Options:
|
|
130
|
+
- `-c (count)`: Specify how many popular anime to fetch (default: 10).
|
|
131
|
+
- Description: Fetch the most popular anime series, with the option to customize how many results to display.
|
|
132
|
+
|
|
133
|
+
#### `upcoming` _(alias: `up`)_:
|
|
134
|
+
|
|
135
|
+
```bash
|
|
136
|
+
anilist up -c 25
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
- Options:
|
|
140
|
+
- `-c (count)`: Specify how many upcoming anime to fetch (default: 10).
|
|
141
|
+
- Description: Fetch the upcoming anime series next season, with the option to customize how many results to display.
|
|
142
|
+
|
|
143
|
+
#### `user`:
|
|
144
|
+
|
|
145
|
+
```bash
|
|
146
|
+
anilist user <username>
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
- Options:
|
|
150
|
+
- `<username>`: Specify the AniList username to fetch.
|
|
151
|
+
- Description: Retrieve profile information about a specific AniList user.
|
|
152
|
+
|
|
153
|
+
#### `lists` _(alias: `ls`)_:
|
|
154
|
+
|
|
155
|
+
```bash
|
|
156
|
+
anilist ls -a
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
- Options:
|
|
160
|
+
- `-a, --anime`: Fetch the authenticated user's anime list.
|
|
161
|
+
- `-m, --manga`: Fetch the authenticated user's manga list.
|
|
162
|
+
- Description: Get the anime or manga lists of the logged-in user.
|
|
163
|
+
|
|
164
|
+
#### `delete` _(alias: `del`)_:
|
|
165
|
+
|
|
166
|
+
```bash
|
|
167
|
+
anilist del -s,
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
- Options:
|
|
171
|
+
- `-a, --anime`: Delete your specific anime collection that you want.
|
|
172
|
+
- `-m, --manga`: Delete your specific manga collection that you want.
|
|
173
|
+
- `-s,, --activity`: Delete all or any type of activities you want.
|
|
174
|
+
- Description: Delete the entire anime or manga collection from the logged-in user's profile.
|
|
175
|
+
|
|
176
|
+
#### `anime`
|
|
177
|
+
|
|
178
|
+
```bash
|
|
179
|
+
anilist anime <anime-id>
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
- Options
|
|
183
|
+
- `<anime-id>` _(eg: 21)_ : Id of the anime you want to get details of.
|
|
184
|
+
- Description: Get anime details by anime Id.
|
|
185
|
+
|
|
186
|
+
#### `manga`
|
|
187
|
+
|
|
188
|
+
```bash
|
|
189
|
+
anilist manga <manga-id>
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
- Options
|
|
193
|
+
- `<anime-id>` _(eg: 21)_ : Id of the manga you want to get details of.
|
|
194
|
+
- Description: Get manga details by manga Id.
|
|
195
|
+
|
|
196
|
+
#### `search` _(alias: `srch`/`find`)_:
|
|
197
|
+
|
|
198
|
+
```bash
|
|
199
|
+
anilist search <query> -a -c 20
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
- Options:
|
|
203
|
+
- `<query>` : What you want to search (eg: naruto).
|
|
204
|
+
- `-a, --anime`: To get results of anime search.
|
|
205
|
+
- `-m, --manga`: To get results of manga search.
|
|
206
|
+
- `-c (count)`: Specify how many items to fetch (default: 10).
|
|
207
|
+
- Description: Get anime/manga search results
|
|
208
|
+
|
|
209
|
+
#### `status` _(alias: `write`/`post`)_:
|
|
210
|
+
|
|
211
|
+
```bash
|
|
212
|
+
anilist write <status>
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
- Options:
|
|
216
|
+
- `<status>` : This is what you want to write, It can be HTML, Markdown and/or Text. But wrap it with quotation mark (") else it might get cut-off.
|
|
217
|
+
- Description: Get anime/manga search results
|
|
218
|
+
|
|
219
|
+
#### `export` _(alias: `exp`)_:
|
|
220
|
+
|
|
221
|
+
```bash
|
|
222
|
+
anilist export -a
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
- Options:
|
|
226
|
+
- `-a, --anime`: To export anime list.
|
|
227
|
+
- `-m, --manga`: To export manga list.
|
|
228
|
+
- Description: Export anime or manga list. For `XML (MyAnimeList/AniDB)` file, to import it on MyAnimeList, go [here](https://myanimelist.net/import.php) and choose `MyAnimeList Import` for `AniDB` go [here](https://anidb.net/user/import) and select `MyAnimeList.net - XML anime list export`.
|
|
229
|
+
|
|
230
|
+
#### `import` _(alias: `imp`)_:
|
|
231
|
+
|
|
232
|
+
```bash
|
|
233
|
+
anilist import -m
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
- Options:
|
|
237
|
+
- `-a, --anime`: To import anime list.
|
|
238
|
+
- `-m, --manga`: To import manga list.
|
|
239
|
+
- Description: Import anime or manga list. If you want to import anime/manga list from `MyAnimeList`, export the XML from [here](https://myanimelist.net/panel.php?go=export), for exporting list from `AniDB` go [here](https://anidb.net/user/export).
|
|
240
|
+
|
|
241
|
+
> [!NOTE]
|
|
242
|
+
> If you have exported from `AniDB`, you will have to unzip it, and there should be a file named `mylist.json`, copy and paste it in your systems download folder, and select it from import option.
|
|
243
|
+
|
|
244
|
+
> [!IMPORTANT]
|
|
245
|
+
> If you are importing from a file, place the file in the system specific download folder, And the exported file will also be exported there as well.
|
|
246
|
+
|
|
247
|
+
#### `social` _(alias: `sol`)_:
|
|
248
|
+
|
|
249
|
+
```bash
|
|
250
|
+
anilist sol -f
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
- Options:
|
|
254
|
+
- `-f, --follow`: To follow users who follows you automatically.
|
|
255
|
+
- `-u, --unfollow`: To unfollow users who doesn't follow you back.
|
|
256
|
+
- Description: It follows users who follows you or unfollow users who doesn't follow you back at ease.
|
|
257
|
+
|
|
258
|
+
#### Security
|
|
259
|
+
|
|
260
|
+
Since you are creating your own API client for login no else else can get your credentials and the generated access token will be stored in your own system. So, As long as you don't share your device (in case you do, just logout) you are safe.
|
|
261
|
+
|
|
262
|
+
#### Contribution
|
|
263
|
+
|
|
264
|
+
Want to contribute to the project? Check out complete guideline [here](CONTRIBUTING.md).
|
|
265
|
+
|
|
266
|
+
#### _Thanks for visiting š_
|
package/bin/helpers/auth.js
CHANGED
|
@@ -873,11 +873,12 @@ class Social {
|
|
|
873
873
|
*/
|
|
874
874
|
static follow() {
|
|
875
875
|
return __awaiter(this, void 0, void 0, function* () {
|
|
876
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
876
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
877
877
|
try {
|
|
878
878
|
let pager = 1;
|
|
879
879
|
let hasNextPage = true;
|
|
880
880
|
let allFollowerUsers = [];
|
|
881
|
+
let followedBack = 0;
|
|
881
882
|
spinner.start("Fetching all the followers...");
|
|
882
883
|
while (hasNextPage) {
|
|
883
884
|
const followerUsers = yield fetcher(userFollowersQuery, {
|
|
@@ -910,12 +911,16 @@ class Social {
|
|
|
910
911
|
console.log(`${String(`[${nf.id}]`).padEnd(maxIdLength)}` +
|
|
911
912
|
`\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)}` +
|
|
912
913
|
`\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) ? "ā
" : "šµ"}`);
|
|
914
|
+
// Count the followed back users
|
|
915
|
+
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) {
|
|
916
|
+
followedBack++;
|
|
917
|
+
}
|
|
913
918
|
}
|
|
914
919
|
catch (error) {
|
|
915
920
|
console.log(`automate_follow_toggle_follow: ${error.message}`);
|
|
916
921
|
}
|
|
917
922
|
}
|
|
918
|
-
console.log(`\nā
Followed back ${
|
|
923
|
+
console.log(`\nā
Followed back ${followedBack} users.`);
|
|
919
924
|
}
|
|
920
925
|
catch (error) {
|
|
921
926
|
console.log(`\nautomate_follow ${error.message}`);
|
|
@@ -927,18 +932,19 @@ class Social {
|
|
|
927
932
|
*/
|
|
928
933
|
static unfollow() {
|
|
929
934
|
return __awaiter(this, void 0, void 0, function* () {
|
|
930
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
935
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
931
936
|
try {
|
|
932
937
|
let pager = 1;
|
|
933
938
|
let hasNextPage = true;
|
|
934
939
|
let allFollowingUsers = [];
|
|
940
|
+
let unfollowedUsers = 0;
|
|
935
941
|
spinner.start("Fetching all following users...");
|
|
936
942
|
while (hasNextPage) {
|
|
937
943
|
const followingUsers = yield fetcher(userFollowingQuery, {
|
|
938
944
|
userId: yield Auth.MyUserId(),
|
|
939
945
|
page: pager,
|
|
940
946
|
});
|
|
941
|
-
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}
|
|
947
|
+
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}...`);
|
|
942
948
|
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)) {
|
|
943
949
|
hasNextPage = false;
|
|
944
950
|
}
|
|
@@ -951,8 +957,7 @@ class Social {
|
|
|
951
957
|
.filter((user) => !user.isFollower)
|
|
952
958
|
.map((u3r) => ({ id: u3r.id, name: u3r.name }));
|
|
953
959
|
if (notFollowingMe.length <= 0) {
|
|
954
|
-
|
|
955
|
-
spinner.stop(`No users to unfollow. Aborting process...`);
|
|
960
|
+
spinner.stop(`No users to unfollow. Exiting operation...`);
|
|
956
961
|
return;
|
|
957
962
|
}
|
|
958
963
|
spinner.stop(`Unfollow process activated with ${notFollowingMe.length} users.`);
|
|
@@ -965,12 +970,16 @@ class Social {
|
|
|
965
970
|
userId: nfm.id,
|
|
966
971
|
});
|
|
967
972
|
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) ? "ā
" : "šµ"}`);
|
|
973
|
+
// Count the unfollowed users
|
|
974
|
+
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) {
|
|
975
|
+
unfollowedUsers++;
|
|
976
|
+
}
|
|
968
977
|
}
|
|
969
978
|
catch (error) {
|
|
970
979
|
console.log(`unfollow_toggle_follow. ${error.message}`);
|
|
971
980
|
}
|
|
972
981
|
}
|
|
973
|
-
console.log(`\nTotal Unfollowed: ${nfmCount}
|
|
982
|
+
console.log(`\nTotal Unfollowed: ${unfollowedUsers} of ${nfmCount} users.`);
|
|
974
983
|
}
|
|
975
984
|
catch (error) {
|
|
976
985
|
console.error(`\nautomate_unfollow: ${error.message}`);
|
package/bin/helpers/lists.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ declare class AniList {
|
|
|
10
10
|
static getUpcomingAnime(count: number): Promise<void>;
|
|
11
11
|
static getUserByUsername(username: string): Promise<void>;
|
|
12
12
|
static getAnimeDetailsByID(anilistID: number): Promise<void>;
|
|
13
|
+
static getMangaDetailsByID(mangaID: number): Promise<void>;
|
|
13
14
|
static searchAnime(search: string, count: number): Promise<void>;
|
|
14
15
|
static searchManga(search: string, count: number): Promise<void>;
|
|
15
16
|
}
|