Skip to content

README: skip error rows in the explore and podcast examples - #2

Open
anil-bd wants to merge 1 commit into
mainfrom
fix/readme-explore-error-rows
Open

anil-bd wants to merge 1 commit into
mainfrom
fix/readme-explore-error-rows

Conversation

@anil-bd

@anil-bd anil-bd commented Nov 24, 2026

Copy link
Copy Markdown
Collaborator

Problem

The weekly live check failed on block 12, "Scrape the YouTube explore and gaming pages":

TypeError: Cannot read properties of undefined (reading 'slice')

explore() returns raw rows. When a discovery reaches limit, crawls still running come back as error rows (Crawl aborted on job cancel, see CANCELLED in src/scrape.js) with no title. The example called video.title.slice on every row, so it crashed. The podcast example (block 11) has the same gap and passed this week only because no error row came back.

Fix

Both examples now skip error rows with the same if (video.error) { ...; continue; } guard the search, hashtag and channel-videos examples already use. No library code changes.

Verified

Ran both README blocks against a stubbed API returning one record plus one Crawl aborted on job cancel row:

  • Before: both fail with the CI error above.
  • After: both print the record and log error row: Crawl aborted on job cancel.
  • npm run lint clean, npm test 18/18 pass.

The next Monday live check runs the blocks against the real API.

🤖 Generated with Claude Code

The weekly live check failed on block 12: explore() returned a cancelled-crawl
error row (no title) once the discovery hit limit, and the example called
video.title.slice on it. The podcast example had the same gap. Both now skip
error rows the way the search, hashtag and channel-videos examples already do.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant