@ferchy/n8n-nodes-aimc-toolkit 0.1.16 → 0.1.18

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 CHANGED
@@ -193,6 +193,8 @@ Use **Input Mode = File Path** to avoid loading big files into memory.
193
193
 
194
194
  ### AIMC Social Scraper
195
195
 
196
+ > **💡 Tip**: You can also use TikTok scraper programmatically in the **AIMC Code** node using `tiktokScraper` or `TikTokScraper` global variables. This UI node provides a simpler interface for common scraping tasks.
197
+
196
198
  > **⚠️ Important Legal Notice**: This node uses web scraping techniques, not official APIs. It is provided for educational and personal use only. Users are responsible for complying with:
197
199
  > - TikTok's Terms of Service
198
200
  > - Applicable laws and regulations in their jurisdiction
@@ -215,8 +217,11 @@ Use **Input Mode = File Path** to avoid loading big files into memory.
215
217
 
216
218
  **Key Options**
217
219
  - **Number of Posts**: How many posts to scrape (1-1000)
218
- - **Session Cookie**: TikTok session cookie (`sid_tt`) to avoid rate limits
219
- - Get from browser DevTools > Application > Cookies > tiktok.com
220
+ - **Options** (collapsible section):
221
+ - **No Watermark**: Download videos without TikTok watermark
222
+ - **HD Video**: Download in HD quality
223
+ - **By User ID**: Treat username as user ID (for large IDs)
224
+ - **Session Cookie** (Advanced): Only needed if you encounter rate limits - see instructions below
220
225
  - **No Watermark**: Download videos without TikTok watermark
221
226
  - **HD Video**: Download in HD quality
222
227
  - **By User ID**: Treat username as user ID (for large IDs)
@@ -227,9 +232,9 @@ Platform: TikTok
227
232
  Scrape Type: User Posts
228
233
  Username: username
229
234
  Number of Posts: 50
230
- Session Cookie: sid_tt=abc123...
231
- Options:
235
+ Options (expand if needed):
232
236
  - No Watermark: true
237
+ - Session Cookie: (only if you hit rate limits)
233
238
  ```
234
239
 
235
240
  **Example: Scrape Hashtag**
@@ -247,13 +252,23 @@ Scrape Type: Trending
247
252
  Number of Posts: 30
248
253
  ```
249
254
 
250
- **Session Cookie Setup**
251
- 1. Open TikTok in your browser
252
- 2. Open DevTools (F12)
253
- 3. Go to Application > Cookies > `https://www.tiktok.com`
254
- 4. Find `sid_tt` cookie
255
- 5. Copy the value (e.g., `sid_tt=abc123def456...`)
256
- 6. Paste into the Session Cookie field
255
+ **Session Cookie (Advanced - Optional)**
256
+ The scraper works **without cookies by default**. Session cookies are only needed if you encounter rate limits. They're hidden in the **Options** section - you don't need to worry about them unless you have issues.
257
+
258
+ **When you might need a session cookie:**
259
+ - You're scraping many posts and getting rate limited
260
+ - You're seeing captcha challenges
261
+ - You need to scrape large amounts of data regularly
262
+
263
+ **To get a session cookie (only if needed):**
264
+ 1. Open TikTok in your browser and log in
265
+ 2. Open DevTools (F12 or Right-click > Inspect)
266
+ 3. Go to **Application** tab > **Cookies** > `https://www.tiktok.com`
267
+ 4. Find the `sid_tt` cookie
268
+ 5. Copy the entire value (e.g., `sid_tt=abc123def456...`)
269
+ 6. Expand **Options** in the node and paste into the Session Cookie field
270
+
271
+ **Tip**: Start without a cookie. Most users won't need it. Only add one if you hit rate limits.
257
272
 
258
273
  **Note**: Session cookies help avoid rate limits and captchas. They're optional but recommended for production use.
259
274
 
@@ -107,8 +107,8 @@ class AimcSocial {
107
107
  scrapeType: ['user'],
108
108
  },
109
109
  },
110
- placeholder: 'username',
111
- description: 'TikTok username (without @)',
110
+ placeholder: 'username or @username',
111
+ description: 'TikTok username (with or without @ symbol - will be automatically removed)',
112
112
  },
113
113
  {
114
114
  displayName: 'Hashtag',
@@ -122,8 +122,8 @@ class AimcSocial {
122
122
  scrapeType: ['hashtag'],
123
123
  },
124
124
  },
