@irfanshadikrishad/anilist 1.3.0-forbidden.1 → 1.3.3-forbidden.1
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 +243 -240
- package/bin/helpers/auth.js +43 -27
- package/bin/helpers/lists.d.ts +4 -1
- package/bin/helpers/lists.js +110 -9
- package/bin/helpers/mutations.js +35 -35
- package/bin/helpers/queries.d.ts +4 -2
- package/bin/helpers/queries.js +168 -154
- package/bin/helpers/types.d.ts +123 -4
- package/bin/helpers/workers.d.ts +5 -4
- package/bin/helpers/workers.js +100 -69
- package/package.json +81 -80
package/README.md
CHANGED
|
@@ -1,240 +1,243 @@
|
|
|
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
|
-
| **`search`** <br> _(alias:`srch`/`find`)_ | `<query>` <br> `-a, --anime` <br> `-m, --manga` <br> `-c (default: 10)` | Get anime/manga search results
|
|
62
|
-
| **`status`** <br> _(alias: `write`/`post`)_ | `<status>` | Write a status... (text/markdown/html)
|
|
63
|
-
| **`export`** <br> _(alias: `exp`)_ | `-a, --anime` <br> `-m, --manga` | Export anime or manga list in JSON, CSV or XML (MyAnimeList)
|
|
64
|
-
| **`import`** <br> _(alias: `imp`)_ | `-a, --anime` <br> `-m, --manga` | Import anime or manga list from exported JSON
|
|
65
|
-
|
|
66
|
-
#### Command Breakdown:
|
|
67
|
-
|
|
68
|
-
#### `login`:
|
|
69
|
-
|
|
70
|
-
```bash
|
|
71
|
-
anilist login -i <client-id> -s <client-secret>
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
- **Options**:
|
|
75
|
-
- `-i, --id`: Specify AniList Client ID
|
|
76
|
-
- `-s, --secret`: Provide the AniList Client Secret
|
|
77
|
-
- **Usage**: Authenticate and log in to AniList using your ID and secret credentials.
|
|
78
|
-
|
|
79
|
-
#### `logout`:
|
|
80
|
-
|
|
81
|
-
```bash
|
|
82
|
-
anilist logout
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
- **Description**: End the current session and log out from your AniList account.
|
|
86
|
-
|
|
87
|
-
#### `me`:
|
|
88
|
-
|
|
89
|
-
```bash
|
|
90
|
-
anilist me
|
|
91
|
-
```
|
|
92
|
-
|
|
93
|
-
- **Description**: Retrieve and display information about the currently logged-in user, including stats and profile details.
|
|
94
|
-
|
|
95
|
-
#### `-V, --version`:
|
|
96
|
-
|
|
97
|
-
```bash
|
|
98
|
-
anilist -V
|
|
99
|
-
```
|
|
100
|
-
|
|
101
|
-
- **Description**: Quickly check which version of the CLI you are running.
|
|
102
|
-
|
|
103
|
-
#### `-h, --help`:
|
|
104
|
-
|
|
105
|
-
```bash
|
|
106
|
-
anilist -h
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
- **Description**: List all available commands and their usage details for quick reference.
|
|
110
|
-
|
|
111
|
-
#### `trending` _(alias: `tr`)_:
|
|
112
|
-
|
|
113
|
-
```bash
|
|
114
|
-
anilist tr -c 15
|
|
115
|
-
```
|
|
116
|
-
|
|
117
|
-
- **Options**:
|
|
118
|
-
- `-c (count)`: Specify how many trending anime to fetch (default: 10).
|
|
119
|
-
- **Description**: Fetch the current trending anime series, with the option to customize how many results to display.
|
|
120
|
-
|
|
121
|
-
#### `popular` _(alias: `plr`)_:
|
|
122
|
-
|
|
123
|
-
```bash
|
|
124
|
-
anilist popular
|
|
125
|
-
```
|
|
126
|
-
|
|
127
|
-
- **Options**:
|
|
128
|
-
- `-c (count)`: Specify how many popular anime to fetch (default: 10).
|
|
129
|
-
- **Description**: Fetch the most popular anime series, with the option to customize how many results to display.
|
|
130
|
-
|
|
131
|
-
#### `upcoming` _(alias: `up`)_:
|
|
132
|
-
|
|
133
|
-
```bash
|
|
134
|
-
anilist up -c 25
|
|
135
|
-
```
|
|
136
|
-
|
|
137
|
-
- **Options**:
|
|
138
|
-
- `-c (count)`: Specify how many upcoming anime to fetch (default: 10).
|
|
139
|
-
- **Description**: Fetch the upcoming anime series next season, with the option to customize how many results to display.
|
|
140
|
-
|
|
141
|
-
#### `user`:
|
|
142
|
-
|
|
143
|
-
```bash
|
|
144
|
-
anilist user <username>
|
|
145
|
-
```
|
|
146
|
-
|
|
147
|
-
- **Options**:
|
|
148
|
-
- `<username>`: Specify the AniList username to fetch.
|
|
149
|
-
- **Description**: Retrieve profile information about a specific AniList user.
|
|
150
|
-
|
|
151
|
-
#### `lists` _(alias: `ls`)_:
|
|
152
|
-
|
|
153
|
-
```bash
|
|
154
|
-
anilist ls -a
|
|
155
|
-
```
|
|
156
|
-
|
|
157
|
-
- **Options**:
|
|
158
|
-
- `-a, --anime`: Fetch the authenticated user's anime list.
|
|
159
|
-
- `-m, --manga`: Fetch the authenticated user's manga list.
|
|
160
|
-
- **Description**: Get the anime or manga lists of the logged-in user.
|
|
161
|
-
|
|
162
|
-
#### `delete` _(alias: `del`)_:
|
|
163
|
-
|
|
164
|
-
```bash
|
|
165
|
-
anilist del -ac
|
|
166
|
-
```
|
|
167
|
-
|
|
168
|
-
- **Options**:
|
|
169
|
-
- `-a, --anime`: Delete your specific anime collection that you want.
|
|
170
|
-
- `-m, --manga`: Delete your specific manga collection that you want.
|
|
171
|
-
- `-ac, --activity`: Delete all or any type of activities you want.
|
|
172
|
-
- **Description**: Delete the entire anime or manga collection from the logged-in user's profile.
|
|
173
|
-
|
|
174
|
-
#### `anime`
|
|
175
|
-
|
|
176
|
-
```bash
|
|
177
|
-
anilist anime <anime-id>
|
|
178
|
-
```
|
|
179
|
-
|
|
180
|
-
- **Options**
|
|
181
|
-
- `<anime-id>` _(eg: 21)_ : Id of the anime you want to get details of.
|
|
182
|
-
- **Description**: Get anime details by anime Id.
|
|
183
|
-
|
|
184
|
-
#### `search` _(alias: `srch`/`find`)_:
|
|
185
|
-
|
|
186
|
-
```bash
|
|
187
|
-
anilist search <query> -a -c 20
|
|
188
|
-
```
|
|
189
|
-
|
|
190
|
-
- **Options**:
|
|
191
|
-
- `<query>` : What you want to search (eg: naruto).
|
|
192
|
-
- `-a, --anime`: To get results of anime search.
|
|
193
|
-
- `-m, --manga`: To get results of manga search.
|
|
194
|
-
- `-c (count)`: Specify how many items to fetch (default: 10).
|
|
195
|
-
- **Description**: Get anime/manga search results
|
|
196
|
-
|
|
197
|
-
#### `status` _(alias: `write`/`post`)_:
|
|
198
|
-
|
|
199
|
-
```bash
|
|
200
|
-
anilist write <status>
|
|
201
|
-
```
|
|
202
|
-
|
|
203
|
-
- **Options**:
|
|
204
|
-
- `<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.
|
|
205
|
-
- **Description**: Get anime/manga search results
|
|
206
|
-
|
|
207
|
-
#### `export` _(alias: `exp`)_:
|
|
208
|
-
|
|
209
|
-
```bash
|
|
210
|
-
anilist export -a
|
|
211
|
-
```
|
|
212
|
-
|
|
213
|
-
- **Options**:
|
|
214
|
-
- `-a, --anime`: To export anime list.
|
|
215
|
-
- `-m, --manga`: To export manga list.
|
|
216
|
-
- **Description**: Export anime or manga list. For `XML (MyAnimeList)` file, to import it on MyAnimeList, go [here](https://myanimelist.net/import.php) and choose `MyAnimeList Import`.
|
|
217
|
-
|
|
218
|
-
#### `import` _(alias: `imp`)_:
|
|
219
|
-
|
|
220
|
-
```bash
|
|
221
|
-
anilist import -m
|
|
222
|
-
```
|
|
223
|
-
|
|
224
|
-
- **Options**:
|
|
225
|
-
- `-a, --anime`: To import anime list.
|
|
226
|
-
- `-m, --manga`: To import manga list.
|
|
227
|
-
- **Description**: Import anime or manga list. If you want to import anime/manga list from MyAnimeList
|
|
228
|
-
|
|
229
|
-
> [!
|
|
230
|
-
> If you
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
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
|
+
| **`search`** <br> _(alias:`srch`/`find`)_ | `<query>` <br> `-a, --anime` <br> `-m, --manga` <br> `-c (default: 10)` | Get anime/manga search results |
|
|
62
|
+
| **`status`** <br> _(alias: `write`/`post`)_ | `<status>` | Write a status... (text/markdown/html) |
|
|
63
|
+
| **`export`** <br> _(alias: `exp`)_ | `-a, --anime` <br> `-m, --manga` | Export anime or manga list in JSON, CSV or XML (MyAnimeList/AniDB) |
|
|
64
|
+
| **`import`** <br> _(alias: `imp`)_ | `-a, --anime` <br> `-m, --manga` | Import anime or manga list from exported JSON, MyAnimeList (XML) or AniDB (json-large) |
|
|
65
|
+
|
|
66
|
+
#### Command Breakdown:
|
|
67
|
+
|
|
68
|
+
#### `login`:
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
anilist login -i <client-id> -s <client-secret>
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
- **Options**:
|
|
75
|
+
- `-i, --id`: Specify AniList Client ID
|
|
76
|
+
- `-s, --secret`: Provide the AniList Client Secret
|
|
77
|
+
- **Usage**: Authenticate and log in to AniList using your ID and secret credentials.
|
|
78
|
+
|
|
79
|
+
#### `logout`:
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
anilist logout
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
- **Description**: End the current session and log out from your AniList account.
|
|
86
|
+
|
|
87
|
+
#### `me`:
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
anilist me
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
- **Description**: Retrieve and display information about the currently logged-in user, including stats and profile details.
|
|
94
|
+
|
|
95
|
+
#### `-V, --version`:
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
anilist -V
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
- **Description**: Quickly check which version of the CLI you are running.
|
|
102
|
+
|
|
103
|
+
#### `-h, --help`:
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
anilist -h
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
- **Description**: List all available commands and their usage details for quick reference.
|
|
110
|
+
|
|
111
|
+
#### `trending` _(alias: `tr`)_:
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
anilist tr -c 15
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
- **Options**:
|
|
118
|
+
- `-c (count)`: Specify how many trending anime to fetch (default: 10).
|
|
119
|
+
- **Description**: Fetch the current trending anime series, with the option to customize how many results to display.
|
|
120
|
+
|
|
121
|
+
#### `popular` _(alias: `plr`)_:
|
|
122
|
+
|
|
123
|
+
```bash
|
|
124
|
+
anilist popular
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
- **Options**:
|
|
128
|
+
- `-c (count)`: Specify how many popular anime to fetch (default: 10).
|
|
129
|
+
- **Description**: Fetch the most popular anime series, with the option to customize how many results to display.
|
|
130
|
+
|
|
131
|
+
#### `upcoming` _(alias: `up`)_:
|
|
132
|
+
|
|
133
|
+
```bash
|
|
134
|
+
anilist up -c 25
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
- **Options**:
|
|
138
|
+
- `-c (count)`: Specify how many upcoming anime to fetch (default: 10).
|
|
139
|
+
- **Description**: Fetch the upcoming anime series next season, with the option to customize how many results to display.
|
|
140
|
+
|
|
141
|
+
#### `user`:
|
|
142
|
+
|
|
143
|
+
```bash
|
|
144
|
+
anilist user <username>
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
- **Options**:
|
|
148
|
+
- `<username>`: Specify the AniList username to fetch.
|
|
149
|
+
- **Description**: Retrieve profile information about a specific AniList user.
|
|
150
|
+
|
|
151
|
+
#### `lists` _(alias: `ls`)_:
|
|
152
|
+
|
|
153
|
+
```bash
|
|
154
|
+
anilist ls -a
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
- **Options**:
|
|
158
|
+
- `-a, --anime`: Fetch the authenticated user's anime list.
|
|
159
|
+
- `-m, --manga`: Fetch the authenticated user's manga list.
|
|
160
|
+
- **Description**: Get the anime or manga lists of the logged-in user.
|
|
161
|
+
|
|
162
|
+
#### `delete` _(alias: `del`)_:
|
|
163
|
+
|
|
164
|
+
```bash
|
|
165
|
+
anilist del -ac
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
- **Options**:
|
|
169
|
+
- `-a, --anime`: Delete your specific anime collection that you want.
|
|
170
|
+
- `-m, --manga`: Delete your specific manga collection that you want.
|
|
171
|
+
- `-ac, --activity`: Delete all or any type of activities you want.
|
|
172
|
+
- **Description**: Delete the entire anime or manga collection from the logged-in user's profile.
|
|
173
|
+
|
|
174
|
+
#### `anime`
|
|
175
|
+
|
|
176
|
+
```bash
|
|
177
|
+
anilist anime <anime-id>
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
- **Options**
|
|
181
|
+
- `<anime-id>` _(eg: 21)_ : Id of the anime you want to get details of.
|
|
182
|
+
- **Description**: Get anime details by anime Id.
|
|
183
|
+
|
|
184
|
+
#### `search` _(alias: `srch`/`find`)_:
|
|
185
|
+
|
|
186
|
+
```bash
|
|
187
|
+
anilist search <query> -a -c 20
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
- **Options**:
|
|
191
|
+
- `<query>` : What you want to search (eg: naruto).
|
|
192
|
+
- `-a, --anime`: To get results of anime search.
|
|
193
|
+
- `-m, --manga`: To get results of manga search.
|
|
194
|
+
- `-c (count)`: Specify how many items to fetch (default: 10).
|
|
195
|
+
- **Description**: Get anime/manga search results
|
|
196
|
+
|
|
197
|
+
#### `status` _(alias: `write`/`post`)_:
|
|
198
|
+
|
|
199
|
+
```bash
|
|
200
|
+
anilist write <status>
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
- **Options**:
|
|
204
|
+
- `<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.
|
|
205
|
+
- **Description**: Get anime/manga search results
|
|
206
|
+
|
|
207
|
+
#### `export` _(alias: `exp`)_:
|
|
208
|
+
|
|
209
|
+
```bash
|
|
210
|
+
anilist export -a
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
- **Options**:
|
|
214
|
+
- `-a, --anime`: To export anime list.
|
|
215
|
+
- `-m, --manga`: To export manga list.
|
|
216
|
+
- **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`.
|
|
217
|
+
|
|
218
|
+
#### `import` _(alias: `imp`)_:
|
|
219
|
+
|
|
220
|
+
```bash
|
|
221
|
+
anilist import -m
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
- **Options**:
|
|
225
|
+
- `-a, --anime`: To import anime list.
|
|
226
|
+
- `-m, --manga`: To import manga list.
|
|
227
|
+
- **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).
|
|
228
|
+
|
|
229
|
+
> [!NOTE]
|
|
230
|
+
> 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.
|
|
231
|
+
|
|
232
|
+
> [!IMPORTANT]
|
|
233
|
+
> 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.
|
|
234
|
+
|
|
235
|
+
#### Security
|
|
236
|
+
|
|
237
|
+
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.
|
|
238
|
+
|
|
239
|
+
#### Contribution
|
|
240
|
+
|
|
241
|
+
Want to contribute to the project? Check out complete guideline [here](CONTRIBUTING.md).
|
|
242
|
+
|
|
243
|
+
#### **_Thanks for visiting 💙_**
|
package/bin/helpers/auth.js
CHANGED
|
@@ -14,9 +14,9 @@ import open from "open";
|
|
|
14
14
|
import os from "os";
|
|
15
15
|
import path from "path";
|
|
16
16
|
import { fetcher } from "./fetcher.js";
|
|
17
|
-
import { AniList, MyAnimeList } from "./lists.js";
|
|
17
|
+
import { AniDB, AniList, MyAnimeList } from "./lists.js";
|
|
18
18
|
import { deleteActivityMutation, likeActivityMutation, saveTextActivityMutation, } from "./mutations.js";
|
|
19
|
-
import { activityAllQuery, activityAnimeListQuery, activityMangaListQuery, activityMediaList, activityMessageQuery, activityTextQuery, currentUserAnimeList, currentUserMangaList, currentUserQuery, deleteMangaEntryMutation, deleteMediaEntryMutation, followingActivitiesQuery, globalActivitiesQuery, specificUserActivitiesQuery, userActivityQuery, userQuery, } from "./queries.js";
|
|
19
|
+
import { activityAllQuery, activityAnimeListQuery, activityMangaListQuery, activityMediaList, activityMessageQuery, activityTextQuery, currentUserAnimeList, currentUserMangaList, currentUserQuery, deleteMangaEntryMutation, deleteMediaEntryMutation, followingActivitiesQuery, globalActivitiesQuery, specificUserActivitiesQuery, userActivityQuery, userFollowersQuery, userFollowingQuery, userQuery, } from "./queries.js";
|
|
20
20
|
import { activityBy, aniListEndpoint, getTitle, redirectUri, timestampToTimeAgo, } from "./workers.js";
|
|
21
21
|
const home_dir = os.homedir();
|
|
22
22
|
const save_path = path.join(home_dir, ".anilist_token");
|
|
@@ -109,7 +109,7 @@ class Auth {
|
|
|
109
109
|
}
|
|
110
110
|
static Myself() {
|
|
111
111
|
return __awaiter(this, void 0, void 0, function* () {
|
|
112
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
|
|
112
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2;
|
|
113
113
|
try {
|
|
114
114
|
if (yield Auth.isLoggedIn()) {
|
|
115
115
|
const headers = {
|
|
@@ -130,30 +130,42 @@ class Auth {
|
|
|
130
130
|
perPage: 10,
|
|
131
131
|
});
|
|
132
132
|
const activities = (_b = (_a = activiResponse === null || activiResponse === void 0 ? void 0 : activiResponse.data) === null || _a === void 0 ? void 0 : _a.Page) === null || _b === void 0 ? void 0 : _b.activities;
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
133
|
+
// Get follower/following information
|
|
134
|
+
const req_followers = yield fetcher(userFollowersQuery, {
|
|
135
|
+
userId: user === null || user === void 0 ? void 0 : user.id,
|
|
136
|
+
});
|
|
137
|
+
const req_following = yield fetcher(userFollowingQuery, {
|
|
138
|
+
userId: user === null || user === void 0 ? void 0 : user.id,
|
|
139
|
+
});
|
|
140
|
+
const followersCount = ((_e = (_d = (_c = req_followers === null || req_followers === void 0 ? void 0 : req_followers.data) === null || _c === void 0 ? void 0 : _c.Page) === null || _d === void 0 ? void 0 : _d.pageInfo) === null || _e === void 0 ? void 0 : _e.total) || 0;
|
|
141
|
+
const followingCount = ((_h = (_g = (_f = req_following === null || req_following === void 0 ? void 0 : req_following.data) === null || _f === void 0 ? void 0 : _f.Page) === null || _g === void 0 ? void 0 : _g.pageInfo) === null || _h === void 0 ? void 0 : _h.total) || 0;
|
|
142
|
+
console.log(`
|
|
143
|
+
ID: ${user === null || user === void 0 ? void 0 : user.id}
|
|
144
|
+
Name: ${user === null || user === void 0 ? void 0 : user.name}
|
|
145
|
+
siteUrl: ${user === null || user === void 0 ? void 0 : user.siteUrl}
|
|
146
|
+
profileColor: ${(_j = user === null || user === void 0 ? void 0 : user.options) === null || _j === void 0 ? void 0 : _j.profileColor}
|
|
147
|
+
timeZone: ${(_k = user === null || user === void 0 ? void 0 : user.options) === null || _k === void 0 ? void 0 : _k.timezone}
|
|
148
|
+
activityMergeTime: ${(_l = user === null || user === void 0 ? void 0 : user.options) === null || _l === void 0 ? void 0 : _l.activityMergeTime}
|
|
149
|
+
donatorTier: ${user === null || user === void 0 ? void 0 : user.donatorTier}
|
|
150
|
+
donatorBadge: ${user === null || user === void 0 ? void 0 : user.donatorBadge}
|
|
151
|
+
unreadNotificationCount:${user === null || user === void 0 ? void 0 : user.unreadNotificationCount}
|
|
152
|
+
Account Created: ${new Date((user === null || user === void 0 ? void 0 : user.createdAt) * 1000).toUTCString()}
|
|
153
|
+
Account Updated: ${new Date((user === null || user === void 0 ? void 0 : user.updatedAt) * 1000).toUTCString()}
|
|
154
|
+
|
|
155
|
+
Followers: ${followersCount}
|
|
156
|
+
Following: ${followingCount}
|
|
157
|
+
|
|
158
|
+
Statistics (Anime):
|
|
159
|
+
Count: ${(_o = (_m = user === null || user === void 0 ? void 0 : user.statistics) === null || _m === void 0 ? void 0 : _m.anime) === null || _o === void 0 ? void 0 : _o.count}
|
|
160
|
+
Mean Score: ${(_q = (_p = user === null || user === void 0 ? void 0 : user.statistics) === null || _p === void 0 ? void 0 : _p.anime) === null || _q === void 0 ? void 0 : _q.meanScore}
|
|
161
|
+
Minutes Watched: ${(_s = (_r = user === null || user === void 0 ? void 0 : user.statistics) === null || _r === void 0 ? void 0 : _r.anime) === null || _s === void 0 ? void 0 : _s.minutesWatched}
|
|
162
|
+
Episodes Watched: ${(_u = (_t = user === null || user === void 0 ? void 0 : user.statistics) === null || _t === void 0 ? void 0 : _t.anime) === null || _u === void 0 ? void 0 : _u.episodesWatched}
|
|
163
|
+
|
|
164
|
+
Statistics (Manga):
|
|
165
|
+
Count: ${(_w = (_v = user === null || user === void 0 ? void 0 : user.statistics) === null || _v === void 0 ? void 0 : _v.manga) === null || _w === void 0 ? void 0 : _w.count}
|
|
166
|
+
Mean Score: ${(_y = (_x = user === null || user === void 0 ? void 0 : user.statistics) === null || _x === void 0 ? void 0 : _x.manga) === null || _y === void 0 ? void 0 : _y.meanScore}
|
|
167
|
+
Chapters Read: ${(_0 = (_z = user === null || user === void 0 ? void 0 : user.statistics) === null || _z === void 0 ? void 0 : _z.manga) === null || _0 === void 0 ? void 0 : _0.chaptersRead}
|
|
168
|
+
Volumes Read: ${(_2 = (_1 = user === null || user === void 0 ? void 0 : user.statistics) === null || _1 === void 0 ? void 0 : _1.manga) === null || _2 === void 0 ? void 0 : _2.volumesRead}
|
|
157
169
|
`);
|
|
158
170
|
console.log(`\nRecent Activities:`);
|
|
159
171
|
if (activities.length > 0) {
|
|
@@ -528,6 +540,7 @@ Statistics (Manga):
|
|
|
528
540
|
choices: [
|
|
529
541
|
{ name: "Exported JSON file.", value: 1 },
|
|
530
542
|
{ name: "MyAnimeList (XML)", value: 2 },
|
|
543
|
+
{ name: "AniDB (json-large)", value: 3 },
|
|
531
544
|
],
|
|
532
545
|
pageSize: 10,
|
|
533
546
|
},
|
|
@@ -539,6 +552,9 @@ Statistics (Manga):
|
|
|
539
552
|
case 2:
|
|
540
553
|
yield MyAnimeList.importAnime();
|
|
541
554
|
break;
|
|
555
|
+
case 3:
|
|
556
|
+
yield AniDB.importAnime();
|
|
557
|
+
break;
|
|
542
558
|
default:
|
|
543
559
|
console.log(`\nInvalid Choice.`);
|
|
544
560
|
break;
|
package/bin/helpers/lists.d.ts
CHANGED