@chilfish/gallery-dl-instagram 0.1.0 → 0.2.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/dist/index.d.mts CHANGED
@@ -1,14 +1,11 @@
1
- import { A as Extractor, B as HttpResponse, C as InstagramUser, D as ParserConfig, E as ParsedPost, F as Config, G as RequestConfig, H as MessageIter, I as ConfigValue, K as Storage, L as DirectoryMsg, M as Logger, N as noopLogger, O as TaggedUser, P as ConfigManager, R as ExtractorClass, S as InstagramPost, T as ParsedMedia, U as Metadata, V as Message, W as QueueMsg, _ as InstagramRestAPI, a as InstagramHighlightsExtractor, b as InstagramCarouselItem, c as InstagramPostsExtractor, d as InstagramStoriesExtractor, f as InstagramTagExtractor, g as InstagramExtractorOptions, h as InstagramExtractor, i as InstagramAvatarExtractor, j as ExtractorOptions, k as VideoVersion, l as InstagramReelsExtractor, m as InstagramUserExtractor, n as InstagramSDK, o as InstagramInfoExtractor, p as InstagramTaggedExtractor, q as UrlMsg, r as SDKOptions, s as InstagramPostExtractor, t as ExtractOptions, u as InstagramSavedExtractor, v as Coauthor, w as MusicSticker, x as InstagramLocation, y as ImageCandidate, z as HttpClient } from "./sdk-B9fRyc1e.mjs";
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.mjs";
2
2
 
3
- //#region core/job.d.ts
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
- /** An in-memory archive: category → Set<archive-key>. */
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,30 +51,514 @@ 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;
68
57
  }
69
58
  //#endregion
