Jump to content

Module:YouTube/doc: Difference between revisions

From Swarthmore Knowledge Base
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..."
 
m 1 revision imported
(No difference)

Revision as of 13:27, 6 May 2026

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