all repos — gopipe @ d9ab51a35a4242ee8f1f5c0760ced3905f84e872

Embed YouTube videos on Telegram, Discord and more!

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<html lang="en"><head>
12    <link rel="canonical" href="https://www.youtube.com/watch?v={{ .VideoID }}" />
13    {{ if not .Debug }}
14    <meta http-equiv="refresh" content="0;url=https://www.youtube.com/watch?v={{ .VideoID }}" />
15    {{ end }}
16    <meta property="og:url" content="https://www.youtube.com/watch?v={{ .VideoID }}" />
17    <meta property="theme-color" content="0000FF" />
18    <meta property="twitter:card" content="player" />
19    <meta property="twitter:site" content="{{ .Uploader }}" />
20    <meta property="twitter:creator" content="{{ .Uploader }}" />
21    <meta property="twitter:title" content="{{ .Title }}" />
22    <meta property="og:title" content="{{ .Title }}" />
23    <meta property="og:description" content="{{ .Description }}" />
24    <meta property="og:site_name" content="GoTube ({{ .Uploader }})" />
25    <meta property="twitter:image" content="0" />
26    <meta property="twitter:player:stream:content_type" content="video/mp4" />
27    {{ if .VideoURL }}
28    <meta property="og:video" content="{{ .VideoURL }}" />
29    <meta property="og:video:secure_url" content="{{ .VideoURL }}" />
30    <meta property="og:video:duration" content="{{ .Duration }}">
31    <meta property="og:video:type" content="video/mp4" />
32    {{ end }}
33</head><body></body></html>