70
- //#region instagram/parsers.d.ts
71
- /** Main entry — REST */
59
+ //#region src/instagram/types.d.ts
60
+ /**
61
+ * Instagram API & parsed-post type definitions.
62
+ *
63
+ * These mirror the actual JSON shapes returned by Instagram's internal API
64
+ * (``/api/v1/…``).
65
+ */
66
+ /** API response types */
67
+ interface InstagramUser {
68
+ pk: string;
69
+ id?: string;
70
+ username: string;
71
+ full_name: string;
72
+ is_private?: boolean;
73
+ profile_pic_url?: string;
74
+ profile_pic_url_hd?: string;
75
+ hd_profile_pic_url_info?: ImageCandidate;
76
+ hd_profile_pic_versions?: ImageCandidate[];
77
+ profile_pic_id?: string;
78
+ edge_owner_to_timeline_media?: {
79
+ count: number;
80
+ };
81
+ edge_felix_video_timeline?: {
82
+ count: number;
83
+ };
84
+ edge_saved_media?: {
85
+ count: number;
86
+ };
87
+ edge_mutual_followed_by?: {
88
+ count: number;
89
+ };
90
+ edge_follow?: {
91
+ count: number;
92
+ };
93
+ edge_followed_by?: {
94
+ count: number;
95
+ };
96
+ edge_media_collections?: {
97
+ count: number;
98
+ };
99
+ followed_by_viewer?: boolean;
100
+ }
101
+ interface ImageCandidate {
102
+ url: string;
103
+ width: number;
104
+ height: number;
105
+ }
106
+ interface VideoVersion {
107
+ url: string;
108
+ width: number;
109
+ height: number;
110
+ type: number;
111
+ }
112
+ interface InstagramLocation {
113
+ pk: string;
114
+ short_name: string;
115
+ }
116
+ interface Caption {
117
+ text: string;
118
+ }
119
+ interface UserTag {
120
+ user: InstagramUser;
121
+ }
122
+ interface ReelMention {
123
+ user: InstagramUser;
124
+ }
125
+ interface BloksSticker {
126
+ bloks_sticker: {
127
+ bloks_sticker_type: string;
128
+ sticker_data: {
129
+ ig_mention: {
130
+ account_id: string;
131
+ username: string;
132
+ full_name: string;
133
+ };
134
+ };
135
+ };
136
+ }
137
+ interface MusicSticker {
138
+ music_asset_info?: MusicAssetInfo;
139
+ music_consumption_info?: MusicConsumptionInfo;
140
+ }
141
+ interface MusicAssetInfo {
142
+ id: string;
143
+ title?: string;
144
+ display_artist?: string;
145
+ ig_artist?: string;
146
+ duration_in_ms?: number;
147
+ highlight_start_times_in_ms?: number[];
148
+ progressive_download_url: string;
149
+ cover_artwork_uri?: string;
150
+ }
151
+ interface MusicConsumptionInfo {
152
+ display_artist?: string;
153
+ ig_artist?: string;
154
+ }
155
+ interface MusicMetadata {
156
+ music_info?: MusicAssetInfo;
157
+ }
158
+ interface InstagramPost {
159
+ pk: string;
160
+ id?: string;
161
+ code: string;
162
+ caption: Caption | null;
163
+ taken_at: number;
164
+ created_at?: number;
165
+ like_count?: number;
166
+ has_liked?: boolean;
167
+ user: InstagramUser;
168
+ carousel_media?: InstagramCarouselItem[];
169
+ image_versions2: {
170
+ candidates: ImageCandidate[];
171
+ };
172
+ video_versions?: VideoVersion[];
173
+ video_dash_manifest?: string;
174
+ original_width?: number;
175
+ original_height?: number;
176
+ media_type?: number;
177
+ original_media_type?: number;
178
+ location?: InstagramLocation;
179
+ coauthor_producers?: InstagramUser[];
180
+ usertags?: {
181
+ in: UserTag[];
182
+ };
183
+ reel_mentions?: ReelMention[];
184
+ story_bloks_stickers?: BloksSticker[];
185
+ story_music_stickers?: MusicSticker[];
186
+ music_metadata?: MusicMetadata;
187
+ expiring_at?: number;
188
+ seen?: number;
189
+ items?: InstagramCarouselItem[];
190
+ timeline_pinned_user_ids?: string[];
191
+ clips_tab_pinned_user_ids?: string[];
192
+ subscription_media_visibility?: string;
193
+ audience?: string;
194
+ title?: string;
195
+ pins?: unknown[];
196
+ }
197
+ interface InstagramCarouselItem {
198
+ pk: string;
199
+ id?: string;
200
+ code?: string;
201
+ taken_at?: number;
202
+ image_versions2: {
203
+ candidates: ImageCandidate[];
204
+ };
205
+ video_versions?: VideoVersion[];
206
+ video_dash_manifest?: string;
207
+ original_width?: number;
208
+ original_height?: number;
209
+ media_type?: number;
210
+ original_media_type?: number;
211
+ owner?: InstagramUser;
212
+ reshared_story_media_author?: InstagramUser;
213
+ expiring_at?: number;
214
+ subscription_media_visibility?: string;
215
+ audience?: string;
216
+ story_music_stickers?: MusicSticker[];
217
+ usertags?: {
218
+ in: UserTag[];
219
+ };
220
+ reel_mentions?: ReelMention[];
221
+ story_bloks_stickers?: BloksSticker[];
222
+ }
223
+ /** Parsed post (normalized output) */
224
+ interface ParsedPost {
225
+ post_id: string;
226
+ post_shortcode: string;
227
+ post_url: string;
228
+ owner_id: string;
229
+ username: string;
230
+ fullname: string;
231
+ post_date: string;
232
+ date: string;
233
+ description: string;
234
+ tags?: string[];
235
+ location_id?: string;
236
+ location_slug?: string;
237
+ location_url?: string;
238
+ likes: number;
239
+ liked: boolean;
240
+ pinned: string[];
241
+ coauthors?: Coauthor[];
242
+ sidecar_media_id?: string;
243
+ sidecar_shortcode?: string;
244
+ type: 'post' | 'reel' | 'story' | 'highlight';
245
+ count: number;
246
+ _files: ParsedMedia[];
247
+ user?: InstagramUser;
248
+ expires?: string;
249
+ highlight_title?: string;
250
+ tagged_owner_id?: string;
251
+ tagged_username?: string;
252
+ tagged_full_name?: string;
253
+ subscription?: string;
254
+ /** For graphql: */
255
+ typename?: string;
256
+ }
257
+ interface ParsedMedia {
258
+ num: number;
259
+ date: string;
260
+ media_id: string;
261
+ shortcode: string;
262
+ display_url: string;
263
+ video_url: string | null;
264
+ width: number;
265
+ width_original: number;
266
+ height: number;
267
+ height_original: number;
268
+ tagged_users: TaggedUser[];
269
+ owner?: InstagramUser;
270
+ author?: InstagramUser;
271
+ expires?: string;
272
+ subscription?: string;
273
+ audience?: string;
274
+ audio_url?: string;
275
+ audio_user?: string;
276
+ audio_title?: string;
277
+ audio_artist?: string;
278
+ audio_duration?: number;
279
+ audio_timestamps?: number[];
280
+ _ytdl_manifest_data?: string;
281
+ sidecar_media_id?: string;
282
+ sidecar_shortcode?: string;
283
+ }
284
+ interface Coauthor {
285
+ id: string;
286
+ username: string;
287
+ full_name?: string;
288
+ }
289
+ interface TaggedUser {
290
+ id: string;
291
+ username: string;
292
+ full_name: string;
293
+ }
294
+ /** Parser config */
295
+ interface ParserConfig {
296
+ root: string;
297
+ findTags: (text: string) => string[];
298
+ parseTimestamp: (ts: number | null | undefined) => string;
299
+ staticVideo: boolean;
300
+ warnVideo: boolean;
301
+ warnImage: number;
302
+ videosDash: boolean;
303
+ }
304
+ //#endregion
305
+ //#region src/instagram/api.d.ts
306
+ declare class InstagramRestAPI {
307
+ private readonly http;
308
+ private readonly root;
309
+ private readonly getCsrf;
310
+ private readonly getWwwClaim;
311
+ private readonly setWwwClaim;
312
+ private readonly setCsrf;
313
+ /** A ref to the extractor's cursor. */
314
+ private getCursor;
315
+ private setCursor;
316
+ constructor(opts: {
317
+ http: HttpClient;
318
+ root: string;
319
+ csrfToken: {
320
+ value: string;
321
+ };
322
+ wwwClaim: {
323
+ value: string;
324
+ };
325
+ cursor: {
326
+ value: string | null;
327
+ };
328
+ });
329
+ /** Public endpoint methods */
330
+ /** Single post by shortcode. */
331
+ media(shortcode: string): AsyncGenerator<InstagramPost>;
332
+ /** Paginated user feed. */
333
+ userFeed(userId: string): AsyncGenerator<InstagramPost>;
334
+ /** Paginated user reels (POST endpoint). */
335
+ userClips(userId: string): AsyncGenerator<InstagramPost>;
336
+ /** Paginated tagged posts. */
337
+ userTagged(userId: string): AsyncGenerator<InstagramPost>;
338
+ /** Paginated saved posts (media wrapper). */
339
+ userSaved(): AsyncGenerator<InstagramPost>;
340
+ /** Paginated collection. */
341
+ userCollection(collectionId: string): AsyncGenerator<InstagramPost>;
342
+ /** Reels media — batch call, returns full reel objects. */
343
+ reelsMedia(reelIds: string[]): Promise<InstagramPost[]>;
344
+ /** Story tray. */
345
+ reelsTray(): Promise<InstagramPost[]>;
346
+ /** Highlights list (tray). */
347
+ highlightsTray(userId: string): Promise<{
348
+ id: string;
349
+ }[]>;
350
+ /** All highlights' media batched by ``chunkSize``. */
351
+ highlightsMedia(userId: string, chunkSize?: number): AsyncGenerator<InstagramPost>;
352
+ /** Hashtag posts (via sections). */
353
+ tagsMedia(tag: string): AsyncGenerator<InstagramPost>;
354
+ private tagsSections;
355
+ /** User by numeric ID. */
356
+ userById(userId: string): Promise<InstagramUser>;
357
+ /** User by username (web_profile_info). */
358
+ userByName(username: string): Promise<InstagramUser>;
359
+ /** Search user by username. */
360
+ userBySearch(username: string): Promise<InstagramUser>;
361
+ /** Scrape user ID from HTML profile page. */
362
+ userByWeb(username: string): Promise<{
363
+ id: string;
364
+ }>;
365
+ /** Resolve screen name via fallback chain: search → info → web. */
366
+ userByScreenName(screenName: string): Promise<InstagramUser>;
367
+ /** Resolve username/id to numeric user ID string. */
368
+ userId(screenName: string, checkPrivate?: boolean): Promise<string>;
369
+ /** Followers (paginated). */
370
+ userFollowers(userId: string): AsyncGenerator<InstagramUser>;
371
+ /** Following (paginated). */
372
+ userFollowing(userId: string): AsyncGenerator<InstagramUser>;
373
+ /** Internal — HTTP call */
374
+ private _call;
375
+ /** Pagination engines */
376
+ private _pagination;
377
+ private _paginationPost;
378
+ private _paginationSections;
379
+ private _paginationFollowing;
380
+ private _parseIntCursor;
381
+ }
382
+ //#endregion
383
+ //#region src/instagram/base.d.ts
384
+ interface InstagramExtractorOptions extends ExtractorOptions {
385
+ sessionId?: string;
386
+ cookies?: Record<string, string>;
387
+ /** Pre-seeded CSRF token (from anonymous session cookie jar). */
388
+ csrfToken?: string;
389
+ }
390
+ declare class Ref<T> {
391
+ value: T;
392
+ constructor(v: T);
393
+ }
394
+ declare abstract class InstagramExtractor extends Extractor {
395
+ readonly category = "instagram";
396
+ readonly root = "https://www.instagram.com";
397
+ api: InstagramRestAPI;
398
+ csrfToken: Ref<string>;
399
+ wwwClaim: Ref<string>;
400
+ cursor: Ref<string | null>;
401
+ protected _loggedIn: boolean;
402
+ protected _user: InstagramUser | null;
403
+ private readonly _findTags;
404
+ private readonly _csrfSeed;
405
+ constructor(opts: InstagramExtractorOptions);
406
+ /** Initialization */
407
+ protected _init(): Promise<void>;
408
+ /** Request override */
409
+ request(url: string, cfg?: RequestConfig): Promise<HttpResponse<unknown>>;
410
+ /** Login */
411
+ login(): Promise<void>;
412
+ /** Core pipeline */
413
+ items(): MessageIter;
414
+ /** Subclass hooks */
415
+ /** @virtual */
416
+ metadata(): Promise<Record<string, unknown>>;
417
+ abstract posts(): AsyncGenerator<InstagramPost>;
418
+ /** Cursor management */
419
+ protected _initCursor(): string | null;
420
+ protected _updateCursor(cursor: string | null): string | null;
421
+ /** User assignment */
422
+ protected _assignUser(user: InstagramUser): void;
423
+ }
424
+ //#endregion
425
+ //#region src/instagram/extractors/avatar.d.ts
426
+ declare class InstagramAvatarExtractor extends InstagramExtractor {
427
+ static readonly subcategory = "avatar";
428
+ static pattern: RegExp;
429
+ readonly subcategory = "avatar";
430
+ constructor(opts: InstagramExtractorOptions);
431
+ static fromURL(url: string, opts: InstagramExtractorOptions): InstagramAvatarExtractor | null;
432
+ posts(): AsyncGenerator<InstagramPost>;
433
+ }
434
+ //#endregion
435
+ //#region src/instagram/extractors/highlights.d.ts
436
+ declare class InstagramHighlightsExtractor extends InstagramExtractor {
437
+ static readonly subcategory = "highlights";
438
+ static pattern: RegExp;
439
+ readonly subcategory = "highlights";
440
+ constructor(opts: InstagramExtractorOptions);
441
+ static fromURL(url: string, opts: InstagramExtractorOptions): InstagramHighlightsExtractor | null;
442
+ posts(): AsyncGenerator<InstagramPost>;
443
+ }
444
+ //#endregion
445
+ //#region src/instagram/extractors/info.d.ts
446
+ declare class InstagramInfoExtractor extends InstagramExtractor {
447
+ static readonly subcategory = "info";
448
+ static pattern: RegExp;
449
+ readonly subcategory = "info";
450
+ constructor(opts: InstagramExtractorOptions);
451
+ static fromURL(url: string, opts: InstagramExtractorOptions): InstagramInfoExtractor | null;
452
+ items(): MessageIter;
453
+ posts(): AsyncGenerator<InstagramPost>;
454
+ }
455
+ //#endregion
456
+ //#region src/instagram/extractors/post.d.ts
457
+ declare class InstagramPostExtractor extends InstagramExtractor {
458
+ static readonly subcategory = "post";
459
+ static pattern: RegExp;
460
+ readonly subcategory = "post";
461
+ constructor(opts: InstagramExtractorOptions);
462
+ static fromURL(url: string, opts: InstagramExtractorOptions): InstagramPostExtractor | null;
463
+ posts(): AsyncGenerator<InstagramPost>;
464
+ }
465
+ //#endregion
466
+ //#region src/instagram/extractors/posts-list.d.ts
467
+ declare class InstagramPostsExtractor extends InstagramExtractor {
468
+ static readonly subcategory = "posts";
469
+ static pattern: RegExp;
470
+ readonly subcategory = "posts";
471
+ constructor(opts: InstagramExtractorOptions);
472
+ static fromURL(url: string, opts: InstagramExtractorOptions): InstagramPostsExtractor | null;
473
+ posts(): AsyncGenerator<InstagramPost>;
474
+ }
475
+ //#endregion
476
+ //#region src/instagram/extractors/reels-list.d.ts
477
+ declare class InstagramReelsExtractor extends InstagramExtractor {
478
+ static readonly subcategory = "reels";
479
+ static pattern: RegExp;
480
+ readonly subcategory = "reels";
481
+ constructor(opts: InstagramExtractorOptions);
482
+ static fromURL(url: string, opts: InstagramExtractorOptions): InstagramReelsExtractor | null;
483
+ posts(): AsyncGenerator<InstagramPost>;
484
+ }
485
+ //#endregion
486
+ //#region src/instagram/extractors/saved.d.ts
487
+ declare class InstagramSavedExtractor extends InstagramExtractor {
488
+ static readonly subcategory = "saved";
489
+ static pattern: RegExp;
490
+ readonly subcategory = "saved";
491
+ constructor(opts: InstagramExtractorOptions);
492
+ static fromURL(url: string, opts: InstagramExtractorOptions): InstagramSavedExtractor | null;
493
+ posts(): AsyncGenerator<InstagramPost>;
494
+ }
495
+ //#endregion
496
+ //#region src/instagram/extractors/stories.d.ts
497
+ declare class InstagramStoriesExtractor extends InstagramExtractor {
498
+ static readonly subcategory = "stories";
499
+ static pattern: RegExp;
500
+ readonly subcategory = "stories";
501
+ private highlightId;
502
+ private mediaId;
503
+ constructor(opts: InstagramExtractorOptions);
504
+ static fromURL(url: string, opts: InstagramExtractorOptions): InstagramStoriesExtractor | null;
505
+ posts(): AsyncGenerator<InstagramPost>;
506
+ }
507
+ //#endregion
508
+ //#region src/instagram/extractors/tag.d.ts
509
+ declare class InstagramTagExtractor extends InstagramExtractor {
510
+ static readonly subcategory = "tag";
511
+ static pattern: RegExp;
512
+ readonly subcategory = "tag";
513
+ constructor(opts: InstagramExtractorOptions);
514
+ static fromURL(url: string, opts: InstagramExtractorOptions): InstagramTagExtractor | null;
515
+ metadata(): Promise<Record<string, unknown>>;
516
+ posts(): AsyncGenerator<InstagramPost>;
517
+ }
518
+ //#endregion
519
+ //#region src/instagram/extractors/tagged.d.ts
520
+ declare class InstagramTaggedExtractor extends InstagramExtractor {
521
+ static readonly subcategory = "tagged";
522
+ static pattern: RegExp;
523
+ readonly subcategory = "tagged";
524
+ private _taggedUserId;
525
+ constructor(opts: InstagramExtractorOptions);
526
+ static fromURL(url: string, opts: InstagramExtractorOptions): InstagramTaggedExtractor | null;
527
+ metadata(): Promise<Record<string, unknown>>;
528
+ posts(): AsyncGenerator<InstagramPost>;
529
+ }
530
+ //#endregion
531
+ //#region src/instagram/extractors/user.d.ts
532
+ declare class InstagramUserExtractor extends InstagramExtractor {
533
+ static readonly subcategory = "user";
534
+ static pattern: RegExp;
535
+ readonly subcategory = "user";
536
+ constructor(opts: InstagramExtractorOptions);
537
+ static fromURL(url: string, opts: InstagramExtractorOptions): InstagramUserExtractor | null;
538
+ items(): MessageIter;
539
+ posts(): AsyncGenerator<InstagramPost>;
540
+ }
541
+ //#endregion
542
+ //#region src/instagram/parsers/graphql.d.ts
543
+ /** Parse a GraphQL post/edge response. */
544
+ declare function parsePostGraphql(post: Record<string, unknown>, cfg: ParserConfig): ParsedPost;
545
+ //#endregion
546
+ //#region src/instagram/parsers/rest.d.ts
547
+ /** Main entry — parse a REST post response. */
72
548
  declare function parsePostRest(post: InstagramPost, cfg: ParserConfig): ParsedPost;
