From 49b7732e88aeef7f86d483264998dadb11ac65fa Mon Sep 17 00:00:00 2001 From: Sweets Sweetman Date: Sun, 5 Jul 2026 15:31:04 -0500 Subject: [PATCH 1/2] fix(apify): include live streams in YouTube profile scrapes The streamers/youtube-scraper actor takes three per-tab depth knobs; posts was forwarded to maxResults (Videos) and maxResultsShorts (Shorts) but maxResultStreams stayed hardcoded to 0, so the Streams tab never appeared in scrape datasets. Forward posts to it like the other two. Legacy snapshot (posts omitted) still excludes them. Co-Authored-By: Claude Fable 5 --- .../youtube/__tests__/startYoutubeProfileScraping.test.ts | 6 ++++-- lib/apify/youtube/startYoutubeProfileScraping.ts | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/apify/youtube/__tests__/startYoutubeProfileScraping.test.ts b/lib/apify/youtube/__tests__/startYoutubeProfileScraping.test.ts index d14d259b..4d209c17 100644 --- a/lib/apify/youtube/__tests__/startYoutubeProfileScraping.test.ts +++ b/lib/apify/youtube/__tests__/startYoutubeProfileScraping.test.ts @@ -11,7 +11,7 @@ beforeEach(() => { }); describe("startYoutubeProfileScraping", () => { - it("defaults to the legacy snapshot (maxResults: 1, Shorts excluded) when posts is omitted", async () => { + it("defaults to the legacy snapshot (maxResults: 1, Shorts and streams excluded) when posts is omitted", async () => { const r = await startYoutubeProfileScraping("@mycowtf"); expect(apifyClient.actor).toHaveBeenCalledWith("streamers/youtube-scraper"); expect(start).toHaveBeenCalledWith( @@ -19,19 +19,21 @@ describe("startYoutubeProfileScraping", () => { startUrls: [{ url: "https://www.youtube.com/@mycowtf" }], maxResults: 1, maxResultsShorts: 0, + maxResultStreams: 0, }), { webhooks: expect.any(Array) }, ); expect(r).toEqual({ runId: "run-1", datasetId: "ds-1" }); }); - it("passes posts through as maxResults AND maxResultsShorts (Shorts included)", async () => { + it("passes posts through as maxResults, maxResultsShorts AND maxResultStreams (Shorts + streams included)", async () => { await startYoutubeProfileScraping("mycowtf", 20); expect(start).toHaveBeenCalledWith( expect.objectContaining({ startUrls: [{ url: "https://www.youtube.com/@mycowtf" }], maxResults: 20, maxResultsShorts: 20, + maxResultStreams: 20, }), { webhooks: expect.any(Array) }, ); diff --git a/lib/apify/youtube/startYoutubeProfileScraping.ts b/lib/apify/youtube/startYoutubeProfileScraping.ts index a7f222be..fd36af41 100644 --- a/lib/apify/youtube/startYoutubeProfileScraping.ts +++ b/lib/apify/youtube/startYoutubeProfileScraping.ts @@ -39,9 +39,10 @@ const startYoutubeProfileScraping = async ( const input = { ...DEFAULT_INPUT, startUrls: [{ url: targetUrl }], - // The legacy snapshot excludes Shorts; a requested posts depth includes them. + // The legacy snapshot excludes Shorts and streams; a requested posts depth includes both. maxResults: posts ?? DEFAULT_INPUT.maxResults, maxResultsShorts: posts ?? DEFAULT_INPUT.maxResultsShorts, + maxResultStreams: posts ?? DEFAULT_INPUT.maxResultStreams, }; const run = await apifyClient From 3e6e886ca3feb035190b34250c409955de6e4374 Mon Sep 17 00:00:00 2001 From: Sweets Sweetman Date: Sun, 5 Jul 2026 15:36:41 -0500 Subject: [PATCH 2/2] chore: drop legacy note per review (YAGNI) Co-Authored-By: Claude Fable 5 --- lib/apify/youtube/startYoutubeProfileScraping.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/apify/youtube/startYoutubeProfileScraping.ts b/lib/apify/youtube/startYoutubeProfileScraping.ts index fd36af41..3633cffe 100644 --- a/lib/apify/youtube/startYoutubeProfileScraping.ts +++ b/lib/apify/youtube/startYoutubeProfileScraping.ts @@ -39,7 +39,6 @@ const startYoutubeProfileScraping = async ( const input = { ...DEFAULT_INPUT, startUrls: [{ url: targetUrl }], - // The legacy snapshot excludes Shorts and streams; a requested posts depth includes both. maxResults: posts ?? DEFAULT_INPUT.maxResults, maxResultsShorts: posts ?? DEFAULT_INPUT.maxResultsShorts, maxResultStreams: posts ?? DEFAULT_INPUT.maxResultStreams,