Jump to content

Module:YouTube/doc

From Swarthmore Knowledge Base
Revision as of 20:13, 1 May 2026 by temp>Admin (Created page with "'''Module:YouTube''' provides utility functions for parsing YouTube URLs and extracting video IDs. It accepts all common YouTube URL formats, including standard watch URLs (<code>youtube.com/watch?v=</code>), short URLs (<code>youtu.be/</code>), embed URLs (<code>youtube.com/embed/</code>), Shorts URLs (<code>youtube.com/shorts/</code>), and bare video IDs. == Usage == <pre>{{#invoke:YouTube|getVideoId|URL}}</pre> == Example == <pre>{{#invoke:YouTube|getVideoId|https...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

This is the documentation page for Module:YouTube

Module:YouTube provides utility functions for parsing YouTube URLs and extracting video IDs. It accepts all common YouTube URL formats, including standard watch URLs (youtube.com/watch?v=), short URLs (youtu.be/), embed URLs (youtube.com/embed/), Shorts URLs (youtube.com/shorts/), and bare video IDs.

Usage

{{#invoke:YouTube|getVideoId|URL}}

Example

{{#invoke:YouTube|getVideoId|https://www.youtube.com/watch?v=dQw4w9WgXcQ}}

Returns: dQw4w9WgXcQ

See also