模板:YouTube
| 请不要使用此模板链接到违反著作权法的材料。 如果链接这种材料,则必须使用合乎著作权的链接替代或者立即删除。 |
脚本错误:没有“High-use”这个模块。 本模板用作==外部連結==章节链接YouTube视频的外部链接。此模板并非参考来源模板,您可以使用{{cite AV media}}引用影音媒体。对于连续剧或连载式的媒体,使用{{cite episode}}或{{cite serial}}。要引用唱片封套上的说明文字(liner notes)及其他配有影音媒体的平面媒体,请使用{{cite AV media notes}}。
用法
{{YouTube|视频id|link=no|视频描述|h=小时数|m=分钟数|s=秒数|language=语言}}
- 参数说明:
- 参数1:视频id,即是在“http://www.youtube.com/watch?v=”或“https://music.youtube.com/watch?v=”之后的YouTube id,须符合d:Property:P1651#P2302的格式约束规定:64位整数的Base64编码,即符合以下的正则表达式:[-_0-9A-Za-z]{11}(即11个字符的半角的连字暨减号、下横线、阿拉伯数字、不区分大小写的英文字母)
- 例如:https://www.youtube.com/watch?v=7bvukR-332A ,那么视频id便是“7bvukR-332A”。
- 参数2(可省略):为视频给出了一个可选的描述。
- 若省略此参数则描述会是包含本模板的页面名称。
- h(可省略):视频要开始播放的小时数。若省略此参数则为0。
- m(可省略):视频要开始播放的分钟数。若省略此参数则为0。
- s(可省略):视频要开始播放的秒数。若省略此参数则为0。(注意:参数show不可用简称s,否则会与秒数冲突而无法正常显示。)
- language(可省略):视频的语言。
- link=no(可省略):用于取消YouTube条目链接。
- 参数1:视频id,即是在“http://www.youtube.com/watch?v=”或“https://music.youtube.com/watch?v=”之后的YouTube id,须符合d:Property:P1651#P2302的格式约束规定:64位整数的Base64编码,即符合以下的正则表达式:[-_0-9A-Za-z]{11}(即11个字符的半角的连字暨减号、下横线、阿拉伯数字、不区分大小写的英文字母)
示例
| 本模板使用维基数据资源: 脚本错误:没有“Uses Wikidata”这个模块。 |
{{Youtube|PfcgWfKOp1g}}- 效果:YouTube上的视频
{{YouTube|9bZkp7q19f0|《江南Style》}}{{YouTube|c=UCidwPAdN3UO59sMOZX2cn6Q}}{{YouTube|show=startrek|''Star Trek: The Original Series''}}{{Youtube|PfcgWfKOp1g|Varias.Macau 85/86|m=3}}- 效果:YouTube上的Varias.Macau 85/86,始于3分00秒
{{Youtube|PfcgWfKOp1g|Varias.Macau 85/86|m=3|s=04}}- 效果:YouTube上的Varias.Macau 85/86,始于3分04秒
{{Youtube|PfcgWfKOp1g|Varias.Macau 85/86|m=3|s=04|language=zh-hk}}- 效果:YouTube上的Varias.Macau 85/86,始于3分04秒(繁体中文)
用户频道链接
{{YouTube|user=userchannelname|title}}
- user 是“YouTube 用户频道名”,像是https://www.youtube.com/user/userchannelname
- user 参数也可以使用简写 u 指定
{{YouTube|channel=userchannelid|title}}
- channel 是“YouTube 用户频道id”,像是https://www.youtube.com/channel/userchannelid,该参数须符合d:Property:P2397#P2302的格式约束规定:须符合以下的正则表达式:UC[-_0-9A-Za-z]{21}[AQgw]
- playlist 是“YouTube播放列表id”,像是https://www.youtube.com/playlist?list=playlistid,该参数须符合d:Property:P4300#P2302的格式约束规定:须符合以下的正则表达式:EL[0-9A-Za-z_-]{10}[048AEIMQUYcgkosw]||PL[0-9A-Za-z_-]{16}|(?:UU|UC|PL|LL|EL)[0-9A-Za-z_-]{21}[AQgw]|PL[0-9A-Za-z_-]{32}|(?:OLAK5uy_|RDCLAK5uy_)[0-9A-Za-z_-]{32}[048AEIMQUYcgkosw]
- custom 是“YouTube 自定义网址name”,像是https://www.youtube.com/c/yourcustomname
- title 是可选的描述,如不提供则为页面标题名(PAGENAME)
模版数据
<templatedata> { "description": "本模板用以在外部链接段落创建链接至YouTube网站的超链接。非参考来源模板。", "params": { "id": { "label": "YouTube 视频ID", "description": "视频ID是网址 https://www.youtube.com/watch?v=[视频ID] 之处", "aliases": [ "1" ], "example": "9bZkp7q19f0", "type": "string" }, "user": { "label": "YouTube 用户名", "description": "YouTube 用户名是在网址 https://www.youtube.com/user/[用户名] 之处", "aliases": [ "u" ], "example": "pewdiepie", "type": "string" }, "channel": { "label": "YouTube 频道ID", "description": "YouTube 频道ID是在网址 https://www.youtube.com/channel/[频道ID] 之处", "aliases": [ "c" ], "example": "UC-9-kyTW8ZkZNDHQJ6FgpwQ", "type": "string" },
"custom": {
"label": "YouTube 自定义ID", "description": "YouTube 频道ID是在网址 https://www.youtube.com/c/[自定义网址name] 之处", "example": "YouTubeCreators", "type": "string" }, "show": { "label": "YouTube show name", "description": "The show name which appears after https://www.youtube.com/show/ in the URL", "example": "startrek", "type": "string" }, "playlist": { "label": "YouTube 播放清单ID", "description": "YouTube 播放清单ID是在网址 https://www.youtube.com/playlist?list=[播放清单ID] 之处", "aliases": [ "p" ], "example": "PLrEnWoR732-DZV1Jc8bUpVTF_HTPbywpE", "type": "string" }, "title": { "label": "Title", "description": "The name of the page being linked to", "suggested": true, "aliases": [ "1", "2" ], "example": "Gangnam Style", "default": "If it is a video, Video, if it is a show, the article's page name in italics, otherwise, the article's page name unformatted", "type": "string" }, "link": { "label": "Link on", "description": "Set this parameter to no to suppress the link to the YouTube article", "example": "no", "type": "string" } } } </templatedata>
相关
| 上述文档嵌入自Template:YouTube/doc。 (编辑 | 历史) 编者可以在本模板的沙盒 (创建 | 镜像)和测试样例 (创建)页面进行实验。 请在/doc子页面中添加分类。本模板的子页面。 |