Skip to content

Offer Upload the file when a link's video cannot be downloaded - #441

Merged
dillonstreator merged 1 commit into
mainfrom
claude/yt-dlp-age-restricted-248f98
Dec 2, 2026
Merged

dillonstreator merged 1 commit into
mainfrom
claude/yt-dlp-age-restricted-248f98

Conversation

@dillonstreator

Copy link
Copy Markdown
Member

What changed

When a project's link can't be downloaded (blocked, age-restricted, private, removed, a live stream), the project page now leads with Upload the file. The button opens New project on the Upload tab with the project's title filled in (/new?source=upload&title=…). Retry becomes the second button, and the note under the error says what each choice does. For failures where the same video would fail the same way again (cause: input), the note says so.

The same information is available outside the web UI:

  • API: projects carry failure: { cause, uploadInstead }, which is null unless the project failed.
  • MCP: get_project, list_projects and wait_for_project return that field. get_project and wait_for_project also add a hint to upload the file and pass the uploadId to create_project.
  • CLI: reelsaw status prints the same advice.

Bug fixed

describeDownloadFailure chose "age-restricted" by matching /age/i against all of yt-dlp's output, and "webpage" matches. So a refused page (Unable to download webpage: HTTP Error 403, a bot block) was reported to users as age-restricted.

  • The reason now comes from yt-dlp's last ERROR: line, the one it actually gave up on.
  • Age checks have their own pattern (AGE_GATE, isAgeRestricted).
  • BOT_CHECK no longer matches "Sign in to confirm your age".
  • The proxy pool classifies age checks as content, so it stops instead of walking every exit.

Caught before the project is created

When Reelsaw looks up a link's length (for accounts with a minutes limit, or when clipping ranges), an age-restricted, private or removed video is now refused by check_source and at creation, with the same sentence as the download would give. This reuses the live-stream path: LiveSourceError now extends a new UnusableSourceError.

Notes for review

  • uploadAvoids recognises a download failure from the stored error text. Every download failure now starts with one prefix ("Could not download"). Rows from before this change ("Download failed:") and the live-stream message are also recognised. Tests check that every describeDownloadFailure result matches.
  • The stall message now uses that prefix, so a project whose download kept stalling also offers Upload.
  • The tool-list size budget had almost no room left, so the explanation of failure goes in the tool results as a hint rather than in the get_project description.
  • Docs: a new "Age-restricted videos" section in TROUBLESHOOTING.md (cookies setup) and a longer YTDLP_COOKIES_FILE description in CONFIG.md and both .env.example files. The README line is updated.

Testing

  • New unit tests for the age check, how each failure reason is chosen, and uploadAvoids. The yt-dlp, ingest, peek and MCP definition tests pass.
  • Server and web typecheck pass, as do pnpm lint, pnpm guards, docs:check and i18n:check.
  • Checked in a locally deployed build using the failed scenario plus an age-restricted variant: the banner at desktop and phone widths, the Upload deep link, and the failure field from projects.get.

A failed download only said "New project → Upload" in text, and Retry was the
only action, though it cannot get past an age-restricted, private or removed
video. The age-restricted reason was also picked by matching "age" anywhere in
yt-dlp's output, so a refused page ("Unable to download webpage: HTTP Error
403") was reported as age-restricted.

- ytdlp-errors: AGE_GATE / isAgeRestricted read from the fatal line; the bot
  check no longer matches "Sign in to confirm your age".
- ingest: describeDownloadFailure picks the reason from the fatal line; every
  download failure starts with one prefix, and uploadAvoids reads it back.
- projects: failure { cause, uploadInstead } on the project; the length lookup
  refuses age-restricted, private or removed videos up front (UnusableSourceError,
  which LiveSourceError now extends).
- web: the failure banner leads with Upload the file (/new?source=upload&title=)
  and explains what Retry does; NewProject honours the new parameters.
- MCP and CLI: failure field and an upload hint; docs for YTDLP_COOKIES_FILE.

Signed-off-by: dillonstreator <dillonstreator@gmail.com>
@vercel

vercel Bot commented Dec 2, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
reelsaw-website Ready Ready Preview Dec 2, 2026 10:11pm UTC

Request Review

@dillonstreator
dillonstreator merged commit 3158192 into main Dec 2, 2026
17 checks passed
@dillonstreator dillonstreator mentioned this pull request Dec 2, 2026
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