ytdl-web/app/views/download.html

52 lines
1.5 KiB
HTML
Raw Normal View History

2023-04-14 16:07:57 -04:00
<div class="d-flex flex-column align-items-center">
<h1>Download Video</h1>
<h2 class="fs-4 text-muted text-center">{{.Meta.Title}}</h2>
2023-04-14 16:07:57 -04:00
<p style="font-size: 0.85rem">{{.Url}}</p>
2023-08-12 21:09:22 -04:00
<button
hx-get="{{.BasePath}}/home"
hx-trigger="click"
hx-target="#main-content"
class="btn btn-secondary btn-sm mt-3"
style="width: 30rem; max-width: 100%"
>
2023-04-14 22:01:36 -04:00
Download Another Video
2023-08-12 21:09:22 -04:00
</button>
2023-04-14 16:07:57 -04:00
</div>
2023-04-14 22:01:36 -04:00
2023-08-12 21:09:22 -04:00
{{$root := .}} {{range $vidIndex, $video := .Videos}} {{if not (eq $vidIndex
0)}}
<hr class="mt-5" />
{{end}}
<div class="d-flex flex-column flex-lg-row justify-content-center gap-5 mt-5">
<div class="d-flex justify-content-center">
2023-08-12 21:09:22 -04:00
<img
src="{{.Meta.Thumbnail}}"
alt="{{.Meta.Title}}"
style="max-height: 25rem; max-width: 100%; margin: 0 auto"
/>
</div>
<div class="downloads flex-lg-grow-1">
{{range $index, $format := $video.Formats}}
<div style="font-size: smaller">{{$format.Format}}</div>
2023-04-14 22:01:36 -04:00
<div class="flex-grow-1 d-flex gap-3">
2023-08-12 21:09:22 -04:00
<a
class="btn btn-primary flex-grow-1"
download="{{$root.Meta.ID}}-{{$format.Resolution}}.{{$format.Ext}}"
P
href="{{$format.Url}}"
>
2023-04-14 22:01:36 -04:00
Download (direct)
</a>
2023-08-12 21:09:22 -04:00
<a
class="btn btn-primary flex-grow-1"
download="{{$root.Meta.ID}}-{{$format.Resolution}}.{{$format.Ext}}"
href="{{$root.BasePath}}/download/proxy?url={{queryEscape $root.Url}}&format={{$format.FormatID}}&index={{$vidIndex}}"
>
2023-04-14 22:01:36 -04:00
Download (proxied)
</a>
</div>
{{end}}
2023-04-14 16:07:57 -04:00
</div>
</div>
2023-08-12 21:09:22 -04:00
{{end}}