@chilfish/gallery-dl-instagram 0.2.0 → 0.2.3
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/dist/dl-ins.mjs +900 -977
- package/dist/index.cjs +180 -2
- package/dist/index.d.cts +87 -64
- package/dist/index.d.mts +87 -64
- package/dist/index.mjs +179 -1
- package/dist/node.cjs +7 -9
- package/dist/node.d.cts +3 -3
- package/dist/node.d.mts +3 -3
- package/dist/node.mjs +7 -9
- package/dist/{sdk-nzhAxf1O.cjs → sdk-D8q2Rjw2.cjs} +557 -523
- package/dist/{sdk-CK9x5wFL.d.mts → sdk-DyZz22bT.d.cts} +7 -4
- package/dist/{sdk-CK9x5wFL.d.cts → sdk-DyZz22bT.d.mts} +7 -4
- package/dist/{sdk-Bn0VCUIT.mjs → sdk-E0L5ISZC.mjs} +507 -521
- package/package.json +3 -10
- package/dist/adapter-CFsiiEpM.cjs +0 -83
- package/dist/adapter-tSleX8Cr.mjs +0 -59
package/dist/index.cjs
CHANGED
|
@@ -1,5 +1,183 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_sdk = require("./sdk-
|
|
2
|
+
const require_sdk = require("./sdk-D8q2Rjw2.cjs");
|
|
3
|
+
//#region src/core/print-job.ts
|
|
4
|
+
var PrintJob = class PrintJob extends require_sdk.Job {
|
|
5
|
+
_currentDir = {};
|
|
6
|
+
_files = [];
|
|
7
|
+
_postCount = 0;
|
|
8
|
+
_fileCount = 0;
|
|
9
|
+
_width;
|
|
10
|
+
constructor(extractor) {
|
|
11
|
+
super(extractor);
|
|
12
|
+
this._width = Math.min(process.stdout.columns ?? 80, 100);
|
|
13
|
+
}
|
|
14
|
+
async handleDirectory(msg) {
|
|
15
|
+
if (this._postCount > 0) this._flushPost();
|
|
16
|
+
this._currentDir = { ...msg.metadata };
|
|
17
|
+
this._postCount++;
|
|
18
|
+
this._files = [];
|
|
19
|
+
}
|
|
20
|
+
async handleUrl(msg) {
|
|
21
|
+
const meta = {
|
|
22
|
+
...this._currentDir,
|
|
23
|
+
...msg.metadata
|
|
24
|
+
};
|
|
25
|
+
this._fileCount++;
|
|
26
|
+
const ext = meta.extension ?? "jpg";
|
|
27
|
+
const mid = meta.media_id ?? "?";
|
|
28
|
+
this._files.push({
|
|
29
|
+
num: meta.num ?? this._files.length + 1,
|
|
30
|
+
filename: `${mid}.${ext}`,
|
|
31
|
+
width: meta.width ?? 0,
|
|
32
|
+
height: meta.height ?? 0,
|
|
33
|
+
videoUrl: meta.video_url ?? null,
|
|
34
|
+
audioUrl: meta.audio_url ?? null,
|
|
35
|
+
audioTitle: meta.audio_title ?? void 0,
|
|
36
|
+
audioArtist: meta.audio_artist ?? void 0,
|
|
37
|
+
audioDuration: meta.audio_duration ?? void 0,
|
|
38
|
+
audioHasLyrics: meta.audio_has_lyrics ?? void 0,
|
|
39
|
+
audioIsExplicit: meta.audio_is_explicit ?? void 0,
|
|
40
|
+
coverArtworkUri: meta.audio_cover_artwork_uri ?? meta.audio_cover_artwork_thumbnail_uri ?? void 0
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
async handleQueue(msg) {
|
|
44
|
+
if (this._files.length > 0 || this._postCount > 0) this._flushPost();
|
|
45
|
+
this._postCount = 0;
|
|
46
|
+
this._files = [];
|
|
47
|
+
const extrClass = {
|
|
48
|
+
...this._currentDir,
|
|
49
|
+
...msg.metadata
|
|
50
|
+
}._extractor;
|
|
51
|
+
if (!extrClass || typeof extrClass !== "object") return;
|
|
52
|
+
const cls = extrClass;
|
|
53
|
+
const match = cls.pattern.exec(msg.url);
|
|
54
|
+
if (!match) return;
|
|
55
|
+
const parentExtr = this.extractor;
|
|
56
|
+
const childJob = new PrintJob(Reflect.construct(cls, [{
|
|
57
|
+
url: msg.url,
|
|
58
|
+
match,
|
|
59
|
+
config: parentExtr.config,
|
|
60
|
+
http: parentExtr.http,
|
|
61
|
+
storage: parentExtr.storage,
|
|
62
|
+
log: parentExtr.log
|
|
63
|
+
}]));
|
|
64
|
+
const childStatus = await childJob.run();
|
|
65
|
+
this.status |= childStatus;
|
|
66
|
+
this._postCount += childJob._postCount;
|
|
67
|
+
this._fileCount += childJob._fileCount;
|
|
68
|
+
}
|
|
69
|
+
_flushPost() {
|
|
70
|
+
const m = this._currentDir;
|
|
71
|
+
if (Object.keys(m).length === 0) return;
|
|
72
|
+
const w = this._width;
|
|
73
|
+
const labelW = 14;
|
|
74
|
+
const shortcode = m.post_shortcode ?? "?";
|
|
75
|
+
const header = ` Post #${this._postCount}: ${shortcode} `;
|
|
76
|
+
const padTotal = w - 2 - header.length;
|
|
77
|
+
const padL = Math.floor(padTotal / 2);
|
|
78
|
+
const padR = padTotal - padL;
|
|
79
|
+
process.stdout.write(`\n${require_sdk.dim("┌")}${"─".repeat(padL)}${require_sdk.b(header)}${"─".repeat(padR)}${require_sdk.dim("┐")}\n`);
|
|
80
|
+
const row = (label, value, color) => {
|
|
81
|
+
const colored = typeof color === "function" ? color(value) : color ? `${color}${value}${require_sdk._RESET}` : value;
|
|
82
|
+
process.stdout.write(` ${require_sdk.dim("│")} ${require_sdk.c(require_sdk.pad(label, labelW))} ${colored}\n`);
|
|
83
|
+
};
|
|
84
|
+
const username = m.username ?? "?";
|
|
85
|
+
const fullname = m.fullname ?? "";
|
|
86
|
+
row("Author:", fullname ? `${username} (${fullname})` : username, require_sdk.g);
|
|
87
|
+
row("Date:", m.date ?? m.post_date ?? "?");
|
|
88
|
+
row("Likes:", `${typeof m.likes === "number" ? m.likes.toLocaleString() : "?"} | Liked: ${m.liked ? "yes" : "no"}`);
|
|
89
|
+
row("Type:", `${m.type ?? "?"} (${this._files.length} files)`);
|
|
90
|
+
row("URL:", m.post_url ?? "?");
|
|
91
|
+
const desc = m.description ?? "";
|
|
92
|
+
if (desc) {
|
|
93
|
+
process.stdout.write(` ${require_sdk.dim("│")}\n`);
|
|
94
|
+
process.stdout.write(` ${require_sdk.dim("│")} ${require_sdk.b("Description:")}\n`);
|
|
95
|
+
for (const line of desc.split("\n")) for (const wl of this._wrap(line, w - 8)) process.stdout.write(` ${require_sdk.dim("│")} ${require_sdk.dim(wl)}\n`);
|
|
96
|
+
}
|
|
97
|
+
const tags = m.tags;
|
|
98
|
+
if (tags && tags.length > 0) {
|
|
99
|
+
process.stdout.write(` ${require_sdk.dim("│")}\n`);
|
|
100
|
+
process.stdout.write(` ${require_sdk.dim("│")} ${require_sdk.b("Tags:")} ${require_sdk.dim(tags.map((t) => `#${t}`).join(" "))}\n`);
|
|
101
|
+
}
|
|
102
|
+
const locName = m.location_slug ?? "";
|
|
103
|
+
const locId = m.location_id ?? "";
|
|
104
|
+
if (locName || locId) row("Location:", locId ? `${locName} (ID: ${locId})` : locName);
|
|
105
|
+
const coauthors = m.coauthors;
|
|
106
|
+
if (coauthors && coauthors.length > 0) row("Co-authors:", coauthors.map((c) => c.full_name ? `${c.username} (${c.full_name})` : c.username).join(", "));
|
|
107
|
+
const pinned = m.pinned;
|
|
108
|
+
if (pinned && pinned.length > 0) row("Pinned:", pinned.join(", "));
|
|
109
|
+
const expires = m.expires;
|
|
110
|
+
if (expires) row("Expires:", expires, require_sdk._YELLOW);
|
|
111
|
+
const hlTitle = m.highlight_title;
|
|
112
|
+
if (hlTitle) row("Highlight:", hlTitle);
|
|
113
|
+
const taggedUser = m.tagged_username ?? "";
|
|
114
|
+
if (taggedUser) {
|
|
115
|
+
const taggedFull = m.tagged_full_name ?? "";
|
|
116
|
+
row("Tagged by:", taggedFull ? `${taggedUser} (${taggedFull})` : taggedUser);
|
|
117
|
+
}
|
|
118
|
+
if (this._files.length > 0) {
|
|
119
|
+
process.stdout.write(` ${require_sdk.dim("│")}\n`);
|
|
120
|
+
process.stdout.write(` ${require_sdk.dim("│")} ${require_sdk.b(`Media (${this._files.length} files):`)}\n`);
|
|
121
|
+
const maxNumW = String(this._files.length).length;
|
|
122
|
+
const maxFileW = Math.max(...this._files.map((f) => f.filename.length));
|
|
123
|
+
const dimW = Math.min(maxFileW, 40);
|
|
124
|
+
for (const f of this._files) {
|
|
125
|
+
const numStr = `[${String(f.num).padStart(maxNumW)}]`;
|
|
126
|
+
const dimStr = f.filename.length > 40 ? `${f.filename.slice(0, 37)}...` : require_sdk.pad(f.filename, dimW);
|
|
127
|
+
const res = f.width ? `${f.width}x${f.height}` : "?x?";
|
|
128
|
+
const badges = [];
|
|
129
|
+
if (f.videoUrl) badges.push("video");
|
|
130
|
+
if (f.audioUrl) badges.push("audio");
|
|
131
|
+
let line = ` ${require_sdk.dim("│")} ${require_sdk.g(numStr)} ${dimStr} ${res}`;
|
|
132
|
+
if (badges.length > 0) line += ` ${require_sdk._YELLOW}(${badges.join("+")})${require_sdk._RESET}`;
|
|
133
|
+
process.stdout.write(`${line}\n`);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
const audioFiles = this._files.filter((f) => f.audioUrl);
|
|
137
|
+
if (audioFiles.length > 0) {
|
|
138
|
+
process.stdout.write(` ${require_sdk.dim("│")}\n`);
|
|
139
|
+
process.stdout.write(` ${require_sdk.dim("│")} ${require_sdk.b("Music:")}\n`);
|
|
140
|
+
for (const af of audioFiles) {
|
|
141
|
+
if (af.audioTitle) {
|
|
142
|
+
const title = af.audioArtist ? `${af.audioTitle} — ${af.audioArtist}` : af.audioTitle;
|
|
143
|
+
process.stdout.write(` ${require_sdk.dim("│")} ${require_sdk.g("♪")} ${title}\n`);
|
|
144
|
+
}
|
|
145
|
+
if (af.audioDuration) {
|
|
146
|
+
const mins = Math.floor(af.audioDuration / 60);
|
|
147
|
+
const secs = Math.round(af.audioDuration % 60);
|
|
148
|
+
const badges = [`${mins}:${String(secs).padStart(2, "0")}`];
|
|
149
|
+
if (af.audioHasLyrics) badges.push("lyrics");
|
|
150
|
+
if (af.audioIsExplicit) badges.push(`${require_sdk._YELLOW}explicit${require_sdk._RESET}`);
|
|
151
|
+
process.stdout.write(` ${require_sdk.dim("│")} ${require_sdk.dim(badges.join(" · "))}\n`);
|
|
152
|
+
}
|
|
153
|
+
if (af.coverArtworkUri) process.stdout.write(` ${require_sdk.dim("│")} ${require_sdk.dim("Art:")} ${require_sdk.dim(`${af.coverArtworkUri.slice(0, 60)}…`)}\n`);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
process.stdout.write(` ${require_sdk.dim("└")}${"─".repeat(w - 2)}${require_sdk.dim("┘")}\n`);
|
|
157
|
+
}
|
|
158
|
+
_wrap(text, maxLen) {
|
|
159
|
+
if (text.length <= maxLen) return [text];
|
|
160
|
+
const lines = [];
|
|
161
|
+
let remaining = text;
|
|
162
|
+
while (remaining.length > maxLen) {
|
|
163
|
+
let cut = maxLen;
|
|
164
|
+
while (cut > 0 && remaining[cut] !== " ") cut--;
|
|
165
|
+
if (cut === 0) cut = maxLen;
|
|
166
|
+
lines.push(remaining.slice(0, cut).trimEnd());
|
|
167
|
+
remaining = remaining.slice(cut).trimStart();
|
|
168
|
+
}
|
|
169
|
+
if (remaining) lines.push(remaining);
|
|
170
|
+
return lines;
|
|
171
|
+
}
|
|
172
|
+
_report() {
|
|
173
|
+
this._flushPost();
|
|
174
|
+
process.stdout.write(`\n${require_sdk.dim("──")} ${require_sdk.b("Summary")} ${require_sdk.dim("───")}\n`);
|
|
175
|
+
process.stdout.write(` Posts: ${require_sdk.g(String(this._postCount))}\n`);
|
|
176
|
+
process.stdout.write(` Files: ${require_sdk.g(String(this._fileCount))}\n`);
|
|
177
|
+
process.stdout.write(`\n`);
|
|
178
|
+
}
|
|
179
|
+
};
|
|
180
|
+
//#endregion
|
|
3
181
|
exports.ConfigManager = require_sdk.ConfigManager;
|
|
4
182
|
exports.DownloadJob = require_sdk.DownloadJob;
|
|
5
183
|
exports.Extractor = require_sdk.Extractor;
|
|
@@ -18,7 +196,7 @@ exports.InstagramTagExtractor = require_sdk.InstagramTagExtractor;
|
|
|
18
196
|
exports.InstagramTaggedExtractor = require_sdk.InstagramTaggedExtractor;
|
|
19
197
|
exports.InstagramUserExtractor = require_sdk.InstagramUserExtractor;
|
|
20
198
|
exports.Job = require_sdk.Job;
|
|
21
|
-
exports.PrintJob =
|
|
199
|
+
exports.PrintJob = PrintJob;
|
|
22
200
|
exports.directory = require_sdk.directory;
|
|
23
201
|
exports.ensureHttpScheme = require_sdk.ensureHttpScheme;
|
|
24
202
|
exports.extr = require_sdk.extr;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,14 +1,11 @@
|
|
|
1
|
-
import { _ as Metadata, a as ExtractorOptions, b as Storage, c as ConfigManager, d as DirectoryMsg, f as ExtractorClass, g as MessageIter, h as Message, i as Extractor, l as Config, m as HttpResponse, n as InstagramSDK, o as Logger, p as HttpClient, r as SDKOptions, s as noopLogger, t as ExtractOptions, u as ConfigValue, v as QueueMsg, x as UrlMsg, y as RequestConfig } from "./sdk-
|
|
1
|
+
import { _ as Metadata, a as ExtractorOptions, b as Storage, c as ConfigManager, d as DirectoryMsg, f as ExtractorClass, g as MessageIter, h as Message, i as Extractor, l as Config, m as HttpResponse, n as InstagramSDK, o as Logger, p as HttpClient, r as SDKOptions, s as noopLogger, t as ExtractOptions, u as ConfigValue, v as QueueMsg, x as UrlMsg, y as RequestConfig } from "./sdk-DyZz22bT.cjs";
|
|
2
2
|
|
|
3
3
|
//#region src/core/job.d.ts
|
|
4
4
|
declare abstract class Job {
|
|
5
5
|
readonly extractor: Extractor;
|
|
6
6
|
status: number;
|
|
7
7
|
constructor(extractor: Extractor);
|
|
8
|
-
/**
|
|
9
|
-
* Main entry point. Calls ``extractor[Symbol.asyncIterator]()`` and
|
|
10
|
-
* dispatches every yielded message.
|
|
11
|
-
*/
|
|
8
|
+
/** Main entry point. Dispatches every yielded message. */
|
|
12
9
|
run(): Promise<number>;
|
|
13
10
|
/** Override in subclasses to print a summary. */
|
|
14
11
|
protected _report(): void;
|
|
@@ -16,7 +13,8 @@ declare abstract class Job {
|
|
|
16
13
|
abstract handleUrl(msg: UrlMsg): Promise<void>;
|
|
17
14
|
abstract handleQueue(msg: QueueMsg): Promise<void>;
|
|
18
15
|
}
|
|
19
|
-
|
|
16
|
+
//#endregion
|
|
17
|
+
//#region src/core/download-job.d.ts
|
|
20
18
|
type ArchiveMap = Map<string, Set<string>>;
|
|
21
19
|
declare class DownloadJob extends Job {
|
|
22
20
|
/** Base output directory (prepended to all paths). */
|
|
@@ -25,32 +23,24 @@ declare class DownloadJob extends Job {
|
|
|
25
23
|
private _currentDir;
|
|
26
24
|
/** In-memory archive keyed by archive format. */
|
|
27
25
|
readonly archive: ArchiveMap;
|
|
28
|
-
/**
|
|
29
|
-
* Registry of per-category "archive formats" — the key is formed
|
|
30
|
-
* by interpolating this format string over the metadata.
|
|
31
|
-
*/
|
|
32
26
|
private readonly _archiveFmts;
|
|
33
27
|
private _postCount;
|
|
34
28
|
private _fileCount;
|
|
35
29
|
private _downloadedBytes;
|
|
36
30
|
private _skippedCount;
|
|
37
31
|
registerArchive(category: string, format: string): void;
|
|
38
|
-
/** Simple format-string interpolation for archive keys. */
|
|
39
32
|
private _interp;
|
|
40
|
-
/** Check whether this URL has already been downloaded (and skip). */
|
|
41
33
|
private _isArchived;
|
|
42
|
-
/** Mark a post/media as archived. */
|
|
43
34
|
private _archive;
|
|
44
|
-
/** Handlers */
|
|
45
35
|
handleDirectory(msg: DirectoryMsg): Promise<void>;
|
|
46
36
|
handleUrl(msg: UrlMsg): Promise<void>;
|
|
47
37
|
handleQueue(msg: QueueMsg): Promise<void>;
|
|
48
|
-
/** Report */
|
|
49
38
|
protected _report(): void;
|
|
50
|
-
/** Path builders */
|
|
51
39
|
private _buildDirPath;
|
|
52
40
|
private _buildFilename;
|
|
53
41
|
}
|
|
42
|
+
//#endregion
|
|
43
|
+
//#region src/core/print-job.d.ts
|
|
54
44
|
declare class PrintJob extends Job {
|
|
55
45
|
private _currentDir;
|
|
56
46
|
private _files;
|
|
@@ -61,7 +51,6 @@ declare class PrintJob extends Job {
|
|
|
61
51
|
handleDirectory(msg: DirectoryMsg): Promise<void>;
|
|
62
52
|
handleUrl(msg: UrlMsg): Promise<void>;
|
|
63
53
|
handleQueue(msg: QueueMsg): Promise<void>;
|
|
64
|
-
/** Output */
|
|
65
54
|
private _flushPost;
|
|
66
55
|
private _wrap;
|
|
67
56
|
protected _report(): void;
|
|
@@ -108,6 +97,7 @@ interface InstagramUser {
|
|
|
108
97
|
count: number;
|
|
109
98
|
};
|
|
110
99
|
followed_by_viewer?: boolean;
|
|
100
|
+
is_verified?: boolean;
|
|
111
101
|
}
|
|
112
102
|
interface ImageCandidate {
|
|
113
103
|
url: string;
|
|
@@ -152,19 +142,25 @@ interface MusicSticker {
|
|
|
152
142
|
interface MusicAssetInfo {
|
|
153
143
|
id: string;
|
|
154
144
|
title?: string;
|
|
145
|
+
sanitized_title?: string;
|
|
146
|
+
subtitle?: string;
|
|
155
147
|
display_artist?: string;
|
|
156
148
|
ig_artist?: string;
|
|
149
|
+
ig_username?: string;
|
|
157
150
|
duration_in_ms?: number;
|
|
158
151
|
highlight_start_times_in_ms?: number[];
|
|
159
152
|
progressive_download_url: string;
|
|
160
153
|
cover_artwork_uri?: string;
|
|
154
|
+
cover_artwork_thumbnail_uri?: string;
|
|
155
|
+
has_lyrics?: boolean;
|
|
156
|
+
is_explicit?: boolean;
|
|
161
157
|
}
|
|
162
158
|
interface MusicConsumptionInfo {
|
|
163
159
|
display_artist?: string;
|
|
164
160
|
ig_artist?: string;
|
|
165
161
|
}
|
|
166
162
|
interface MusicMetadata {
|
|
167
|
-
music_info?:
|
|
163
|
+
music_info?: MusicSticker;
|
|
168
164
|
}
|
|
169
165
|
interface InstagramPost {
|
|
170
166
|
pk: string;
|
|
@@ -285,9 +281,14 @@ interface ParsedMedia {
|
|
|
285
281
|
audio_url?: string;
|
|
286
282
|
audio_user?: string;
|
|
287
283
|
audio_title?: string;
|
|
284
|
+
audio_subtitle?: string;
|
|
288
285
|
audio_artist?: string;
|
|
289
286
|
audio_duration?: number;
|
|
290
287
|
audio_timestamps?: number[];
|
|
288
|
+
audio_cover_artwork_uri?: string;
|
|
289
|
+
audio_cover_artwork_thumbnail_uri?: string;
|
|
290
|
+
audio_has_lyrics?: boolean;
|
|
291
|
+
audio_is_explicit?: boolean;
|
|
291
292
|
_ytdl_manifest_data?: string;
|
|
292
293
|
sidecar_media_id?: string;
|
|
293
294
|
sidecar_shortcode?: string;
|
|
@@ -433,24 +434,48 @@ declare abstract class InstagramExtractor extends Extractor {
|
|
|
433
434
|
protected _assignUser(user: InstagramUser): void;
|
|
434
435
|
}
|
|
435
436
|
//#endregion
|
|
436
|
-
//#region src/instagram/extractors.d.ts
|
|
437
|
-
declare class
|
|
438
|
-
static readonly subcategory = "
|
|
437
|
+
//#region src/instagram/extractors/avatar.d.ts
|
|
438
|
+
declare class InstagramAvatarExtractor extends InstagramExtractor {
|
|
439
|
+
static readonly subcategory = "avatar";
|
|
439
440
|
static pattern: RegExp;
|
|
440
|
-
readonly subcategory = "
|
|
441
|
+
readonly subcategory = "avatar";
|
|
441
442
|
constructor(opts: InstagramExtractorOptions);
|
|
442
|
-
static fromURL(url: string, opts: InstagramExtractorOptions):
|
|
443
|
+
static fromURL(url: string, opts: InstagramExtractorOptions): InstagramAvatarExtractor | null;
|
|
443
444
|
posts(): AsyncGenerator<InstagramPost>;
|
|
444
445
|
}
|
|
445
|
-
|
|
446
|
-
|
|
446
|
+
//#endregion
|
|
447
|
+
//#region src/instagram/extractors/highlights.d.ts
|
|
448
|
+
declare class InstagramHighlightsExtractor extends InstagramExtractor {
|
|
449
|
+
static readonly subcategory = "highlights";
|
|
447
450
|
static pattern: RegExp;
|
|
448
|
-
readonly subcategory = "
|
|
451
|
+
readonly subcategory = "highlights";
|
|
449
452
|
constructor(opts: InstagramExtractorOptions);
|
|
450
|
-
static fromURL(url: string, opts: InstagramExtractorOptions):
|
|
453
|
+
static fromURL(url: string, opts: InstagramExtractorOptions): InstagramHighlightsExtractor | null;
|
|
454
|
+
posts(): AsyncGenerator<InstagramPost>;
|
|
455
|
+
}
|
|
456
|
+
//#endregion
|
|
457
|
+
//#region src/instagram/extractors/info.d.ts
|
|
458
|
+
declare class InstagramInfoExtractor extends InstagramExtractor {
|
|
459
|
+
static readonly subcategory = "info";
|
|
460
|
+
static pattern: RegExp;
|
|
461
|
+
readonly subcategory = "info";
|
|
462
|
+
constructor(opts: InstagramExtractorOptions);
|
|
463
|
+
static fromURL(url: string, opts: InstagramExtractorOptions): InstagramInfoExtractor | null;
|
|
451
464
|
items(): MessageIter;
|
|
452
465
|
posts(): AsyncGenerator<InstagramPost>;
|
|
453
466
|
}
|
|
467
|
+
//#endregion
|
|
468
|
+
//#region src/instagram/extractors/post.d.ts
|
|
469
|
+
declare class InstagramPostExtractor extends InstagramExtractor {
|
|
470
|
+
static readonly subcategory = "post";
|
|
471
|
+
static pattern: RegExp;
|
|
472
|
+
readonly subcategory = "post";
|
|
473
|
+
constructor(opts: InstagramExtractorOptions);
|
|
474
|
+
static fromURL(url: string, opts: InstagramExtractorOptions): InstagramPostExtractor | null;
|
|
475
|
+
posts(): AsyncGenerator<InstagramPost>;
|
|
476
|
+
}
|
|
477
|
+
//#endregion
|
|
478
|
+
//#region src/instagram/extractors/posts-list.d.ts
|
|
454
479
|
declare class InstagramPostsExtractor extends InstagramExtractor {
|
|
455
480
|
static readonly subcategory = "posts";
|
|
456
481
|
static pattern: RegExp;
|
|
@@ -459,6 +484,8 @@ declare class InstagramPostsExtractor extends InstagramExtractor {
|
|
|
459
484
|
static fromURL(url: string, opts: InstagramExtractorOptions): InstagramPostsExtractor | null;
|
|
460
485
|
posts(): AsyncGenerator<InstagramPost>;
|
|
461
486
|
}
|
|
487
|
+
//#endregion
|
|
488
|
+
//#region src/instagram/extractors/reels-list.d.ts
|
|
462
489
|
declare class InstagramReelsExtractor extends InstagramExtractor {
|
|
463
490
|
static readonly subcategory = "reels";
|
|
464
491
|
static pattern: RegExp;
|
|
@@ -467,16 +494,18 @@ declare class InstagramReelsExtractor extends InstagramExtractor {
|
|
|
467
494
|
static fromURL(url: string, opts: InstagramExtractorOptions): InstagramReelsExtractor | null;
|
|
468
495
|
posts(): AsyncGenerator<InstagramPost>;
|
|
469
496
|
}
|
|
470
|
-
|
|
471
|
-
|
|
497
|
+
//#endregion
|
|
498
|
+
//#region src/instagram/extractors/saved.d.ts
|
|
499
|
+
declare class InstagramSavedExtractor extends InstagramExtractor {
|
|
500
|
+
static readonly subcategory = "saved";
|
|
472
501
|
static pattern: RegExp;
|
|
473
|
-
readonly subcategory = "
|
|
474
|
-
private _taggedUserId;
|
|
502
|
+
readonly subcategory = "saved";
|
|
475
503
|
constructor(opts: InstagramExtractorOptions);
|
|
476
|
-
static fromURL(url: string, opts: InstagramExtractorOptions):
|
|
477
|
-
metadata(): Promise<Record<string, unknown>>;
|
|
504
|
+
static fromURL(url: string, opts: InstagramExtractorOptions): InstagramSavedExtractor | null;
|
|
478
505
|
posts(): AsyncGenerator<InstagramPost>;
|
|
479
506
|
}
|
|
507
|
+
//#endregion
|
|
508
|
+
//#region src/instagram/extractors/stories.d.ts
|
|
480
509
|
declare class InstagramStoriesExtractor extends InstagramExtractor {
|
|
481
510
|
static readonly subcategory = "stories";
|
|
482
511
|
static pattern: RegExp;
|
|
@@ -487,14 +516,8 @@ declare class InstagramStoriesExtractor extends InstagramExtractor {
|
|
|
487
516
|
static fromURL(url: string, opts: InstagramExtractorOptions): InstagramStoriesExtractor | null;
|
|
488
517
|
posts(): AsyncGenerator<InstagramPost>;
|
|
489
518
|
}
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
static pattern: RegExp;
|
|
493
|
-
readonly subcategory = "highlights";
|
|
494
|
-
constructor(opts: InstagramExtractorOptions);
|
|
495
|
-
static fromURL(url: string, opts: InstagramExtractorOptions): InstagramHighlightsExtractor | null;
|
|
496
|
-
posts(): AsyncGenerator<InstagramPost>;
|
|
497
|
-
}
|
|
519
|
+
//#endregion
|
|
520
|
+
//#region src/instagram/extractors/tag.d.ts
|
|
498
521
|
declare class InstagramTagExtractor extends InstagramExtractor {
|
|
499
522
|
static readonly subcategory = "tag";
|
|
500
523
|
static pattern: RegExp;
|
|
@@ -504,41 +527,41 @@ declare class InstagramTagExtractor extends InstagramExtractor {
|
|
|
504
527
|
metadata(): Promise<Record<string, unknown>>;
|
|
505
528
|
posts(): AsyncGenerator<InstagramPost>;
|
|
506
529
|
}
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
readonly subcategory = "
|
|
511
|
-
constructor(opts: InstagramExtractorOptions);
|
|
512
|
-
static fromURL(url: string, opts: InstagramExtractorOptions): InstagramInfoExtractor | null;
|
|
513
|
-
items(): MessageIter;
|
|
514
|
-
posts(): AsyncGenerator<InstagramPost>;
|
|
515
|
-
}
|
|
516
|
-
declare class InstagramAvatarExtractor extends InstagramExtractor {
|
|
517
|
-
static readonly subcategory = "avatar";
|
|
530
|
+
//#endregion
|
|
531
|
+
//#region src/instagram/extractors/tagged.d.ts
|
|
532
|
+
declare class InstagramTaggedExtractor extends InstagramExtractor {
|
|
533
|
+
static readonly subcategory = "tagged";
|
|
518
534
|
static pattern: RegExp;
|
|
519
|
-
readonly subcategory = "
|
|
535
|
+
readonly subcategory = "tagged";
|
|
536
|
+
private _taggedUserId;
|
|
520
537
|
constructor(opts: InstagramExtractorOptions);
|
|
521
|
-
static fromURL(url: string, opts: InstagramExtractorOptions):
|
|
538
|
+
static fromURL(url: string, opts: InstagramExtractorOptions): InstagramTaggedExtractor | null;
|
|
539
|
+
metadata(): Promise<Record<string, unknown>>;
|
|
522
540
|
posts(): AsyncGenerator<InstagramPost>;
|
|
523
541
|
}
|
|
524
|
-
|
|
525
|
-
|
|
542
|
+
//#endregion
|
|
543
|
+
//#region src/instagram/extractors/user.d.ts
|
|
544
|
+
declare class InstagramUserExtractor extends InstagramExtractor {
|
|
545
|
+
static readonly subcategory = "user";
|
|
526
546
|
static pattern: RegExp;
|
|
527
|
-
readonly subcategory = "
|
|
547
|
+
readonly subcategory = "user";
|
|
528
548
|
constructor(opts: InstagramExtractorOptions);
|
|
529
|
-
static fromURL(url: string, opts: InstagramExtractorOptions):
|
|
549
|
+
static fromURL(url: string, opts: InstagramExtractorOptions): InstagramUserExtractor | null;
|
|
550
|
+
items(): MessageIter;
|
|
530
551
|
posts(): AsyncGenerator<InstagramPost>;
|
|
531
552
|
}
|
|
532
553
|
//#endregion
|
|
533
|
-
//#region src/instagram/parsers.d.ts
|
|
534
|
-
/**
|
|
554
|
+
//#region src/instagram/parsers/graphql.d.ts
|
|
555
|
+
/** Parse a GraphQL post/edge response. */
|
|
556
|
+
declare function parsePostGraphql(post: Record<string, unknown>, cfg: ParserConfig): ParsedPost;
|
|
557
|
+
//#endregion
|
|
558
|
+
//#region src/instagram/parsers/rest.d.ts
|
|
559
|
+
/** Main entry — parse a REST post response. */
|
|
535
560
|
declare function parsePostRest(post: InstagramPost, cfg: ParserConfig): ParsedPost;
|
|
536
|
-
/**
|
|
561
|
+
/** Extract tagged users from various field formats. */
|
|
537
562
|
declare function extractTaggedUsers(src: Record<string, unknown>, dest: ParsedMedia): void;
|
|
538
|
-
/**
|
|
563
|
+
/** Extract audio/music metadata from a story sticker. */
|
|
539
564
|
declare function extractAudio(src: Record<string, unknown>, dest: Record<string, unknown>, sticker: MusicSticker, cfg: ParserConfig): ParsedMedia | null;
|
|
540
|
-
/** GraphQL parser */
|
|
541
|
-
declare function parsePostGraphql(post: Record<string, unknown>, cfg: ParserConfig): ParsedPost;
|
|
542
565
|
//#endregion
|
|
543
566
|
//#region src/message.d.ts
|
|
544
567
|
declare function directory(metadata?: Metadata): DirectoryMsg;
|