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 {{ range .Captions }}
46 <track kind="subtitles" label="{{ .Label }}" src="/sub/{{ $.VideoID }}/{{ .Label }}" srclang="{{ .LanguageCode }}" />
47 {{ end }}
48 </video>
49 {{ end }}
50 <h2>{{ .Title }}</h2>
51 <h3>> <a href="https://www.youtube.com/{{ .AuthorURL }}" target="_blank">{{ .Author }}</a></h3>
52 <pre style="white-space: pre-wrap">{{ .DescriptionHTML }}</pre>
53 <form action="/download" method="post" rel="noopener" target="_blank" style="display: grid; grid-template-columns: auto auto; justify-content: space-between;">
54 <input type="hidden" name="video" value="{{ .VideoID }}">
55 <select name="itag">
56 <optgroup label="Full">
57 {{ range .FormatStreams }}
58 <option value="{{ .Itag }}">
59 {{ parseFormat . }}
60 </option>
61 {{ end }}
62 </optgroup>
63 <optgroup label="Partial">
64 {{ range .AdaptiveFormats }}
65 <option value="{{ .Itag }}">
66 {{ parseFormat . }}
67 </option>
68 {{ end }}
69 </optgroup>
70 </select>
71 <button type="submit">Download</button>
72 </form>
73 <a href="https://www.youtube.com/watch?v={{ .VideoID }}">Watch on YouTube</a>
74 <br />
75 <a href="/">What is this?</a>
76 <br />
77 <a href="/refresh/{{ .VideoID }}">Refresh</a>
78 <hr>
79 <section>
80 <small>
81 <a href="https://github.com/birabittoh/fixyoutube-go" target="_blank">Source code</a>
82 </small>
83 <br />
84 <small>• YouTube is a trademark of Google LLC. This app is not affiliated with Google LLC.</small>
85 </section>
86 </main>
87</body>
88
89</html>