commit d09fa0d6d86595cb28ac91e94dccab699def3be8
parent fea7760c169cc60fe90c9738a6e3f6b3aadbbc2e
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date: Wed, 18 Nov 2026 14:50:19 -0500
posts: the Instagram fetcher installs the child-kill guard; the form parser is pinned for an Instagram URL
It stops gallery-dl with a signal, so it imports lib/childKillGuard as every
module of common/ that kills a child does (lib/childKillGuard.test.ts holds
them to it).
Co-Authored-By: Claude <noreply@anthropic.com>
Diffstat:
2 files changed, 26 insertions(+), 0 deletions(-)
diff --git a/common/social/instagramGalleryDlFetcher.ts b/common/social/instagramGalleryDlFetcher.ts
@@ -36,6 +36,9 @@
// (instagramMedia.ts), because they expire.
import { execa } from "execa";
+// A kill on a child that never started signals the caller's own group: the
+// guard is installed by this import (lib/childKillGuard.ts).
+import "../lib/childKillGuard";
import { createInterface } from "node:readline";
import type { Readable } from "node:stream";
import { cookieArgs } from "../lib/cookiePolicy";
diff --git a/editor/app/channels/components/parseChannelForm.test.ts b/editor/app/channels/components/parseChannelForm.test.ts
@@ -480,3 +480,26 @@ test("a stored library round-trips through the Configure form, and a patch sets
applyChannelFormPatch(fd, { xTrendingMaxScrolls: 5, xTrendingMaxPosts: "" });
assert.deepEqual(parseChannelForm(fd).config.xTrending, { maxScrolls: 5 });
});
+
+// An Instagram account (lane instagram): the platform, the kind and the handle
+// come from the URL alone, and the cookie source is the channel's own field.
+test("an instagram.com account URL makes a posts channel with its own cookie source", () => {
+ const { config } = parseChannelForm(
+ form({
+ handling: "transcribe",
+ url: "https://www.instagram.com/example.account/",
+ postFetcher: "instagram-gallery-dl",
+ cookiesFromBrowser: " firefox:instagram-archive ",
+ }),
+ );
+ assert.equal(config.platform, "instagram");
+ assert.equal(config.sourceKind, "social");
+ assert.equal(config.postFetcher, "instagram-gallery-dl");
+ assert.equal(config.socialHandle, "example.account");
+ assert.equal(config.cookiesFromBrowser, "firefox:instagram-archive");
+ // With no fetcher named the channel is still Instagram's, by its URL.
+ const bare = parseChannelForm(form({ handling: "transcribe", url: "https://www.instagram.com/example.account/" })).config;
+ assert.deepEqual([bare.platform, bare.sourceKind, bare.socialHandle], ["instagram", "social", "example.account"]);
+ // A post's URL names no account: refused, never a channel on someone's post.
+ assert.throws(() => parseChannelForm(form({ handling: "transcribe", url: "https://www.instagram.com/p/CabcDEF1234/" })));
+});