Jump to content

Module:YouTube/doc: Difference between revisions

From Swarthmore Knowledge Base
m 1 revision imported
No edit summary
Line 14: Line 14:


* [[Widget:YouTube]] — embeds a YouTube video using an ID returned by this module
* [[Widget:YouTube]] — embeds a YouTube video using an ID returned by this module
* [[Extension:Scribunto]] — required for Lua modules
* <code>Extension:Scribunto</code> — required for Lua modules


<includeonly>[[Category:YouTube modules]]</includeonly>
<includeonly>[[Category:YouTube modules]]</includeonly>
<noinclude>[[Category:Module documentation]]</noinclude>
<noinclude>[[Category:Module documentation]]</noinclude>

Revision as of 17:42, 21 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

  • Widget:YouTube — embeds a YouTube video using an ID returned by this module
  • Extension:Scribunto — required for Lua modules