@mattxcz/n8n-nodes-instagram-scraper 0.1.0
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 +22 -0
- package/README.md +68 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +27 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/client.d.ts +15 -0
- package/dist/lib/client.js +231 -0
- package/dist/lib/client.js.map +1 -0
- package/dist/lib/types.d.ts +147 -0
- package/dist/lib/types.js +3 -0
- package/dist/lib/types.js.map +1 -0
- package/dist/lib/utils.d.ts +18 -0
- package/dist/lib/utils.js +78 -0
- package/dist/lib/utils.js.map +1 -0
- package/dist/nodes/Instagram.node.d.ts +5 -0
- package/dist/nodes/Instagram.node.js +232 -0
- package/dist/nodes/Instagram.node.js.map +1 -0
- package/dist/nodes/InstagramCredentials.d.ts +9 -0
- package/dist/nodes/InstagramCredentials.js +44 -0
- package/dist/nodes/InstagramCredentials.js.map +1 -0
- package/dist/nodes/instagram.svg +6 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +81 -0
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Instagram = void 0;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
const client_1 = require("../lib/client");
|
|
6
|
+
class Instagram {
|
|
7
|
+
constructor() {
|
|
8
|
+
this.description = {
|
|
9
|
+
displayName: 'Instagram Scraper',
|
|
10
|
+
name: 'instagram',
|
|
11
|
+
icon: 'file:instagram.svg',
|
|
12
|
+
group: ['transform'],
|
|
13
|
+
version: 1,
|
|
14
|
+
subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
|
|
15
|
+
description: 'Extract Instagram post/reel metadata (title, caption, thumbnail, likes...) using a logged-in session, including 18+ content',
|
|
16
|
+
defaults: {
|
|
17
|
+
name: 'Instagram Scraper',
|
|
18
|
+
},
|
|
19
|
+
inputs: ['main'],
|
|
20
|
+
outputs: ['main'],
|
|
21
|
+
credentials: [
|
|
22
|
+
{
|
|
23
|
+
name: 'instagramApi',
|
|
24
|
+
required: true,
|
|
25
|
+
},
|
|
26
|
+
],
|
|
27
|
+
properties: [
|
|
28
|
+
{
|
|
29
|
+
displayName: 'Resource',
|
|
30
|
+
name: 'resource',
|
|
31
|
+
type: 'options',
|
|
32
|
+
noDataExpression: true,
|
|
33
|
+
options: [
|
|
34
|
+
{ name: 'Post', value: 'post' },
|
|
35
|
+
{ name: 'Media', value: 'media' },
|
|
36
|
+
{ name: 'User', value: 'user' },
|
|
37
|
+
{ name: 'Feed', value: 'feed' },
|
|
38
|
+
],
|
|
39
|
+
default: 'post',
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
displayName: 'Operation',
|
|
43
|
+
name: 'operation',
|
|
44
|
+
type: 'options',
|
|
45
|
+
noDataExpression: true,
|
|
46
|
+
displayOptions: {
|
|
47
|
+
show: {
|
|
48
|
+
resource: ['post'],
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
options: [
|
|
52
|
+
{
|
|
53
|
+
name: 'Get Info by URL',
|
|
54
|
+
value: 'getInfoByUrl',
|
|
55
|
+
description: 'Get title, caption, thumbnail and stats for a post/reel URL',
|
|
56
|
+
action: 'Get info for a post or reel by URL',
|
|
57
|
+
},
|
|
58
|
+
],
|
|
59
|
+
default: 'getInfoByUrl',
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
displayName: 'Post / Reel URL',
|
|
63
|
+
name: 'url',
|
|
64
|
+
type: 'string',
|
|
65
|
+
displayOptions: {
|
|
66
|
+
show: {
|
|
67
|
+
resource: ['post'],
|
|
68
|
+
operation: ['getInfoByUrl'],
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
default: '',
|
|
72
|
+
placeholder: 'https://www.instagram.com/reel/DLwUswhN6Ax/',
|
|
73
|
+
description: 'Full URL of the Instagram post, reel or IGTV video',
|
|
74
|
+
required: true,
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
displayName: 'Operation',
|
|
78
|
+
name: 'operation',
|
|
79
|
+
type: 'options',
|
|
80
|
+
noDataExpression: true,
|
|
81
|
+
displayOptions: {
|
|
82
|
+
show: {
|
|
83
|
+
resource: ['media'],
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
options: [
|
|
87
|
+
{
|
|
88
|
+
name: 'Get Media Info',
|
|
89
|
+
value: 'getMediaInfo',
|
|
90
|
+
description: 'Get detailed information about a media item by its numeric media ID',
|
|
91
|
+
action: 'Get detailed information about a media item',
|
|
92
|
+
},
|
|
93
|
+
],
|
|
94
|
+
default: 'getMediaInfo',
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
displayName: 'Media ID',
|
|
98
|
+
name: 'mediaId',
|
|
99
|
+
type: 'string',
|
|
100
|
+
displayOptions: {
|
|
101
|
+
show: {
|
|
102
|
+
resource: ['media'],
|
|
103
|
+
operation: ['getMediaInfo'],
|
|
104
|
+
},
|
|
105
|
+
},
|
|
106
|
+
default: '',
|
|
107
|
+
description: 'Numeric Instagram media ID (not the shortcode). Use "Post -> Get Info by URL" instead if you only have the post URL.',
|
|
108
|
+
required: true,
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
displayName: 'Operation',
|
|
112
|
+
name: 'operation',
|
|
113
|
+
type: 'options',
|
|
114
|
+
noDataExpression: true,
|
|
115
|
+
displayOptions: {
|
|
116
|
+
show: {
|
|
117
|
+
resource: ['user'],
|
|
118
|
+
},
|
|
119
|
+
},
|
|
120
|
+
options: [
|
|
121
|
+
{
|
|
122
|
+
name: 'Get Profile Info',
|
|
123
|
+
value: 'getUserInfo',
|
|
124
|
+
description: 'Get user profile information',
|
|
125
|
+
action: 'Get user profile information',
|
|
126
|
+
},
|
|
127
|
+
],
|
|
128
|
+
default: 'getUserInfo',
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
displayName: 'Username',
|
|
132
|
+
name: 'username',
|
|
133
|
+
type: 'string',
|
|
134
|
+
displayOptions: {
|
|
135
|
+
show: {
|
|
136
|
+
resource: ['user'],
|
|
137
|
+
operation: ['getUserInfo'],
|
|
138
|
+
},
|
|
139
|
+
},
|
|
140
|
+
default: '',
|
|
141
|
+
description: 'Instagram username (without @)',
|
|
142
|
+
required: true,
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
displayName: 'Operation',
|
|
146
|
+
name: 'operation',
|
|
147
|
+
type: 'options',
|
|
148
|
+
noDataExpression: true,
|
|
149
|
+
displayOptions: {
|
|
150
|
+
show: {
|
|
151
|
+
resource: ['feed'],
|
|
152
|
+
},
|
|
153
|
+
},
|
|
154
|
+
options: [
|
|
155
|
+
{
|
|
156
|
+
name: 'Get Timeline Feed',
|
|
157
|
+
value: 'getTimelineFeed',
|
|
158
|
+
description: 'Get posts from the timeline feed of the logged-in account',
|
|
159
|
+
action: 'Get posts from timeline feed',
|
|
160
|
+
},
|
|
161
|
+
],
|
|
162
|
+
default: 'getTimelineFeed',
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
displayName: 'Max ID',
|
|
166
|
+
name: 'maxId',
|
|
167
|
+
type: 'string',
|
|
168
|
+
displayOptions: {
|
|
169
|
+
show: {
|
|
170
|
+
resource: ['feed'],
|
|
171
|
+
operation: ['getTimelineFeed'],
|
|
172
|
+
},
|
|
173
|
+
},
|
|
174
|
+
default: '',
|
|
175
|
+
description: 'Pagination cursor from a previous call (leave empty for the first page)',
|
|
176
|
+
},
|
|
177
|
+
],
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
async execute() {
|
|
181
|
+
const items = this.getInputData();
|
|
182
|
+
const returnData = [];
|
|
183
|
+
const resource = this.getNodeParameter('resource', 0);
|
|
184
|
+
const operation = this.getNodeParameter('operation', 0);
|
|
185
|
+
const credentials = (await this.getCredentials('instagramApi'));
|
|
186
|
+
const client = new client_1.InstagramClient(credentials);
|
|
187
|
+
try {
|
|
188
|
+
await client.loadSession(credentials.sessionData);
|
|
189
|
+
}
|
|
190
|
+
catch (error) {
|
|
191
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Instagram authentication failed: ${error instanceof Error ? error.message : 'Unknown error'}. Please extract a fresh session and update your credentials.`, { itemIndex: 0 });
|
|
192
|
+
}
|
|
193
|
+
for (let i = 0; i < items.length; i++) {
|
|
194
|
+
try {
|
|
195
|
+
let responseData;
|
|
196
|
+
if (resource === 'post' && operation === 'getInfoByUrl') {
|
|
197
|
+
const url = this.getNodeParameter('url', i);
|
|
198
|
+
responseData = await client.getPostByUrl(url);
|
|
199
|
+
}
|
|
200
|
+
else if (resource === 'media' && operation === 'getMediaInfo') {
|
|
201
|
+
const mediaId = this.getNodeParameter('mediaId', i);
|
|
202
|
+
responseData = await client.getMediaInfo(mediaId);
|
|
203
|
+
}
|
|
204
|
+
else if (resource === 'user' && operation === 'getUserInfo') {
|
|
205
|
+
const username = this.getNodeParameter('username', i);
|
|
206
|
+
responseData = await client.getUserInfo(username);
|
|
207
|
+
}
|
|
208
|
+
else if (resource === 'feed' && operation === 'getTimelineFeed') {
|
|
209
|
+
const maxId = this.getNodeParameter('maxId', i, undefined);
|
|
210
|
+
responseData = await client.getTimelineFeed(maxId || undefined);
|
|
211
|
+
}
|
|
212
|
+
if (responseData === undefined) {
|
|
213
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `The operation "${operation}" is not supported for resource "${resource}"`, { itemIndex: i });
|
|
214
|
+
}
|
|
215
|
+
const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
|
|
216
|
+
returnData.push(...executionData);
|
|
217
|
+
}
|
|
218
|
+
catch (error) {
|
|
219
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
220
|
+
if (this.continueOnFail()) {
|
|
221
|
+
const executionErrorData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray({ error: errorMessage }), { itemData: { item: i } });
|
|
222
|
+
returnData.push(...executionErrorData);
|
|
223
|
+
continue;
|
|
224
|
+
}
|
|
225
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), error, { itemIndex: i });
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
return [returnData];
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
exports.Instagram = Instagram;
|
|
232
|
+
//# sourceMappingURL=Instagram.node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Instagram.node.js","sourceRoot":"","sources":["../../src/nodes/Instagram.node.ts"],"names":[],"mappings":";;;AAAA,+CAMsB;AAGtB,0CAAgD;AAEhD,MAAa,SAAS;IAAtB;QACC,gBAAW,GAAyB;YACnC,WAAW,EAAE,mBAAmB;YAChC,IAAI,EAAE,WAAW;YACjB,IAAI,EAAE,oBAAoB;YAC1B,KAAK,EAAE,CAAC,WAAW,CAAC;YACpB,OAAO,EAAE,CAAC;YACV,QAAQ,EAAE,8DAA8D;YACxE,WAAW,EAAE,6HAA6H;YAC1I,QAAQ,EAAE;gBACT,IAAI,EAAE,mBAAmB;aACzB;YACD,MAAM,EAAE,CAAC,MAAM,CAAC;YAChB,OAAO,EAAE,CAAC,MAAM,CAAC;YACjB,WAAW,EAAE;gBACZ;oBACC,IAAI,EAAE,cAAc;oBACpB,QAAQ,EAAE,IAAI;iBACd;aACD;YACD,UAAU,EAAE;gBACX;oBACC,WAAW,EAAE,UAAU;oBACvB,IAAI,EAAE,UAAU;oBAChB,IAAI,EAAE,SAAS;oBACf,gBAAgB,EAAE,IAAI;oBACtB,OAAO,EAAE;wBACR,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE;wBAC/B,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE;wBACjC,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE;wBAC/B,EAAE,IAAI,EAAE,MAAM,EA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AAe,CAAC,YAAY,CAAC,EAC1C,EAAE,QAAQ,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,EAAE,CACzB,CAAC;gBACF,UAAU,CAAC,IAAI,CAAC,GAAG,aAAa,CAAC,CAAC;YACnC,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBAChB,MAAM,YAAY,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;gBAE5E,IAAI,IAAI,CAAC,cAAc,EAAE,EAAE,CAAC;oBAC3B,MAAM,kBAAkB,GAAG,IAAI,CAAC,OAAO,CAAC,0BAA0B,CACjE,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,EAAE,KAAK,EAAE,YAAY,EAAE,CAAC,EACrD,EAAE,QAAQ,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,EAAE,CACzB,CAAC;oBACF,UAAU,CAAC,IAAI,CAAC,GAAG,kBAAkB,CAAC,CAAC;oBACvC,SAAS;gBACV,CAAC;gBACD,MAAM,IAAI,iCAAkB,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,KAAc,EAAE,EAAE,SAAS,EAAE,CAAC,EAAE,CAAC,CAAC;YAChF,CAAC;QACF,CAAC;QAED,OAAO,CAAC,UAAU,CAAC,CAAC;IACrB,CAAC;CACD;AA3PD,8BA2PC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ICredentialDataDecryptedObject, ICredentialTestRequest, ICredentialType, IHttpRequestOptions, INodeProperties } from 'n8n-workflow';
|
|
2
|
+
export declare class InstagramCredentials implements ICredentialType {
|
|
3
|
+
name: string;
|
|
4
|
+
displayName: string;
|
|
5
|
+
documentationUrl: string;
|
|
6
|
+
properties: INodeProperties[];
|
|
7
|
+
authenticate(credentials: ICredentialDataDecryptedObject, requestOptions: IHttpRequestOptions): Promise<IHttpRequestOptions>;
|
|
8
|
+
test: ICredentialTestRequest;
|
|
9
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.InstagramCredentials = void 0;
|
|
4
|
+
class InstagramCredentials {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.name = 'instagramApi';
|
|
7
|
+
this.displayName = 'Instagram API';
|
|
8
|
+
this.documentationUrl = 'https://github.com/MattXcz/n8n-nodes-instagram-scraper';
|
|
9
|
+
this.properties = [
|
|
10
|
+
{
|
|
11
|
+
displayName: 'Session Data',
|
|
12
|
+
name: 'sessionData',
|
|
13
|
+
type: 'string',
|
|
14
|
+
typeOptions: {
|
|
15
|
+
password: true,
|
|
16
|
+
},
|
|
17
|
+
default: '',
|
|
18
|
+
required: true,
|
|
19
|
+
description: 'Instagram session data as JSON, e.g. {"cookies":[...],"sessionId":"..."}. Extract it from a browser logged into the account you want to use (sessionid + csrftoken cookies), never share it, and use a dedicated account rather than your main one.',
|
|
20
|
+
placeholder: '{"cookies":[...],"sessionId":"..."}',
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
displayName: 'Proxy URL',
|
|
24
|
+
name: 'proxyUrl',
|
|
25
|
+
type: 'string',
|
|
26
|
+
default: '',
|
|
27
|
+
description: 'Optional HTTP proxy URL for requests',
|
|
28
|
+
placeholder: 'http://proxy.example.com:8080',
|
|
29
|
+
},
|
|
30
|
+
];
|
|
31
|
+
this.test = {
|
|
32
|
+
request: {
|
|
33
|
+
baseURL: 'https://www.instagram.com',
|
|
34
|
+
url: '/',
|
|
35
|
+
method: 'GET',
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
async authenticate(credentials, requestOptions) {
|
|
40
|
+
return requestOptions;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
exports.InstagramCredentials = InstagramCredentials;
|
|
44
|
+
//# sourceMappingURL=InstagramCredentials.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InstagramCredentials.js","sourceRoot":"","sources":["../../src/nodes/InstagramCredentials.ts"],"names":[],"mappings":";;;AAQA,MAAa,oBAAoB;IAAjC;QACC,SAAI,GAAG,cAAc,CAAC;QACtB,gBAAW,GAAG,eAAe,CAAC;QAC9B,qBAAgB,GAAG,wDAAwD,CAAC;QAC5E,eAAU,GAAsB;YAC/B;gBACC,WAAW,EAAE,cAAc;gBAC3B,IAAI,EAAE,aAAa;gBACnB,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE;oBACZ,QAAQ,EAAE,IAAI;iBACd;gBACD,OAAO,EAAE,EAAE;gBACX,QAAQ,EAAE,IAAI;gBACd,WAAW,EACV,qPAAqP;gBACtP,WAAW,EAAE,qCAAqC;aAClD;YACD;gBACC,WAAW,EAAE,WAAW;gBACxB,IAAI,EAAE,UAAU;gBAChB,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,EAAE;gBACX,WAAW,EAAE,sCAAsC;gBACnD,WAAW,EAAE,+BAA+B;aAC5C;SACD,CAAC;QASF,SAAI,GAA2B;YAC9B,OAAO,EAAE;gBACR,OAAO,EAAE,2BAA2B;gBACpC,GAAG,EAAE,GAAG;gBACR,MAAM,EAAE,KAAK;aACb;SACD,CAAC;IACH,CAAC;IAdA,KAAK,CAAC,YAAY,CACjB,WAA2C,EAC3C,cAAmC;QAEnC,OAAO,cAAc,CAAC;IACvB,CAAC;CASD;AA1CD,oDA0CC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 60 60" width="60" height="60">
|
|
2
|
+
<rect x="4" y="4" width="52" height="52" rx="14" fill="#8a3ab9"/>
|
|
3
|
+
<rect x="14" y="14" width="32" height="32" rx="9" fill="none" stroke="#ffffff" stroke-width="3.2"/>
|
|
4
|
+
<circle cx="30" cy="30" r="8" fill="none" stroke="#ffffff" stroke-width="3.2"/>
|
|
5
|
+
<circle cx="40" cy="20" r="2.4" fill="#ffffff"/>
|
|
6
|
+
</svg>
|