all repos — gopipe @ 8223ef17cd00edc14c764e8f9874a05ee2073d0b

Embed YouTube videos on Telegram, Discord and more!

templates/video.tmpl (view raw)

 1{{ extends "base.tmpl" }}
 2
 3{{define "meta" -}}
 4    <title>{{ .Title }} - GoTube</title>
 5    <link rel="canonical" href="https://www.youtube.com/watch?v={{ .VideoID }}" />
 6    {{ if not .Debug }}
 7    <meta http-equiv="refresh" content="0;url=https://www.youtube.com/watch?v={{ .VideoID }}" />
 8    {{ end }}
 9    <meta property="og:url" content="https://www.youtube.com/watch?v={{ .VideoID }}" />
10    <meta property="theme-color" content="0000FF" />
11    <meta property="twitter:card" content="player" />
12    <meta property="twitter:site" content="{{ .Uploader }}" />
13    <meta property="twitter:creator" content="{{ .Uploader }}" />
14    <meta property="twitter:title" content="{{ .Title }}" />
15    <meta property="og:title" content="{{ .Title }}" />
16    <meta property="og:description" content="{{ .Description }}" />
17    <meta property="og:site_name" content="GoTube ({{ .Uploader }})" />
18    <meta property="twitter:image" content="{{ .Thumbnail }}" />
19    <meta property="twitter:player:stream:content_type" content="video/mp4" />
20    {{ if .VideoURL }}
21    <meta property="og:video" content="{{ .VideoURL }}" />
22    <meta property="og:video:secure_url" content="{{ .VideoURL }}" />
23    <meta property="og:video:duration" content="{{ .Duration }}">
24    <meta property="og:video:type" content="video/mp4" />
25    {{ end }}
26{{end}}
27
28
29{{define "content" -}}
30    <video style="width: 100%" autoplay controls>
31        <source src="{{ .VideoURL }}" type="video/mp4" />
32    </video>
33    <h2>{{ .Title }}</h2>
34    <h3>&gt; {{ .Uploader }}</h3>
35    <pre style="white-space: pre-wrap">{{ .Description }}</pre>
36    <a href="https://www.youtube.com/watch?v={{ .VideoID }}">Watch on YouTube</a>
37    <br />
38    <a href="/">What is this?</a>
39{{end}}