73
- /** Tagged users */
549
+ /** Extract tagged users from various field formats. */
74
550
  declare function extractTaggedUsers(src: Record<string, unknown>, dest: ParsedMedia): void;
75
- /** Audio / music extraction */
551
+ /** Extract audio/music metadata from a story sticker. */
76
552
  declare function extractAudio(src: Record<string, unknown>, dest: Record<string, unknown>, sticker: MusicSticker, cfg: ParserConfig): ParsedMedia | null;
77
- /** GraphQL parser */
78
- declare function parsePostGraphql(post: Record<string, unknown>, cfg: ParserConfig): ParsedPost;
79
553
  //#endregion
80
- //#region message.d.ts
554
+ //#region src/message.d.ts
81
555
  declare function directory(metadata?: Metadata): DirectoryMsg;
82
556
  declare function url(u: string, metadata?: Metadata): UrlMsg;
83
557
  declare function queue(u: string, metadata?: Metadata & {
84
558
  _extractor?: ExtractorClass;
85
559
  }): QueueMsg;
86
560
  //#endregion
87
- //#region utils/id-codec.d.ts
561
+ //#region src/utils/id-codec.d.ts
88
562
  /**
89
563
  * Instagram-style Base64-variant ID ↔ shortcode conversion.
90
564
  */
