-
Notifications
You must be signed in to change notification settings - Fork 10
/
test.js
113 lines (72 loc) · 4.71 KB
/
test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
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
const { iwaTag, iwa, iwaId, iwaIdUrl } = require('instagram-without-api-node');
const _cookie = 'mid=ZDQvkQALAAFaW...a865efce"';
const _userAgent = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36';
const _xIgAppId = '93661...459';
async function fetch() {
// get the latest 12 feeds from a tag (example https://instagram.com/explore/tags/love)
const responseIwaTag = await iwaTag({
group: 'recent', // <!-- "recent" images or "top" images; "recent" is by default
base64images: false, // <!-- optional, but without you will be not able to save images.. it increases the size of the json file
base64imagesCarousel: false, // <!-- optional but not recommended, it increases the size of the json file
base64videos: false, // <!-- optional but not recommended, it increases the size of the json file
headers: {
'cookie': _cookie,
'user-agent': _userAgent,
'x-ig-app-id': _xIgAppId
},
maxImages: 2, // <!-- optional, 12 is the max number
file: "instagram-cache-bytag.json", // <!-- optional, instagram-cache.json is by default
pretty: true, // <!-- optional, prettyfy json true/false
time: 3600, // <!-- optional, reload contents after 3600 seconds by default
id: "love" // <!-- id is required
})
console.log({ responseIwaTag });
// get the latest 12 feeds from an account (example https://www.instagram.com/orsifrancesco/)
const responseIwa = await iwa({
base64images: false, // <!-- optional, but without you will be not able to save images.. it increases the size of the json file
base64imagesCarousel: false, // <!-- optional but not recommended, it increases the size of the json file
base64videos: false, // <!-- optional but not recommended, it increases the size of the json file
headers: {
'cookie': _cookie,
'user-agent': _userAgent,
'x-ig-app-id': _xIgAppId
},
maxImages: 2, // <!-- optional, 12 is the max number
file: "instagram-cache.json", // <!-- optional, instagram-cache.json is by default
pretty: true, // <!-- optional, prettyfy json true/false
time: 3600, // <!-- optional, reload contents after 3600 seconds by default
id: "orsifrancesco" // <!-- id is required
})
console.log({ responseIwa });
// get picture and info from instagram id url (example https://www.instagram.com/p/Cgczi6qMuh1/)
const responseIwaIdUrl = await iwaIdUrl({
base64images: false, // <!-- optional, but without you will be not able to save images.. it increases the size of the json file
base64videos: false, // <!-- optional but not recommended, it increases the size of the json file
headers: {
'cookie': _cookie,
'user-agent': _userAgent,
'x-ig-app-id': _xIgAppId
},
file: "instagram-cache-byidurl.json", // <!-- optional, instagram-cache.json is by default
pretty: true, // <!-- optional, prettyfy json true/false
time: 3600, // <!-- optional, reload contents after 3600 seconds by default
id: "Cgczi6qMuh1" // <!-- id is required
})
console.log({ responseIwaIdUrl });
// get picture and info from instagram id (2890411760684296309 is the id of https://www.instagram.com/p/Cgczi6qMuh1/)
const responseIwaId = await iwaId({
base64images: false, // <!-- optional, but without you will be not able to save images.. it increases the size of the json file
base64videos: false, // <!-- optional but not recommended, it increases the size of the json file
headers: {
'cookie': _cookie,
'user-agent': _userAgent,
'x-ig-app-id': _xIgAppId
},
file: "instagram-cache-byid.json", // <!-- optional, instagram-cache.json is by default
pretty: true, // <!-- optional, prettyfy json true/false
time: 3600, // <!-- optional, reload contents after 3600 seconds by default
id: "2890411760684296309" // <!-- id is required
})
console.log({ responseIwaId });
}
fetch()