instasave-sdk 1.1.0 → 1.1.2

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/CHANGELOG.md ADDED
@@ -0,0 +1,271 @@
1
+ # Changelog
2
+
3
+ All notable changes to InstaSave SDK will be documented in this file.
4
+
5
+ ## [1.1.2] - 2026-01-03
6
+
7
+ ### 📦 Package Enhancement
8
+
9
+ ### Added
10
+ - **Complete documentation in npm package** - README_API.md and CHANGELOG.md now included
11
+ - **Offline documentation access** - All docs available in node_modules/instasave-sdk/
12
+ - **Better developer experience** - No need to visit GitHub for API reference
13
+
14
+ ### Changed
15
+ - Updated package.json files array to include documentation files
16
+ - Enhanced npm package contents for better usability
17
+
18
+ ---
19
+
20
+ ## [1.1.1] - 2026-01-03
21
+
22
+ ### 📚 Documentation Update
23
+
24
+ ### Added
25
+ - **Comprehensive README** - Complete rewrite with better structure and examples
26
+ - **Detailed API Reference** - Updated README_API.md with current interfaces
27
+ - **Usage examples** - Step-by-step guides for common scenarios
28
+ - **Error handling guide** - How to handle authentication and timeout errors
29
+
30
+ ### Changed
31
+ - **Better organization** - Clear sections with emojis and formatting
32
+ - **Updated examples** - All code examples use current v1.1.x API
33
+ - **Simplified explanations** - Easier to understand for new users
34
+
35
+ ### Documentation
36
+ - Complete README restructure with Quick Start section
37
+ - Updated all code examples to match simplified metadata
38
+ - Added troubleshooting section with common issues
39
+ - Comprehensive API reference with TypeScript interfaces
40
+
41
+ ---
42
+
43
+ ## [1.1.0] - 2026-01-03
44
+
45
+ ### 🎯 Major Refactor - Simplified & Optimized
46
+
47
+ ### Changed
48
+ - **Simplified metadata interface** - Removed `audio`, `hashtags`, `mentions` fields
49
+ - **Cleaner API** - Only essential metadata: `likesCount`, `commentsCount`, `caption`, `timestamp`, `location`
50
+ - **Improved performance** - Removed complex audio extraction logic
51
+ - **Smaller bundle size** - Eliminated 668+ lines of unused code
52
+
53
+ ### Removed
54
+ - ❌ Audio metadata extraction (not reliably available via web scraping)
55
+ - ❌ Hashtags/mentions extraction from captions
56
+ - ❌ Unused files: `benchmark.ts`, `parallel.ts`, `memory.ts`, `test-integration.ts`, `worker.js`
57
+ - ❌ Deprecated `images` field from MediaData interface
58
+
59
+ ### Fixed
60
+ - **Metadata extraction** - More reliable likes/comments detection with multiple fallbacks
61
+ - **Bundle optimization** - Removed dead code and unused imports
62
+ - **Type safety** - Cleaner TypeScript interfaces
63
+
64
+ ### Technical
65
+ - Updated PostMetadata interface to focus on core data
66
+ - Removed complex DOM parsing for audio/hashtags
67
+ - Simplified extractMetadata function
68
+ - Better error handling for metadata extraction
69
+
70
+ ---
71
+
72
+ ## [1.0.9] - 2026-01-03
73
+
74
+ ### Added
75
+ - **URL normalization** - Consistent Instagram post URL formatting
76
+ - **Cache-busting** - Forces fresh content from Instagram servers
77
+ - **Instagram cache debug** - Cache version tracking in Debug mode
78
+
79
+ ### Features
80
+ - URL Normalizer supports multiple Instagram URL formats
81
+ - Cache-busting headers and browser cache clearing
82
+ - Debug logging for cache keys, file IDs, and versions
83
+ - Eliminates Instagram cache inconsistencies
84
+
85
+ ### Technical
86
+ - Normalizes URLs to `instagram.com/p/ID/` format
87
+ - Timestamp-based cache-busting parameters
88
+ - Chrome DevTools Protocol cache clearing
89
+ - Debug info only in Debug console mode
90
+
91
+ ## [1.0.8] - 2026-01-03
92
+
93
+ ### Added
94
+ - **Smart Logging System** - Two console modes: Classic and Debug
95
+ - **CONSOLE_MODE configuration** - Control logging verbosity via config file
96
+ - **Minimalist output** - Clean, readable logs in Classic mode
97
+ - **Detailed debugging** - Comprehensive logs in Debug mode
98
+
99
+ ### Console Modes
100
+ **Classic Mode (default):**
101
+ ```
102
+ 📄 Config loaded
103
+ 🔐 Session: username
104
+ 📸 Scraping: post_id
105
+ ✅ Success: 6 images
106
+ ```
107
+
108
+ **Debug Mode:**
109
+ ```
110
+ 📄 Config loaded from: /path/to/config
111
+ 🔐 Session loaded: username
112
+ 🔍 Platform: instagram
113
+ 🔄 Workflow steps...
114
+ ✅ Scraped post_id: 6 images
115
+ ```
116
+
117
+ ### Configuration
118
+ ```ini
119
+ [SETTINGS]
120
+ CONSOLE_MODE = Classic # or Debug
121
+ ```
122
+
123
+ ### Features
124
+ - **Crawlee log suppression** - Hides verbose crawler statistics in Classic mode
125
+ - **Smart message routing** - Different detail levels per mode
126
+ - **Always show errors** - Critical messages appear in both modes
127
+ - **Backward compatible** - Existing logging still works
128
+
129
+ ## [1.0.7] - 2026-01-03
130
+
131
+ ### Added
132
+ - **AUTO_LOGIN configuration** - Control auto-login behavior in config file
133
+ - **Enhanced login control** - Option to disable auto-login even with credentials
134
+
135
+ ### Configuration Enhancement
136
+ ```ini
137
+ [ACCOUNT]
138
+ # Auto login to Instagram (if enable, on start server auto login to instagram)
139
+ AUTO_LOGIN = true
140
+ USERNAME = your_username
141
+ PASSWORD = your_password
142
+ ```
143
+
144
+ ### Behavior
145
+ - `AUTO_LOGIN = true` - Automatic login on startup (default)
146
+ - `AUTO_LOGIN = false` - Disable auto-login even with credentials
147
+ - Better logging and debugging for login process
148
+
149
+ ## [1.0.6] - 2026-01-03
150
+
151
+ ### Added
152
+ - **Profile URL extraction** - Now extracts profile URL from Instagram posts
153
+ - **Configuration system** - Support for `instasave.config` file in project root
154
+ - **Auto-login** - Automatic authentication using config file credentials
155
+ - **Enhanced MediaData** - Added `profile_url` field to all scraped data
156
+
157
+ ### New Features
158
+ - **Config file support** - INI format configuration with sections: `[DEFAULT]`, `[ACCOUNT]`, `[SETTINGS]`
159
+ - **Project-specific settings** - Different configurations per project
160
+ - **Environment fallback** - Falls back to environment variables if config not found
161
+ - **Config API** - New methods: `getConfig()`, `getConfigParser()`
162
+
163
+ ### Configuration Example
164
+ ```ini
165
+ [DEFAULT]
166
+ PUPPETEER_EXECUTABLE_PATH = /path/to/chrome
167
+
168
+ [ACCOUNT]
169
+ USERNAME = your_username
170
+ PASSWORD = your_password
171
+
172
+ [SETTINGS]
173
+ OUTPUT_DIR = ./downloads
174
+ ```
175
+
176
+ ### Enhanced Data Structure
177
+ - Added `profile_url` to `MediaData` interface
178
+ - Example: `https://www.instagram.com/username/` extracted from posts
179
+ - Backward compatible with existing code
180
+
181
+ ## [1.0.5] - 2026-01-03
182
+
183
+ ### Fixed
184
+ - **Critical**: Fixed "text is not iterable" error in authentication system
185
+ - **NodeList iteration**: Added `Array.from()` wrapper for `querySelectorAll` results
186
+ - **Login reliability**: Improved authentication success detection
187
+ - **Browser compatibility**: Better support for different browser environments
188
+
189
+ ### Technical Details
190
+ - Fixed 5 instances of NodeList iteration in `auth-fast.ts`
191
+ - All `for...of` loops with `querySelectorAll` now use `Array.from()`
192
+ - Resolves authentication status showing false despite successful login
193
+
194
+ ## [1.0.4] - 2026-01-03
195
+
196
+ ### Removed
197
+ - **BREAKING**: Removed deprecated `scrapePost()` method
198
+ - Use `scrape()` method instead for all operations
199
+
200
+ ### Changed
201
+ - **Clean API** - Single `scrape()` method for all platforms
202
+ - **Modern approach** - `MediaData` format for all responses
203
+ - Updated all examples and documentation to use `scrape()`
204
+
205
+ ### Migration Guide
206
+ ```javascript
207
+ // Before (removed)
208
+ const data = await scraper.scrapePost(url);
209
+ console.log(data.images);
210
+
211
+ // After (use this)
212
+ const data = await scraper.scrape(url);
213
+ console.log(data.media.map(item => item.url));
214
+ ```
215
+
216
+ ## [1.0.3] - 2026-01-03
217
+
218
+ ### Added
219
+ - **Progress tracking** - Real-time download progress callbacks
220
+ - **Custom filename patterns** - Template system with `{username}_{postid}_{index}.jpg`
221
+ - **Duplicate detection** - MD5 hash-based file duplicate checking
222
+ - **Session validation** - Automatic login session verification
223
+ - **Enhanced file management** - Advanced file operations with custom naming
224
+
225
+ ### Fixed
226
+ - **Sandbox bypass** - Added `--no-sandbox` arguments for containerized environments
227
+ - **Browser launch options** - Improved compatibility across different systems
228
+
229
+ ### Enhanced
230
+ - **ScrapingOptions** - New options: `progressCallback`, `filenamePattern`, `skipDuplicates`
231
+ - **Error handling** - Better error messages and recovery mechanisms
232
+ - **Performance monitoring** - Enhanced metrics collection
233
+
234
+ ## [1.0.2] - 2026-01-03
235
+
236
+ ### Changed
237
+ - Removed deprecated `InstaScraper` class - use `MediaScraper` only
238
+ - Updated all internal code to use `MediaScraper`
239
+
240
+ ### Fixed
241
+ - Fixed URL pattern matching for Instagram URLs with username prefix
242
+ - Now supports both formats: `instagram.com/p/ABC123/` and `instagram.com/username/p/ABC123/`
243
+
244
+ ### Removed
245
+ - `InstaScraper` class (breaking change - use `MediaScraper` instead)
246
+
247
+ ## [1.0.1] - 2026-01-03
248
+
249
+ ### Changed
250
+ - Optimized dependencies - removed Playwright to reduce package size
251
+ - Updated README with comprehensive examples and troubleshooting
252
+ - Focused on Instagram image scraping only (no videos/reels)
253
+
254
+ ### Fixed
255
+ - Improved error handling for login-required content
256
+ - Better workflow automation for modal handling
257
+
258
+ ### Added
259
+ - Complete test suite with real Instagram URL validation
260
+ - Enhanced documentation with practical examples
261
+
262
+ ## [1.0.0] - 2026-01-03
263
+
264
+ ### Added
265
+ - Initial release of InstaSave SDK
266
+ - Instagram post scraping with authentication support
267
+ - Multi-platform plugin architecture
268
+ - Workflow automation system
269
+ - Metrics and monitoring capabilities
270
+ - Support for single posts and carousel posts
271
+ - Automatic session management
package/README.md CHANGED
@@ -1,13 +1,104 @@
1
1
  # InstaSave SDK
