@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.
@@ -1,201 +1,62 @@
1
- //#region types.d.ts
2
- /**
3
- * Shared type definitions for the gallery-dl TypeScript port.
4
- *
5
- * Message types form a discriminated union — the `type` tag determines
6
- * which handler a Job should invoke.
7
- */
8
- /** HTTP abstraction */
9
- interface RequestConfig {
10
- headers?: Record<string, string>;
11
- params?: Record<string, string | number | null | undefined>;
12
- method?: string;
13
- data?: unknown;
14
- timeout?: number;
15
- signal?: AbortSignal;
16
- /** WithCredentials / CORS cookie passthrough for browsers */
17
- withCredentials?: boolean;
18
- /** For binary downloads — 'arraybuffer' returns raw bytes */
19
- responseType?: 'arraybuffer' | 'text' | 'json';
20
- }
21
- interface HttpResponse<T = unknown> {
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
+
3
+ //#region src/core/job.d.ts
4
+ declare abstract class Job {
5
+ readonly extractor: Extractor;
22
6
  status: number;
23
- data: T;
24
- headers: Record<string, string>;
25
- /** Final URL after redirects */
26
- url: string;
27
- request?: RequestConfig;
28
- }
29
- interface HttpClient {
30
- request: <T = unknown>(config: {
31
- url: string;
32
- method?: string;
33
- headers?: Record<string, string>;
34
- params?: Record<string, string | number | null | undefined>;
35
- data?: unknown;
36
- signal?: AbortSignal;
37
- timeout?: number;
38
- responseType?: 'arraybuffer' | 'text' | 'json';
39
- }) => Promise<HttpResponse<T>>;
40
- }
41
- /** Storage abstraction */
42
- interface Storage {
43
- exists: (path: string) => Promise<boolean>;
44
- write: (path: string, data: Uint8Array | string) => Promise<void>;
45
- mkdir: (path: string) => Promise<void>;
46
- }
47
- type ConfigValue = string | number | boolean | null | ConfigValue[] | {
48
- [key: string]: ConfigValue;
49
- };
50
- interface Config {
51
- [key: string]: ConfigValue;
52
- }
53
- /** Metadata & messages */
54
- /**
55
- * Flat string-keyed metadata dictionary.
56
- * In gallery-dl every kwdict is a plain `{string → value}` map.
57
- */
58
- type Metadata = Record<string, unknown>;
59
- interface DirectoryMsg {
60
- readonly type: 'directory';
61
- readonly metadata: Metadata;
62
- }
63
- interface UrlMsg {
64
- readonly type: 'url';
65
- readonly url: string;
66
- readonly metadata: Metadata;
67
- }
68
- interface QueueMsg {
69
- readonly type: 'queue';
70
- readonly url: string;
71
- readonly metadata: Metadata & {
72
- readonly _extractor?: ExtractorClass;
73
- };
74
- }
75
- type Message = DirectoryMsg | UrlMsg | QueueMsg;
76
- /**
77
- * Async generator that yields Message values.
78
- */
79
- type MessageIter = AsyncGenerator<Message, void, unknown>;
80
- /** Extractor class reference (for Queue dispatch) */
81
- /**
82
- * Minimal shape that every Extractor class must expose so the Dispatch
83
- * logic can re-instantiate from a URL.
84
- */
85
- interface ExtractorClass {
86
- pattern: RegExp;
87
- subcategory: string;
7
+ constructor(extractor: Extractor);
8
+ /** Main entry point. Dispatches every yielded message. */
9
+ run(): Promise<number>;
10
+ /** Override in subclasses to print a summary. */
11
+ protected _report(): void;
12
+ abstract handleDirectory(msg: DirectoryMsg): Promise<void>;
13
+ abstract handleUrl(msg: UrlMsg): Promise<void>;
14
+ abstract handleQueue(msg: QueueMsg): Promise<void>;
88
15
  }
89
16
  //#endregion
90
- //#region config.d.ts
91
- declare class ConfigManager {
92
- private readonly data;
93
- constructor(data?: Config);
94
- /**
95
- * Read a value at a dot-path like ``'extractor.instagram.videos'``.
96
- * Returns ``undefined`` when the path doesn't exist.
97
- */
98
- get(path: string, defaultValue?: ConfigValue): ConfigValue | undefined;
99
- /**
100
- * Interpolate a config key through a hierarchy of paths.
101
- */
102
- interpolate(cfgPath: readonly string[], key: string, defaultVal?: ConfigValue): ConfigValue | undefined;
103
- /**
104
- * Mutate the config at a given dot-path.
105
- */
106
- set(path: string, value: unknown): void;
17
+ //#region src/core/download-job.d.ts
18
+ type ArchiveMap = Map<string, Set<string>>;
19
+ declare class DownloadJob extends Job {
20
+ /** Base output directory (prepended to all paths). */
21
+ basePath: string;
22
+ /** Current target directory metadata (set by directory messages). */
23
+ private _currentDir;
24
+ /** In-memory archive keyed by archive format. */
25
+ readonly archive: ArchiveMap;
26
+ private readonly _archiveFmts;
27
+ private _postCount;
28
+ private _fileCount;
29
+ private _downloadedBytes;
30
+ private _skippedCount;
31
+ registerArchive(category: string, format: string): void;
32
+ private _interp;
33
+ private _isArchived;
34
+ private _archive;
35
+ handleDirectory(msg: DirectoryMsg): Promise<void>;
36
+ handleUrl(msg: UrlMsg): Promise<void>;
37
+ handleQueue(msg: QueueMsg): Promise<void>;
38
+ protected _report(): void;
39
+ private _buildDirPath;
40
+ private _buildFilename;
107
41
  }
108
42
  //#endregion
109
- //#region core/extractor.d.ts
110
- interface ExtractorOptions {
111
- url: string;
112
- match: RegExpMatchArray;
113
- config: ConfigManager;
114
- http: HttpClient;
115
- storage: Storage;
116
- /** The logger interface — at minimum a debug/info/warn/error contract */
117
- log: Logger;
118
- }
119
- interface Logger {
120
- debug: (message: string, ...args: unknown[]) => void;
121
- info: (message: string, ...args: unknown[]) => void;
122
- warn: (message: string, ...args: unknown[]) => void;
123
- error: (message: string, ...args: unknown[]) => void;
124
- }
125
- /** A no-op logger */
126
- declare const noopLogger: Logger;
127
- declare abstract class Extractor {
128
- /** Human-readable category (e.g. ``'instagram'``) */
129
- abstract readonly category: string;
130
- /** Sub-category (e.g. ``'post'``, ``'posts'``, ``'reels'``) */
131
- abstract readonly subcategory: string;
132
- /** Root URL (e.g. ``'https://www.instagram.com'``) */
133
- abstract readonly root: string;
134
- /** Regex pattern to match against URLs */
135
- static readonly pattern: RegExp;
136
- /** The input URL */
137
- readonly url: string;
138
- /** Regex match groups from ``fromURL`` */
139
- readonly groups: readonly string[];
140
- readonly config: ConfigManager;
141
- /** HTTP client — public so Job can access for downloads */
142
- readonly http: HttpClient;
143
- /** Storage backend — public so Job can access for writes */
144
- readonly storage: Storage;
145
- /** Logger instance — public so Job can access for reporting */
146
- readonly log: Logger;
147
- /** Delay range in seconds — random between [min, max] before each request */
148
- protected requestInterval: [number, number];
149
- private _initialized;
150
- constructor(opts: ExtractorOptions);
151
- /** Initialization */
152
- /**
153
- * One-time async setup (cookies, session, internal state).
154
- * Safe to call multiple times — after the first call it becomes a no-op.
155
- */
156
- initialize(): Promise<void>;
157
- /**
158
- * Subclass hook for one-time setup.
159
- */
160
- protected _init(): Promise<void>;
161
- /** Async iteration */
162
- [Symbol.asyncIterator](): MessageIter;
163
- /**
164
- * The main extraction pipeline. Subclasses *must* implement this.
165
- */
166
- abstract items(): MessageIter;
167
- /** Config helpers */
168
- /**
169
- * Read a config value using the interpolated hierarchy.
170
- */
171
- protected _cfg(key: string, defaultVal?: ConfigValue): ConfigValue | undefined;
172
- /** HTTP */
173
- private _lastRequestTime;
174
- /**
175
- * Rate-limited HTTP request wrapper.
176
- */
177
- request(url: string, cfg?: RequestConfig): Promise<HttpResponse<unknown>>;
178
- /**
179
- * Convenience: request + parse JSON body.
180
- */
181
- requestJSON(url: string, cfg?: RequestConfig): Promise<unknown>;
182
- /** Rate limiting */
183
- /**
184
- * Sleep long enough to keep the minimum interval between requests.
185
- */
186
- private _throttle;
187
- /** Utility */
188
- /**
189
- * Convert a Unix timestamp (seconds or ms) to an ISO-8601 string.
190
- */
191
- parseTimestamp(ts: number | null | undefined): string;
192
- /**
193
- * Generate a random hex token (used for CSRF).
194
- */
195
- static generateToken(size?: number): string;
43
+ //#region src/core/print-job.d.ts
44
+ declare class PrintJob extends Job {
45
+ private _currentDir;
46
+ private _files;
47
+ private _postCount;
48
+ private _fileCount;
49
+ private _width;
50
+ constructor(extractor: Extractor);
51
+ handleDirectory(msg: DirectoryMsg): Promise<void>;
52
+ handleUrl(msg: UrlMsg): Promise<void>;
53
+ handleQueue(msg: QueueMsg): Promise<void>;
54
+ private _flushPost;
55
+ private _wrap;
56
+ protected _report(): void;
196
57
  }
197
58
  //#endregion
198
- //#region instagram/types.d.ts
59
+ //#region src/instagram/types.d.ts
199
60
  /**
200
61
  * Instagram API & parsed-post type definitions.
201
62
  *
@@ -441,7 +302,7 @@ interface ParserConfig {
441
302
  videosDash: boolean;
442
303
  }
443
304
  //#endregion
444
- //#region instagram/api.d.ts
305
+ //#region src/instagram/api.d.ts
445
306
  declare class InstagramRestAPI {
446
307
  private readonly http;
447
308
  private readonly root;
@@ -519,7 +380,7 @@ declare class InstagramRestAPI {
519
380
  private _parseIntCursor;
520
381
  }
521
382
  //#endregion
522
- //#region instagram/base.d.ts
383
+ //#region src/instagram/base.d.ts
523
384
  interface InstagramExtractorOptions extends ExtractorOptions {
524
385
  sessionId?: string;
525
386
  cookies?: Record<string, string>;
@@ -561,24 +422,48 @@ declare abstract class InstagramExtractor extends Extractor {
561
422
  protected _assignUser(user: InstagramUser): void;
562
423
  }
563
424
  //#endregion
564
- //#region instagram/extractors.d.ts
565
- declare class InstagramPostExtractor extends InstagramExtractor {
566
- static readonly subcategory = "post";
425
+ //#region src/instagram/extractors/avatar.d.ts
426
+ declare class InstagramAvatarExtractor extends InstagramExtractor {
427
+ static readonly subcategory = "avatar";
567
428
  static pattern: RegExp;
568
- readonly subcategory = "post";
429
+ readonly subcategory = "avatar";
569
430
  constructor(opts: InstagramExtractorOptions);
570
- static fromURL(url: string, opts: InstagramExtractorOptions): InstagramPostExtractor | null;
431
+ static fromURL(url: string, opts: InstagramExtractorOptions): InstagramAvatarExtractor | null;
571
432
  posts(): AsyncGenerator<InstagramPost>;
572
433
  }
573
- declare class InstagramUserExtractor extends InstagramExtractor {
574
- static readonly subcategory = "user";
434
+ //#endregion
435
+ //#region src/instagram/extractors/highlights.d.ts
436
+ declare class InstagramHighlightsExtractor extends InstagramExtractor {
437
+ static readonly subcategory = "highlights";
575
438
  static pattern: RegExp;
576
- readonly subcategory = "user";
439
+ readonly subcategory = "highlights";
577
440
  constructor(opts: InstagramExtractorOptions);
578
- static fromURL(url: string, opts: InstagramExtractorOptions): InstagramUserExtractor | null;
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;
579
452
  items(): MessageIter;
580
453
  posts(): AsyncGenerator<InstagramPost>;
581
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
582
467
  declare class InstagramPostsExtractor extends InstagramExtractor {
583
468
  static readonly subcategory = "posts";
584
469
  static pattern: RegExp;
@@ -587,6 +472,8 @@ declare class InstagramPostsExtractor extends InstagramExtractor {
587
472
  static fromURL(url: string, opts: InstagramExtractorOptions): InstagramPostsExtractor | null;
588
473
  posts(): AsyncGenerator<InstagramPost>;
589
474
  }
475
+ //#endregion
476
+ //#region src/instagram/extractors/reels-list.d.ts
590
477
  declare class InstagramReelsExtractor extends InstagramExtractor {
591
478
  static readonly subcategory = "reels";
592
479
  static pattern: RegExp;
@@ -595,16 +482,18 @@ declare class InstagramReelsExtractor extends InstagramExtractor {
595
482
  static fromURL(url: string, opts: InstagramExtractorOptions): InstagramReelsExtractor | null;
596
483
  posts(): AsyncGenerator<InstagramPost>;
597
484
  }
598
- declare class InstagramTaggedExtractor extends InstagramExtractor {
599
- static readonly subcategory = "tagged";
485
+ //#endregion
486
+ //#region src/instagram/extractors/saved.d.ts
487
+ declare class InstagramSavedExtractor extends InstagramExtractor {
488
+ static readonly subcategory = "saved";
600
489
  static pattern: RegExp;
601
- readonly subcategory = "tagged";
602
- private _taggedUserId;
490
+ readonly subcategory = "saved";
603
491
  constructor(opts: InstagramExtractorOptions);
604
- static fromURL(url: string, opts: InstagramExtractorOptions): InstagramTaggedExtractor | null;
605
- metadata(): Promise<Record<string, unknown>>;
492
+ static fromURL(url: string, opts: InstagramExtractorOptions): InstagramSavedExtractor | null;
606
493
  posts(): AsyncGenerator<InstagramPost>;
607
494
  }
495
+ //#endregion
496
+ //#region src/instagram/extractors/stories.d.ts
608
497
  declare class InstagramStoriesExtractor extends InstagramExtractor {
609
498
  static readonly subcategory = "stories";
610
499
  static pattern: RegExp;
@@ -615,14 +504,8 @@ declare class InstagramStoriesExtractor extends InstagramExtractor {
615
504
  static fromURL(url: string, opts: InstagramExtractorOptions): InstagramStoriesExtractor | null;
616
505
  posts(): AsyncGenerator<InstagramPost>;
617
506
  }
618
- declare class InstagramHighlightsExtractor extends InstagramExtractor {
619
- static readonly subcategory = "highlights";
620
- static pattern: RegExp;
621
- readonly subcategory = "highlights";
622
- constructor(opts: InstagramExtractorOptions);
623
- static fromURL(url: string, opts: InstagramExtractorOptions): InstagramHighlightsExtractor | null;
624
- posts(): AsyncGenerator<InstagramPost>;
625
- }
507
+ //#endregion
508
+ //#region src/instagram/extractors/tag.d.ts
626
509
  declare class InstagramTagExtractor extends InstagramExtractor {
627
510
  static readonly subcategory = "tag";
628
511
  static pattern: RegExp;
@@ -632,106 +515,103 @@ declare class InstagramTagExtractor extends InstagramExtractor {
632
515
  metadata(): Promise<Record<string, unknown>>;
633
516
  posts(): AsyncGenerator<InstagramPost>;
634
517
  }
635
- declare class InstagramInfoExtractor extends InstagramExtractor {
636
- static readonly subcategory = "info";
637
- static pattern: RegExp;
638
- readonly subcategory = "info";
639
- constructor(opts: InstagramExtractorOptions);
640
- static fromURL(url: string, opts: InstagramExtractorOptions): InstagramInfoExtractor | null;
641
- items(): MessageIter;
642
- posts(): AsyncGenerator<InstagramPost>;
643
- }
644
- declare class InstagramAvatarExtractor extends InstagramExtractor {
645
- static readonly subcategory = "avatar";
518
+ //#endregion
519
+ //#region src/instagram/extractors/tagged.d.ts
520
+ declare class InstagramTaggedExtractor extends InstagramExtractor {
521
+ static readonly subcategory = "tagged";
646
522
  static pattern: RegExp;
647
- readonly subcategory = "avatar";
523
+ readonly subcategory = "tagged";
524
+ private _taggedUserId;
648
525
  constructor(opts: InstagramExtractorOptions);
649
- static fromURL(url: string, opts: InstagramExtractorOptions): InstagramAvatarExtractor | null;
526
+ static fromURL(url: string, opts: InstagramExtractorOptions): InstagramTaggedExtractor | null;
527
+ metadata(): Promise<Record<string, unknown>>;
650
528
  posts(): AsyncGenerator<InstagramPost>;
651
529
  }
652
- declare class InstagramSavedExtractor extends InstagramExtractor {
653
- static readonly subcategory = "saved";
530
+ //#endregion
531
+ //#region src/instagram/extractors/user.d.ts
532
+ declare class InstagramUserExtractor extends InstagramExtractor {
533
+ static readonly subcategory = "user";
654
534
  static pattern: RegExp;
655
- readonly subcategory = "saved";
535
+ readonly subcategory = "user";
656
536
  constructor(opts: InstagramExtractorOptions);
657
- static fromURL(url: string, opts: InstagramExtractorOptions): InstagramSavedExtractor | null;
537
+ static fromURL(url: string, opts: InstagramExtractorOptions): InstagramUserExtractor | null;
538
+ items(): MessageIter;
658
539
  posts(): AsyncGenerator<InstagramPost>;
659
540
  }
660
541
  //#endregion
661
- //#region sdk.d.ts
662
- interface SDKOptions {
663
- /** Custom HttpClient implementation (required). */
664
- http: HttpClient;
665
- /**
666
- * Custom Storage implementation for file output.
667
- * Only needed if you plan to call ``download()``.
668
- */
669
- storage?: Storage;
670
- /** Logger instance. Defaults to a silent no-op logger. */
671
- log?: Logger;
672
- /** Pre-extracted CSRF token (optional). */
673
- csrfToken?: string;
674
- }
675
- interface ExtractOptions {
676
- /** Max posts to extract (for user/tag feeds). */
677
- maxPosts?: number;
678
- /** Download videos (default: true). */
679
- videos?: boolean;
680
- /** Max posts to extract (for user/tag feeds). */
681
- limit?: number;
682
- }
683
- declare class InstagramSDK {
684
- readonly http: HttpClient;
685
- readonly storage: Storage;
686
- readonly log: Logger;
687
- readonly config: ConfigManager;
688
- private readonly _csrfToken;
689
- constructor(opts: {
690
- http: HttpClient;
691
- storage?: Storage;
692
- log?: Logger;
693
- csrfToken?: string;
694
- });
695
- /** High-level API */
696
- /**
697
- * Extract messages from an Instagram URL without downloading.
698
- *
699
- * Returns an async generator yielding Directory / Url / Queue messages.
700
- * Each ``url`` message includes full metadata (post_id, username, dimensions, etc.).
701
- *
702
- * ```ts
703
- * for await (const msg of instagram.extract('https://www.instagram.com/p/.../')) {
704
- * if (msg.type === 'url') {
705
- * console.log(msg.url, msg.metadata.media_id)
706
- * }
707
- * }
708
- * ```
709
- */
710
- extract(url: string): MessageIter;
711
- /**
712
- * Download all media from an Instagram URL.
713
- *
714
- * Uses the built-in DownloadJob + Storage to save files to disk.
715
- * Requires ``storage`` to be set in constructor options.
716
- *
717
- * ```ts
718
- * const stats = await instagram.download(
719
- * 'https://www.instagram.com/p/.../',
720
- * './my-downloads',
721
- * )
722
- * // { posts: 1, files: 9, bytes: 4500000 }
723
- * ```
724
- */
725
- download(url: string, outputDir?: string): Promise<{
726
- posts: number;
727
- files: number;
728
- bytes: number;
729
- }>;
730
- /** Internal */
731
- /**
732
- * Resolve a URL to an Extractor instance via pattern matching.
733
- */
734
- private _resolve;
735
- }
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. */
548
+ declare function parsePostRest(post: InstagramPost, cfg: ParserConfig): ParsedPost;
549
+ /** Extract tagged users from various field formats. */
550
+ declare function extractTaggedUsers(src: Record<string, unknown>, dest: ParsedMedia): void;
551
+ /** Extract audio/music metadata from a story sticker. */
552
+ declare function extractAudio(src: Record<string, unknown>, dest: Record<string, unknown>, sticker: MusicSticker, cfg: ParserConfig): ParsedMedia | null;
553
+ //#endregion
554
+ //#region src/message.d.ts
555
+ declare function directory(metadata?: Metadata): DirectoryMsg;
556
+ declare function url(u: string, metadata?: Metadata): UrlMsg;
557
+ declare function queue(u: string, metadata?: Metadata & {
558
+ _extractor?: ExtractorClass;
559
+ }): QueueMsg;
560
+ //#endregion
561
+ //#region src/utils/id-codec.d.ts
562
+ /**
563
+ * Instagram-style Base64-variant ID ↔ shortcode conversion.
564
+ */
565
+ /**
566
+ * Decode an Instagram shortcode into its numeric post ID.
567
+ */
568
+ declare function idFromShortcode(shortcode: string): string;
569
+ /**
570
+ * Encode a numeric post ID into an Instagram shortcode.
571
+ */
572
+ declare function shortcodeFromId(postId: string | number): string;
573
+ //#endregion
574
+ //#region src/utils/text.d.ts
575
+ /**
576
+ * Text utilities ported from gallery-dl's ``text`` module.
577
+ *
578
+ * All functions are pure and environment-agnostic.
579
+ */
580
+ /** String extraction */
581
+ /**
582
+ * Extract the substring between ``begin`` and ``end`` from ``txt``.
583
+ * Returns the substring or ``null`` if either delimiter is missing.
584
+ */
585
+ declare function extract(txt: string, begin: string, end: string): string | null;
586
+ /**
587
+ * Shorthand: same as ``extract`` but returns ``default_`` on failure.
588
+ * Mirrors the Python ``extr()`` function.
589
+ */
590
+ declare function extr(txt: string, begin: string, end: string, default_?: string): string;
591
+ /** Unicode / HTML */
592
+ /**
593
+ * Decode ``\\uXXXX`` escape sequences in a string.
594
+ */
595
+ declare function parseUnicodeEscapes(text: string): string;
596
+ declare function unescape(text: string): string;
597
+ /** URL helpers */
598
+ /**
599
+ * URL-decode a string.
600
+ */
601
+ declare function unquote(text: string): string;
602
+ /**
603
+ * Ensure a URL starts with ``https://`` (or ``http://``).
604
+ */
605
+ declare function ensureHttpScheme(url: string, scheme?: string): string;
606
+ /**
607
+ * Extract filename + extension from a URL and write into ``meta``.
608
+ */
609
+ declare function nameExtFromURL(url: string, meta: Record<string, unknown>): void;
610
+ /**
611
+ * Parse an integer from a possibly-null value. Returns ``default_`` on failure.
612
+ */
613
+ declare function parseInt(value: string | number | null | undefined, default_?: number): number;
614
+ /** Pre-configured hashtag regex. */
615
+ declare const findTags: (text: string) => string[];
736
616
  //#endregion
737
- export { Extractor as A, HttpResponse as B, InstagramUser as C, ParserConfig as D, ParsedPost as E, Config as F, RequestConfig as G, MessageIter as H, ConfigValue as I, Storage as K, DirectoryMsg as L, Logger as M, noopLogger as N, TaggedUser as O, ConfigManager as P, ExtractorClass as R, InstagramPost as S, ParsedMedia as T, Metadata as U, Message as V, QueueMsg as W, InstagramRestAPI as _, InstagramHighlightsExtractor as a, InstagramCarouselItem as b, InstagramPostsExtractor as c, InstagramStoriesExtractor as d, InstagramTagExtractor as f, InstagramExtractorOptions as g, InstagramExtractor as h, InstagramAvatarExtractor as i, ExtractorOptions as j, VideoVersion as k, InstagramReelsExtractor as l, InstagramUserExtractor as m, InstagramSDK as n, InstagramInfoExtractor as o, InstagramTaggedExtractor as p, UrlMsg as q, SDKOptions as r, InstagramPostExtractor as s, ExtractOptions as t, InstagramSavedExtractor as u, Coauthor as v, MusicSticker as w, InstagramLocation as x, ImageCandidate as y, HttpClient as z };
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 };