yt-briefing 0.12.1 → 0.12.2

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.
@@ -1,7 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
  /**
3
3
  * Usage: bun src/yt-transcript.ts VIDEO_ID_OR_URL [--lang pl|en|auto]
4
- * Accepts: bare 11-char video ID, youtube.com/watch?v=..., or youtu.be/... URL.
4
+ * Accepts: bare 11-char video ID, youtube.com/watch?v=..., youtu.be/..., or
5
+ * path-based URLs (youtube.com/shorts|embed|live|v/...).
5
6
  * Output: plain text transcript on stdout
6
7
  * Exit 1 if the video genuinely has no subtitles — caller should skip this video.
7
8
  * Exit 2 if YouTube rate-limited / blocked the IP (caller may retry later).
@@ -55,6 +56,10 @@ function extractVideoId(input) {
55
56
  const short = t.match(/youtu\.be\/([A-Za-z0-9_-]{11})/);
56
57
  if (short)
57
58
  return short[1];
59
+ // Path-based forms: youtube.com/shorts/ID, /embed/ID, /live/ID, /v/ID
60
+ const path = t.match(/youtube\.com\/(?:shorts|embed|live|v)\/([A-Za-z0-9_-]{11})/);
61
+ if (path)
62
+ return path[1];
58
63
  if (/^[A-Za-z0-9_-]{11}$/.test(t))
59
64
  return t;
60
65
  console.error(`Invalid VIDEO_ID or YouTube URL: ${input}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yt-briefing",
3
- "version": "0.12.1",
3
+ "version": "0.12.2",
4
4
  "description": "A self-learning YouTube briefing engine: it sweeps the channels you follow, filters noise in two stages (title, then transcript), summarizes the rest in your language, and adapts to your ratings — one video at a time.",
5
5
  "type": "module",
6
6
  "bin": {