2
2
 
3
- [![Version](https://img.shields.io/badge/version-1.0.9-blue.svg)](https://github.com/nykadamec/instasave-sdk/releases/tag/v1.0.9)
3
+ [![Version](https://img.shields.io/badge/version-1.1.2-blue.svg)](https://github.com/nykadamec/instasave-sdk/releases/tag/v1.1.2)
4
4
  [![Changelog](https://img.shields.io/badge/changelog-latest-green.svg)](https://github.com/nykadamec/instasave-sdk/blob/main/CHANGELOG.md)
5
5
 
6
- 📸 Simple Instagram scraper for downloading images from posts
6
+ 📸 **Simple Instagram scraper for downloading images from posts**
7
7
 
8
- ## Configuration
8
+ Fast, reliable, and easy-to-use Instagram media downloader with authentication support.
9
9
 
10
- InstaSave SDK supports configuration via `instasave.config` file in your project root:
10
+ ---
11
+
12
+ ## 🚀 Quick Start
13
+
14
+ ```bash
15
+ npm install instasave-sdk
16
+ ```
17
+
18
+ ```javascript
19
+ import { MediaScraper } from 'instasave-sdk';
20
+
21
+ const scraper = new MediaScraper();
22
+ const data = await scraper.scrape('https://www.instagram.com/p/ABC123/');
23
+
24
+ console.log(`Downloaded ${data.media.length} images from @${data.profile_name}`);
25
+ ```
26
+
27
+ ---
28
+
29
+ ## 📖 Usage Guide
30
+
31
+ ### Basic Scraping
32
+
33
+ ```javascript
34
+ import { MediaScraper } from 'instasave-sdk';
35
+
36
+ const scraper = new MediaScraper();
37
+
38
+ // Download images from Instagram post
39
+ const data = await scraper.scrape('https://www.instagram.com/p/ABC123/');
40
+
41
+ console.log(data);
42
+ // Result:
43
+ // {
44
+ // url: 'https://www.instagram.com/p/ABC123/',
45
+ // post_id: 'ABC123',
46
+ // platform: 'instagram',
47
+ // profile_name: 'username',
48
+ // profile_url: 'https://www.instagram.com/username/',
49
+ // media: [
50
+ // { url: 'https://instagram.com/image1.jpg', index: 0 },
51
+ // { url: 'https://instagram.com/image2.jpg', index: 1 }
52
+ // ],
53
+ // metadata: {
54
+ // likesCount: 1234,
55
+ // commentsCount: 56,
56
+ // caption: 'Post caption...',
57
+ // timestamp: null,
58
+ // location: null
59
+ // }
60
+ // }
61
+ ```
62
+
63
+ ### Save to File
64
+
65
+ ```javascript
66
+ const data = await scraper.scrape('https://www.instagram.com/p/ABC123/', {
67
+ saveToFile: true, // Save data to JSON file
68
+ outputPath: './downloads' // Folder to save to
69
+ });
70
+ ```
71
+
72
+ ### Private Posts (Login Required)
73
+
74
+ ```javascript
75
+ // Login first
76
+ await scraper.login({
77
+ username: 'your_username',
78
+ password: 'your_password'
79
+ });
80
+
81
+ // Then download private posts
82
+ const data = await scraper.scrape('https://www.instagram.com/p/private_post/');
83
+ ```
84
+
85
+ ### Advanced Options
86
+
87
+ ```javascript
88
+ const data = await scraper.scrape('URL', {
89
+ saveToFile: true, // Save to file? (default: false)
90
+ outputPath: './folder', // Where to save? (default: current folder)
91
+ timeout: 60, // Timeout in seconds (default: 60)
92
+ retries: 2, // How many retries on error (default: 0)
93
+ headless: true // Hidden browser? (default: true)
94
+ });
95
+ ```
96
+
97
+ ---
98
+
99
+ ## ⚙️ Configuration
100
+
101
+ Create `instasave.config` in your project root for automatic setup:
11
102
 
12
103
  ```ini
13
104
  [DEFAULT]
@@ -29,24 +120,64 @@ TIMEOUT = 60
29
120
  - ✅ **Project-specific** - Different settings per project
30
121
  - ✅ **Environment fallback** - Falls back to environment variables
31
122
 
32
- ## What does it do?
123
+ ---
33
124
 
34
- InstaSave SDK allows you to download images from Instagram posts with just a few lines of code. Works with both public and private posts (after login).
125
+ ## Features
35
126
 
36
- ## Installation
127
+ ### What's Supported
128
+ ✅ **Single posts** - One image
129
+ ✅ **Carousel posts** - Multiple images in one post
130
+ ✅ **Private posts** - After login
131
+ ✅ **Auto save** - To JSON file
132
+ ✅ **Error handling** - When something fails
133
+ ✅ **Metadata extraction** - Likes, comments, captions
37
134
 
38
- ```bash
39
- npm install instasave-sdk
40
- ```
135
+ ### Limitations
136
+ **Videos/Reels** - Images only
137
+ ❌ **Stories** - Posts only
138
+
139
+ ---
41
140
 
42
- ## Basic Usage
141
+ ## 🔧 Troubleshooting
43
142
 
44
- ### 1. Download public post
143
+ ### Common Issues
45
144
 
145
+ **"Login required"**
46
146
  ```javascript
47
- import { MediaScraper } from 'instasave-sdk';
147
+ // Solution: Login before downloading
148
+ await scraper.login({ username: 'user', password: 'pass' });
149
+ ```
48
150
 
49
- const scraper = new MediaScraper();
151
+ **"Failed to extract post ID"**
152
+ ```javascript
153
+ // Solution: Check URL - must contain /p/
154
+ // ✅ Correct: https://www.instagram.com/p/ABC123/
155
+ // ❌ Wrong: https://www.instagram.com/username/
156
+ ```
157
+
158
+ **"Timeout"**
159
+ ```javascript
160
+ // Solution: Increase timeout
161
+ const data = await scraper.scrape(url, { timeout: 120 });
162
+ ```
163
+
164
+ ---
165
+
166
+ ## 📋 Requirements
167
+
168
+ - Node.js 16 or newer
169
+ - Internet connection
170
+ - For private posts: valid Instagram account
171
+
172
+ ---
173
+
174
+ ## 📄 License
175
+
176
+ MIT - use anywhere
177
+
178
+ ## 🆘 Support
179
+
180
+ Having issues? Create an [issue on GitHub](https://github.com/nykadamec/instasave-sdk/issues)
50
181
 
51
182
  // Download images from Instagram post
52
183
  const data = await scraper.scrape('https://www.instagram.com/p/ABC123/');
package/README_API.md ADDED
@@ -0,0 +1,241 @@
1
+ # InstaSave SDK - API Reference
2
+
3
+ ## Quick Start
4
+
5
+ ```typescript
6
+ import { MediaScraper } from 'instasave-sdk';
7
+
8
+ const scraper = new MediaScraper();
9
+ const data = await scraper.scrape('https://www.instagram.com/p/ABC123/');
10
+ ```
11
+
12
+ ## Core API
13
+
14
+ ### `MediaScraper`
15
+
16
+ Main class for Instagram scraping operations.
17
+
18
+ #### `scrape(url, options?)`
19
+
20
+ Scrapes Instagram post and returns media data with metadata.
21
+
22
+ **Parameters:**
23
+ - `url: string` - Instagram post URL (must contain `/p/`)
24
+ - `options?: ScrapingOptions` - Optional configuration
25
+
26
+ **Returns:** `Promise<MediaData>`
27
+
28
+ **Example:**
29
+ ```typescript
30
+ const data = await scraper.scrape('https://www.instagram.com/p/ABC123/', {
31
+ saveToFile: true,
32
+ outputPath: './downloads',
33
+ headless: true,
34
+ timeout: 120,
35
+ retries: 2
36
+ });
37
+ ```
38
+
39
+ #### `login(credentials)`
40
+
41
+ Authenticate with Instagram for private posts.
42
+
43
+ **Parameters:**
44
+ - `credentials: LoginCredentials` - Username and password
45
+
46
+ **Example:**
47
+ ```typescript
48
+ await scraper.login({
49
+ username: 'your_username',
50
+ password: 'your_password'
51
+ });
52
+ ```
53
+
54
+ ## Data Types
55
+
56
+ ### `MediaData`
57
+ ```typescript
58
+ interface MediaData {
59
+ url: string; // Original Instagram URL
60
+ post_id: string; // Post ID (e.g., "ABC123")
61
+ platform: string; // Always "instagram"
62
+ profile_name: string; // Profile name
63
+ profile_url: string; // Profile URL
64
+ media: CarouselItem[]; // Array of media items
65
+ metadata: PostMetadata; // Post metadata
66
+ }
67
+ ```
68
+
69
+ ### `CarouselItem`
70
+ ```typescript
71
+ interface CarouselItem {
72
+ url: string; // Direct image URL
73
+ index: number; // Position in carousel (0-based)
74
+ }
75
+ ```
76
+
77
+ ### `PostMetadata`
78
+ ```typescript
79
+ interface PostMetadata {
80
+ likesCount: number | null; // Number of likes
81
+ commentsCount: number | null; // Number of comments
82
+ caption: string | null; // Post caption/description
83
+ timestamp: string | null; // Post creation time (relative format)
84
+ location: string | null; // Location name if available
85
+ }
86
+ ```
87
+
88
+ ### `ScrapingOptions`
89
+ ```typescript
90
+ interface ScrapingOptions {
91
+ saveToFile?: boolean; // Save to JSON file (default: false)
92
+ outputPath?: string; // Output directory (default: current dir)
93
+ timeout?: number; // Timeout in seconds (default: 60)
94
+ retries?: number; // Retry attempts (default: 0)
95
+ headless?: boolean; // Run browser in headless mode (default: true)
96
+ }
97
+ ```
98
+
99
+ ### `LoginCredentials`
100
+ ```typescript
101
+ interface LoginCredentials {
102
+ username: string; // Instagram username
103
+ password: string; // Instagram password
104
+ }
105
+ ```
106
+
107
+ ## Configuration
108
+
109
+ ### Config File (`instasave.config`)
110
+
111
+ ```ini
112
+ [DEFAULT]
113
+ PUPPETEER_EXECUTABLE_PATH = /path/to/chrome
114
+
115
+ [ACCOUNT]
116
+ USERNAME = your_username
117
+ PASSWORD = your_password
118
+
119
+ [SETTINGS]
120
+ OUTPUT_DIR = ./downloads
121
+ HEADLESS = true
122
+ TIMEOUT = 60
123
+ CONSOLE_MODE = Classic
124
+ ```
125
+
126
+ ## Error Handling
127
+
128
+ ```typescript
129
+ try {
130
+ const data = await scraper.scrape(url);
131
+ console.log(`Success: ${data.media.length} images`);
132
+ } catch (error) {
133
+ if (error.message.includes('Login required')) {
134
+ await scraper.login({ username: 'user', password: 'pass' });
135
+ const data = await scraper.scrape(url);
136
+ } else {
137
+ console.error('Scraping failed:', error.message);
138
+ }
139
+ }
140
+ ```
141
+
142
+ ## Examples
143
+
144
+ ### Basic Usage
145
+ ```typescript
146
+ import { MediaScraper } from 'instasave-sdk';
147
+
148
+ const scraper = new MediaScraper();
149
+ const data = await scraper.scrape('https://www.instagram.com/p/ABC123/');
150
+
151
+ console.log(`Post by @${data.profile_name}`);
152
+ console.log(`${data.media.length} images found`);
153
+ console.log(`${data.metadata.likesCount} likes`);
154
+ ```
155
+
156
+ ### With Authentication
157
+ ```typescript
158
+ const scraper = new MediaScraper();
159
+
160
+ await scraper.login({
161
+ username: 'your_username',
162
+ password: 'your_password'
163
+ });
164
+
165
+ const data = await scraper.scrape('https://www.instagram.com/p/private_post/', {
166
+ saveToFile: true,
167
+ outputPath: './downloads'
168
+ });
169
+ ```
170
+
171
+ ### Batch Processing
172
+ ```typescript
173
+ const urls = [
174
+ 'https://www.instagram.com/p/ABC123/',
175
+ 'https://www.instagram.com/p/DEF456/',
176
+ 'https://www.instagram.com/p/GHI789/'
177
+ ];
178
+
179
+ for (const url of urls) {
180
+ try {
181
+ const data = await scraper.scrape(url, {
182
+ saveToFile: true,
183
+ timeout: 90
184
+ });
185
+ console.log(`✅ ${data.post_id}: ${data.media.length} images`);
186
+ } catch (error) {
187
+ console.log(`❌ ${url}: ${error.message}`);
188
+ }
189
+ }
190
+ outputPath?: string; // Output directory path
191
+ headless?: boolean; // Headless mode (default: true)
192
+ timeout?: number; // Timeout in seconds (default: 60)
193
+ retries?: number; // Retry attempts (default: 0)
194
+ }
195
+ ```
196
+
197
+ ## Environment Variables
198
+
199
+ Create `.env` file:
200
+ ```bash
201
+ PUPPETEER_EXECUTABLE_PATH=/path/to/chromium
202
+ HEADLESS=true
203
+ TIMEOUT=120
204
+ RETRIES=0
205
+ ```
206
+
207
+ ## Testing
208
+
209
+ ```bash
210
+ # Unit tests
211
+ npm test
212
+
213
+ # Integration test (real scraping)
214
+ npm run test:integration
215
+
216
+ # Example usage
217
+ node example.js
218
+ ```
219
+
220
+ ## Error Handling
221
+
222
+ ```typescript
223
+ try {
224
+ const data = await scraper.scrapePost(url);
225
+ } catch (error) {
226
+ if (error.message.includes('Invalid Instagram post URL')) {
227
+ // Handle invalid URL
228
+ } else if (error.message.includes('Failed to extract post ID')) {
229
+ // Handle extraction failure
230
+ }
231
+ }
232
+ ```
233
+
234
+ ## Workflow System
235
+
236
+ Plugin uses workflow automation for:
237
+ - Closing cookie modals
238
+ - Closing authentication modals
239
+ - Fallback text-based clicking
240
+
241
+ Workflow configuration: `workflows/instagram.wf`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "instasave-sdk",
3
- "version": "1.1.0",
3
+ "version": "1.1.2",
4
4
  "description": "Instagram image scraper SDK with authentication support",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -25,6 +25,8 @@
25
25
  "files": [
26
26
  "dist/",
27
27
  "README.md",
28
+ "README_API.md",
29
+ "CHANGELOG.md",
28
30
  "LICENSE",
29
31
  "install-browser.js",
30
32
  "instasave.config.example"