extract-youtube 1.0.293 → 1.0.295
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 +7 -2
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/react/YouTubeTranscriptModal.d.ts +4 -3
- package/dist/react/YouTubeTranscriptModal.d.ts.map +1 -1
- package/dist/react/index.cjs +1 -1
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.d.ts +1 -0
- package/dist/react/index.d.ts.map +1 -1
- package/dist/react/index.mjs +15 -15
- package/dist/react/index.mjs.map +1 -1
- package/dist/react/player/FloatingYouTubePlayer.d.ts +6 -2
- package/dist/react/player/FloatingYouTubePlayer.d.ts.map +1 -1
- package/dist/react/player/PlayerSubtitles.d.ts +14 -7
- package/dist/react/player/PlayerSubtitles.d.ts.map +1 -1
- package/dist/react/player/styles.d.ts +1 -1
- package/dist/react/player/styles.d.ts.map +1 -1
- package/dist/react/sentences.d.ts +34 -0
- package/dist/react/sentences.d.ts.map +1 -0
- package/dist/react/transcript.d.ts +2 -5
- package/dist/react/transcript.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/react/YouTubeTranscriptModal.tsx +54 -55
- package/src/react/index.ts +2 -0
- package/src/react/player/FloatingYouTubePlayer.tsx +23 -11
- package/src/react/player/PlayerSubtitles.tsx +25 -40
- package/src/react/player/styles.ts +2 -7
- package/src/react/sentences.ts +89 -0
- package/src/react/transcript.ts +6 -5
package/README.md
CHANGED
|
@@ -181,6 +181,11 @@ const api = new YouTubeTranscriptApi({
|
|
|
181
181
|
});
|
|
182
182
|
```
|
|
183
183
|
|
|
184
|
+
See [docs/proxy.md](./docs/proxy.md) for the full guide: generic vs. Webshare
|
|
185
|
+
proxies, the CLI flags, why `proxyConfig` does nothing on Cloudflare
|
|
186
|
+
Workers/edge (and what to use there instead), and caching in front of the
|
|
187
|
+
fetcher so a proxy request is only spent on a video you don't already have.
|
|
188
|
+
|
|
184
189
|
## Error Handling
|
|
185
190
|
|
|
186
191
|
```typescript
|
|
@@ -323,7 +328,7 @@ What you get, without wiring any of it up yourself:
|
|
|
323
328
|
| **Minimize** | Collapses to the title bar. The iframe is hidden with CSS, never unmounted, so playback isn't interrupted. |
|
|
324
329
|
| **Picture-in-picture** | Pops the video into an always-on-top OS window via the Document Picture-in-Picture API, where the browser supports it. The node is *moved*, not cloned, so playback continues. |
|
|
325
330
|
| **Queue** | `addToQueue` / `setQueue` / `playNext`, with an "Up next" strip under the video. |
|
|
326
|
-
| **Synced captions** | Optional subtitles panel above the video — the spoken
|
|
331
|
+
| **Synced captions** | Optional subtitles panel above the video — caption cues are regrouped into whole sentences (no timestamps), the spoken one highlights and auto-scrolls, and clicking a sentence seeks. Needs `transcriptUrl` or `fetchTranscript` (see below). |
|
|
327
332
|
| **Resume** | Remembers what was playing, and how far into it, across a reload — plus a per-video position for the last 50 videos, for 24 hours. `storageKey={null}` turns it off. |
|
|
328
333
|
| **Error recovery** | Reads the IFrame API's error codes, explains them ("this video is private", "the owner doesn't allow embedding"), and offers Retry or Watch on YouTube from the same spot. |
|
|
329
334
|
| **Theming** | Colours are CSS custom properties on `.eytp-root` and follow `prefers-color-scheme` by default. Override them to match your app. |
|
|
@@ -392,7 +397,7 @@ getPlayerState(); // the same, outside React
|
|
|
392
397
|
| `fetchTranscript` | `(videoId: string) => Promise<{ snippets, error? }>` | Custom caption loader, instead of `transcriptUrl`. |
|
|
393
398
|
| `extraControls` | `ReactNode \| (ctx: PlayerControlContext) => ReactNode` | Your own buttons, rendered in the control strip. |
|
|
394
399
|
| `renderTitle` | `(ctx: PlayerControlContext) => ReactNode` | Custom title-bar content. Defaults to the video title. |
|
|
395
|
-
| `showSubtitles` | `boolean` | Force the captions button on or off.
|
|
400
|
+
| `showSubtitles` | `boolean` | Force the captions button on or off. By default it appears only for videos that turned out to have a transcript — every video played is checked, and one without captions gets no button and no error. |
|
|
396
401
|
| `showPictureInPicture` | `boolean` | Show the PiP button where supported. Default `true`. |
|
|
397
402
|
| `storageKey` | `string \| null` | localStorage key for resume-after-reload. `null` disables persistence entirely. |
|
|
398
403
|
| `className` | `string` | Extra class on the player root, for host-side positioning or theming. |
|
package/dist/cli.js
CHANGED
|
@@ -2009,7 +2009,7 @@ var package_exports = /* @__PURE__ */ require_rolldown_runtime.__exportAll({
|
|
|
2009
2009
|
}), name, version, description, main$1, module$1, types, exports$1, bin, files, scripts, keywords, license, repository, dependencies, peerDependencies, peerDependenciesMeta, devDependencies, engines, package_default;
|
|
2010
2010
|
var init_package = require_rolldown_runtime.__esmMin((() => {
|
|
2011
2011
|
name = "extract-youtube";
|
|
2012
|
-
version = "1.0.
|
|
2012
|
+
version = "1.0.294";
|
|
2013
2013
|
description = "Fast, no-browser serverless-optimized YouTube transcript extractor, with optional React UI: a floating YouTube player and a synced-transcript modal";
|
|
2014
2014
|
main$1 = "dist/index.cjs";
|
|
2015
2015
|
module$1 = "dist/index.mjs";
|