This commit is contained in:
GZod01 2024-05-18 18:17:10 +02:00
parent dbf2851d1e
commit 9a3f24609c

View file

@ -3,8 +3,6 @@
{{ $code = (.Get "code") }}
{{ else if (.Get "src") }}
{{ $code = (.Get "src") }}
{{ (strings.ReplaceRE `(http(?:s)?:\/\/(?:www\.)?youtu(?:(?:be\.com)|(?:\.be))|(?:be-nocookie\.com))\/(?:(?:watch\?v=)|(?:embed\/)|(?:\/v\/))?(.+)?(?:\&|\?)` "" $code) }}
{{ $code = (strings.ReplaceRE `(http(?:s)?:\/\/(?:www\.)?youtu(?:(?:be\.com)|(?:\.be))|(?:be-nocookie\.com))\/(?:(?:watch\?v=)|(?:embed\/)|(?:\/v\/))?(.+)?(?:\&|\?)` "" $code) }}
<a class=youtubelink href="https://youtu.be/{{ $code }}"><img src="http://i3.ytimg.com/vi/{{ $code }}/hqdefault.jpg"/></a>
{{ end }}
<img src="http://i3.ytimg.com/vi/{{ .Get "code" }}/hqdefault.jpg"/>