125
- placeholder: 'fyp',
126
- description: 'Hashtag to scrape (without #)',
125
+ placeholder: 'fyp or #fyp',
126
+ description: 'Hashtag to scrape (with or without # symbol - will be automatically removed)',
127
127
  },
128
128
  {
129
129
  displayName: 'Video URL',
@@ -157,22 +157,6 @@ class AimcSocial {
157
157
  },
158
158
  description: 'Number of posts to scrape',
159
159
  },
160
- {
161
- displayName: 'Session Cookie',
162
- name: 'sessionCookie',
163
- type: 'string',
164
- typeOptions: {
165
- password: true,
166
- },
167
- default: '',
168
- displayOptions: {
169
- show: {
170
- platform: ['tiktok'],
171
- },
172
- },
173
- placeholder: 'sid_tt=abc123...',
174
- description: 'TikTok session cookie (sid_tt) to avoid rate limits. Get from browser DevTools > Application > Cookies',
175
- },
176
160
  {
177
161
  displayName: 'Options',
178
162
  name: 'options',
@@ -204,12 +188,18 @@ class AimcSocial {
204
188
  name: 'byUserId',
205
189
  type: 'boolean',
206
190
  default: false,
207
- displayOptions: {
208
- show: {
209
- scrapeType: ['user'],
210
- },
191
+ description: 'If true, interpret the username as a user ID (only applies to User Posts scrape type)',
192
+ },
193
+ {
194
+ displayName: 'Session Cookie',
195
+ name: 'sessionCookie',
196
+ type: 'string',
197
+ typeOptions: {
198
+ password: true,
211
199
  },
212
- description: 'If true, interpret the username as a user ID',
200
+ default: '',
201
+ placeholder: 'sid_tt=abc123...',
202
+ description: '[Advanced] TikTok session cookie to reduce rate limits. Only needed if you encounter rate limits. Leave empty to use without. Format: "sid_tt=abc123def456..."',
213
203
  },
214
204
  ],
215
205
  },
@@ -223,13 +213,19 @@ class AimcSocial {
223
213
  try {
224
214
  const platform = this.getNodeParameter('platform', i);
225
215
  const scrapeType = this.getNodeParameter('scrapeType', i);
226
- const sessionCookie = this.getNodeParameter('sessionCookie', i, '');
227
216
  const options = this.getNodeParameter('options', i, {});
228
217
  let result;
229
218
  if (platform === 'tiktok') {
219
+ // Get session cookie from options if provided
220
+ const sessionCookie = options.sessionCookie || '';
230
221
  const sessionList = sessionCookie ? [sessionCookie] : [];
231
222
  if (scrapeType === 'user') {
232
- const username = this.getNodeParameter('username', i);
223
+ const usernameRaw = this.getNodeParameter('username', i);
224
+ if (!usernameRaw || !usernameRaw.trim()) {
225
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Username is required. Please enter a TikTok username (without @ symbol).');
226
+ }
227
+ // Remove @ symbol if present and trim whitespace
228
+ const username = usernameRaw.trim().replace(/^@/, '');
233
229
  const number = this.getNodeParameter('number', i, 20);
234
230
  result = await scrapeTikTokUser.call(this, username, {
235
231
  number,
@@ -240,7 +236,12 @@ class AimcSocial {
240
236
  });
241
237
  }
242
238
  else if (scrapeType === 'hashtag') {
243
- const hashtag = this.getNodeParameter('hashtag', i);
239
+ const hashtagRaw = this.getNodeParameter('hashtag', i);
240
+ if (!hashtagRaw || !hashtagRaw.trim()) {
241
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Hashtag is required. Please enter a TikTok hashtag (without # symbol).');
242
+ }
243
+ // Remove # symbol if present and trim whitespace
244
+ const hashtag = hashtagRaw.trim().replace(/^#/, '');
244
245
  const number = this.getNodeParameter('number', i, 20);
245
246
  result = await scrapeTikTokHashtag.call(this, hashtag, {
246
247
  number,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ferchy/n8n-nodes-aimc-toolkit",
3
- "version": "0.1.16",
3
+ "version": "0.1.18",
4
4
  "description": "AIMC Toolkit nodes for n8n: code execution and media operations.",
5
5
  "license": "MIT",
6
6
  "author": "Ferchy",