templates/video.html (view raw)
1<!doctype html>
2<!--
3 ███████ ██ ██ ██ ██ ██ ███ ██ ██ ██████ ██ ██ ██████ ███████
4 ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
5 █████ ██ ███ ████ ██ ██ ██ ██ ██ ██ ██ ██████ █████
6 ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
7 ██ ██ ██ ██ ██ ███ ███ ██ ███ ██████ ███████
8 ██
9 ██ A better way to embed YouTube videos on Telegram (inspired by FixTweet).
10 ██
11-->
12<html lang="en">
13
14<head>
15 <meta charset="utf-8">
16 <meta name="viewport" content="width=device-width, initial-scale=1">
17 <title>{{ .Title }} - FixYouTube</title>
18 <link rel="canonical" href="https://www.youtube.com/watch?v={{ .VideoID }}" />
19 <meta property="og:url" content="https://www.youtube.com/watch?v={{ .VideoID }}" />
20 <meta property="theme-color" content="0000FF" />
21 <meta property="twitter:card" content="player" />
22 <meta property="twitter:site" content="{{ .Author }}" />
23 <meta property="twitter:creator" content="{{ .Author }}" />
24 <meta property="twitter:title" content="{{ .Title }}" />
25 <meta property="og:title" content="{{ .Title }}" />
26 <meta property="og:description" content="{{ .Description }}" />
27 <meta property="og:site_name" content="FixYouTube ({{ .Author }})" />
28 {{ if gt (len .VideoThumbnails) 0 }}
29 <meta property="twitter:image" content="{{ (index .VideoThumbnails 0).URL }}" />
30 {{ end }}
31 <meta property="twitter:player:stream:content_type" content="video/mp4" />
32 <meta property="og:video" content="/proxy/{{ .VideoID }}" />
33 <meta property="og:video:secure_url" content="/proxy/{{ .VideoID }}" />
34 <meta property="og:video:duration" content="{{ .LengthSeconds }}">
35 <meta property="og:video:type" content="video/mp4" />
36 <link rel="icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text fill=%22white%22 y=%22.9em%22 font-size=%2290%22>🛠</text></svg>">
37 <link rel="stylesheet" href="https://unpkg.com/@picocss/pico@latest/css/pico.min.css">
38</head>
39
40<body>
41 <main class="container" style="max-width: 35rem">
42 {{ if gt (len .FormatStreams) 0 }}
43 <video style="width: 100%" autoplay controls>
44 <source src="{{ (index .FormatStreams 0).URL }}" type="video/mp4" />
45 </video>
46 {{ end }}
47 <h2>{{ .Title }}</h2>
48 <h3>> <a href="https://www.youtube.com/{{ .AuthorURL }}" target="_blank">{{ .Author }}</a></h3>
49 <pre style="white-space: pre-wrap">{{ .DescriptionHTML }}</pre>
50 <form action="/download" method="post" rel="noopener" target="_blank" style="display: grid; grid-template-columns: auto auto; justify-content: space-between;">
51 <input type="hidden" name="video" value="{{ .VideoID }}">
52 <select name="itag">
53 <optgroup label="Full">
54 {{ range .FormatStreams }}
55 <option value="{{ .Itag }}">
56 {{ parseFormat . }}
57 </option>
58 {{ end }}
59 </optgroup>
60 <optgroup label="Partial">
61 {{ range .AdaptiveFormats }}
62 <option value="{{ .Itag }}">
63 {{ parseFormat . }}
64 </option>
65 {{ end }}
66 </optgroup>
67 </select>
68 <button type="submit">Download</button>
69 </form>
70 <a href="https://www.youtube.com/watch?v={{ .VideoID }}">Watch on YouTube</a>
71 <br />
72 <a href="/">What is this?</a>
73 <br />
74 <a href="/refresh/{{ .VideoID }}">Refresh</a>
75 <hr>
76 <section>
77 <small>
78 <a href="https://github.com/birabittoh/fixyoutube-go" target="_blank">Source code</a>
79 </small>
80 <br />
81 <small>• YouTube is a trademark of Google LLC. This app is not affiliated with Google LLC.</small>
82 </section>
83 </main>
84</body>
85
86</html>