@koda-sl/baker-cli 0.199.0 → 0.200.0-dev.0a9adf6f7

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.
package/README.md CHANGED
@@ -2442,15 +2442,16 @@ Get a single video by ID. `--full` includes the auto-generated **transcript** (B
2442
2442
  baker videos get j571abc123 --full --output md
2443
2443
  ```
2444
2444
 
2445
- ### `baker videos upload <file>`
2445
+ ### `baker videos upload <file|url>`
2446
2446
 
2447
- Upload a video file via Mux direct upload.
2447
+ Upload a video. A local path is uploaded directly; an `http(s)` URL is routed to `baker videos ingest`.
2448
2448
 
2449
2449
  ```bash
2450
2450
  baker videos upload ./demo.mp4
2451
2451
  baker videos upload ./demo.mp4 --dry-run
2452
2452
  baker videos upload ./testimonial-maria.mp4 \
2453
2453
  --context "Testimonial from Maria, a real customer, filmed on her phone for the autumn campaign"
2454
+ baker videos upload https://www.youtube.com/watch?v=abc123
2454
2455
  ```
2455
2456
 
2456
2457
  Supported extensions: `.mp4`, `.mov`, `.webm`, `.avi`, `.mkv`
@@ -2468,6 +2469,41 @@ baker videos group --group-key "instagram:Cx7Ab9"
2468
2469
 
2469
2470
  Same lookup as `baker images group` and takes either kind of id; the two exist so the noun you happen to hold does not decide whether you can ask.
2470
2471
 
2472
+ ### `baker videos ingest <url>`
2473
+
2474
+ Add a video to the library from a link — a direct video file, or a page on YouTube, TikTok, Vimeo, or Instagram.
2475
+
2476
+ ```bash
2477
+ baker videos ingest https://cdn.example.com/hero-loop.mp4 # → { videoId, via: "direct" }
2478
+ baker videos ingest https://www.youtube.com/watch?v=abc123 # → { videoId, via: "download" }
2479
+ baker videos ingest https://vimeo.com/12345 --external-id vim:12345
2480
+ ```
2481
+
2482
+ Two routes, chosen from the URL and reported as `via`:
2483
+
2484
+ - **direct** — the URL ends in a video extension, so Baker fetches the file itself. Nothing is downloaded locally and there is no size limit.
2485
+ - **download** — anything else. The video is downloaded locally, stored, and then ingested. Capped at 2 GB.
2486
+
2487
+ A direct URL that Baker cannot fetch retries automatically on the download route and reports `fallbackFrom`. Force the download route with `--download`.
2488
+
2489
+ | Flag | Purpose |
2490
+ |---|---|
2491
+ | `--source` | Provenance: `url` or `youtube`. Inferred from the URL when omitted. |
2492
+ | `--external-id` | Dedupe key — re-running the same link returns the existing video. Derived from the link automatically on the download route. |
2493
+ | `--external-url` | Canonical page URL. Defaults to the input for a page URL. |
2494
+ | `--download` | Skip the direct attempt and always download. |
2495
+ | `--dry-run` | Preview the resolved route and parameters. |
2496
+
2497
+ The download route caps the pull at 1080p — Baker re-encodes for streaming anyway, so fetching a 4K master (what modern YouTube serves by default) only makes the download slower for pixels that get discarded.
2498
+
2499
+ **Blocked downloads climb the egress ladder automatically.** The download route goes through the same **direct → datacenter → residential** ladder as every other outbound read (`@baker/proxy`; see [Operations](../../docs/operations.md) → Egress Proxy). There is no proxy flag on any command and nothing to opt into — the unproxied attempt always runs first, so a paid exit costs nothing until a host actually refuses us, and with no `OXYLABS_*` credentials in the environment this is a single plain download.
2500
+
2501
+ A rung only opens on evidence that *who we are* was the problem — a 403/429/451, a WAF connection reset, or a bot wall like YouTube's "Sign in to confirm you're not a bot". A private video, a deleted one, a 404 or an unsupported URL fails identically from every address on earth, so it stops after one attempt instead of burning a timeout per tier. That decision is `shouldEscalate`'s, shared with the capture engine and the ad-media downloaders; yt-dlp's stderr is only *parsed* into the signal it takes (`src/lib/ytDlpSignal.ts`), never allowed to judge for itself.
2502
+
2503
+ Requires `yt-dlp` on `PATH` (present in the Baker Runtime). Private, age-restricted, or region-locked videos cannot be downloaded — the error carries a `fix` pointing at `baker videos upload <file>`.
2504
+
2505
+ **yt-dlp goes stale, and that looks like a broken video.** Large platforms change their players every few weeks and an out-of-date `yt-dlp` then resolves *no* formats at all, failing with "Requested format is not available" or "Only images are available" rather than anything that names the real cause. The error classifies this case separately and says the link is probably fine. The Runtime image installs `yt-dlp` unpinned at build time (`packages/e2b-template/src/template.ts`), so it ages with the image — if platform ingests start failing across the board, rebuild the template before investigating anything else. Direct file URLs don't depend on `yt-dlp` at all and keep working regardless.
2506
+
2471
2507
  ### `baker videos delete <id>`
2472
2508
 
2473
2509
  Delete a video by ID.