@@ -97,7 +571,7 @@ declare function idFromShortcode(shortcode: string): string;
97
571
  */
98
572
  declare function shortcodeFromId(postId: string | number): string;
99
573
  //#endregion
100
- //#region utils/text.d.ts
574
+ //#region src/utils/text.d.ts
101
575
  /**
102
576
  * Text utilities ported from gallery-dl's ``text`` module.
103
577
  *
@@ -140,48 +614,4 @@ declare function parseInt(value: string | number | null | undefined, default_?:
140
614
  /** Pre-configured hashtag regex. */
141
615
  declare const findTags: (text: string) => string[];
142
616
  //#endregion
143
- //#region index.d.ts
144
- /** Options for the Node.js convenience factory. */
145
- interface CreateSDKOptions {
146
- /**
147
- * Full browser Cookie header string.
148
- * Copy from DevTools → Network → Request Headers → Cookie.
149
- * Auto-extracts csrftoken for X-CSRFToken header.
150
- *
151
- * Either ``cookies`` or ``http`` must be provided.
152
- */
153
- cookies?: string;
154
- /**
155
- * Custom HttpClient implementation.
156
- * If omitted, a Node.js axios-based client is created from ``cookies``.
157
- */
158
- http?: HttpClient;
159
- /**
160
- * Custom Storage implementation for file output.
161
- * Defaults to Node.js fs/promises-based storage.
162
- */
163
- storage?: Storage;
164
- /**
165
- * Logger instance. Defaults to a silent no-op logger.
166
- */
167
- log?: Logger;
168
- }
169
- /**
170
- * Create an SDK instance with Node.js defaults.
171
- *
172
- * When ``cookies`` is provided, auto-creates an axios-based HttpClient
173
- * with CSRF token extraction. Pass ``http`` directly for custom adapters.
174
- *
175
- * ```ts
176
- * import { createSDK } from '@chilfish/gallery-dl-instagram'
177
- *
178
- * // Node.js with cookies
179
- * const ig = await createSDK({ cookies: 'ds_user_id=...; sessionid=...' })
180
- *
181
- * // Custom http adapter (browser / Deno / Edge)
182
- * const ig = await createSDK({ http: myHttpClient, storage: myStorage })
183
- * ```
184
- */
185
- declare function createSDK(opts?: CreateSDKOptions): Promise<InstagramSDK>;
186
- //#endregion
187
- export { type Coauthor, type Config, ConfigManager, type ConfigValue, CreateSDKOptions, type DirectoryMsg, DownloadJob, type ExtractOptions, Extractor, type ExtractorClass, type ExtractorOptions, type HttpClient, type HttpResponse, type ImageCandidate, InstagramAvatarExtractor, type InstagramCarouselItem, InstagramExtractor, type InstagramExtractorOptions, InstagramHighlightsExtractor, InstagramInfoExtractor, type InstagramLocation, type InstagramPost, InstagramPostExtractor, InstagramPostsExtractor, InstagramReelsExtractor, InstagramRestAPI, InstagramSDK, InstagramSavedExtractor, InstagramStoriesExtractor, InstagramTagExtractor, InstagramTaggedExtractor, type InstagramUser, InstagramUserExtractor, Job, type Logger, type Message, type MessageIter, type Metadata, type ParsedMedia, type ParsedPost, type ParserConfig, PrintJob, type QueueMsg, type RequestConfig, type SDKOptions, type Storage, type TaggedUser, type UrlMsg, type VideoVersion, createSDK, directory, ensureHttpScheme, extr, extract, extractAudio, extractTaggedUsers, findTags, idFromShortcode, nameExtFromURL, noopLogger, parseInt, parsePostGraphql, parsePostRest, parseUnicodeEscapes, queue, shortcodeFromId, unescape, unquote, url };
617
+ export { type Coauthor, type Config, ConfigManager, type ConfigValue, type DirectoryMsg, DownloadJob, type ExtractOptions, Extractor, type ExtractorClass, type ExtractorOptions, type HttpClient, type HttpResponse, type ImageCandidate, InstagramAvatarExtractor, type InstagramCarouselItem, InstagramExtractor, type InstagramExtractorOptions, InstagramHighlightsExtractor, InstagramInfoExtractor, type InstagramLocation, type InstagramPost, InstagramPostExtractor, InstagramPostsExtractor, InstagramReelsExtractor, InstagramRestAPI, InstagramSDK, InstagramSavedExtractor, InstagramStoriesExtractor, InstagramTagExtractor, InstagramTaggedExtractor, type InstagramUser, InstagramUserExtractor, Job, type Logger, type Message, type MessageIter, type Metadata, type ParsedMedia, type ParsedPost, type ParserConfig, PrintJob, type QueueMsg, type RequestConfig, type SDKOptions, type Storage, type TaggedUser, type UrlMsg, type VideoVersion, directory, ensureHttpScheme, extr, extract, extractAudio, extractTaggedUsers, findTags, idFromShortcode, nameExtFromURL, noopLogger, parseInt, parsePostGraphql, parsePostRest, parseUnicodeEscapes, queue, shortcodeFromId, unescape, unquote, url };