2023-04-14 16:07:57 -04:00
|
|
|
<div class="d-flex flex-column align-items-center">
|
|
|
|
<h1>Download Video</h1>
|
2023-04-15 12:38:33 -04:00
|
|
|
<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>
|
2024-02-17 11:19:10 -05:00
|
|
|
<a href="{{.BasePath}}/" hx-get="{{.BasePath}}/" 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-14 18:14:08 -04:00
|
|
|
</a>
|
2023-04-14 16:07:57 -04:00
|
|
|
</div>
|
2023-04-14 22:01:36 -04:00
|
|
|
|
2024-02-17 11:19:10 -05:00
|
|
|
{{$root := .}}
|
|
|
|
{{range $vidIndex, $video := .Videos}}
|
|
|
|
{{if not (eq $vidIndex 0)}}
|
2023-04-15 12:38:33 -04:00
|
|
|
<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">
|
2024-11-06 23:25:44 -05:00
|
|
|
<img src="{{$video.Meta.Thumbnail}}" alt="{{$video.Meta.Title}}" style="max-height: 25rem; max-width: 100%; margin: 0 auto" />
|
2023-04-15 12:38:33 -04:00
|
|
|
</div>
|
|
|
|
<div class="downloads flex-lg-grow-1">
|
|
|
|
{{range $index, $format := $video.Formats}}
|
2024-02-17 12:01:59 -05:00
|
|
|
{{template "format" (map "root" $root "format" $format "label" $format.Format "vidIndex" $vidIndex)}}
|
2023-04-15 12:38:33 -04:00
|
|
|
{{end}}
|
2023-04-14 16:07:57 -04:00
|
|
|
</div>
|
2023-04-15 12:38:33 -04:00
|
|
|
</div>
|
2024-02-17 12:01:59 -05:00
|
|
|
{{if gt (len $video.OtherFormats) 0}}
|
|
|
|
<div class="d-grid my-3">
|
2024-11-06 23:07:55 -05:00
|
|
|
<button
|
|
|
|
type="button"
|
|
|
|
class="btn btn-secondary"
|
|
|
|
data-bs-toggle="collapse"
|
|
|
|
data-bs-target="#collapse-{{$root.Meta.ID}}-{{$vidIndex}}"
|
|
|
|
aria-expanded="false"
|
|
|
|
aria-controls="collapse-{{$root.Meta.ID}}-{{$vidIndex}}"
|
|
|
|
>
|
2024-02-17 12:01:59 -05:00
|
|
|
See More Formats
|
|
|
|
</button>
|
|
|
|
</div>
|
2024-11-06 23:07:55 -05:00
|
|
|
<div id="collapse-{{$root.Meta.ID}}-{{$vidIndex}}" class="collapse">
|
2024-02-17 12:01:59 -05:00
|
|
|
<div class="downloads d-flex d-md-grid flex-column">
|
|
|
|
{{range $index, $format := $video.OtherFormats}}
|
|
|
|
{{$label := sprintf "ext: %s, resolution: %s, filesize: %s, note: %s" $format.Ext $format.Resolution
|
|
|
|
(filesize $format.Filesize) $format.FormatNote}}
|
|
|
|
{{template "format" (map "root" $root "format" $format "label" $label "vidIndex" $vidIndex)}}
|
|
|
|
{{end}}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{{end}}
|
|
|
|
{{end}}
|
|
|
|
|
|
|
|
{{define "format"}}
|
|
|
|
<div style="font-size: smaller">{{.label}}</div>
|
|
|
|
<div class="flex-grow-1 d-flex gap-3">
|
|
|
|
<a class="btn btn-primary flex-grow-1" download="{{.root.Meta.ID}}-{{.format.Resolution}}.{{.format.Ext}}" P
|
|
|
|
href="{{.format.Url}}">
|
|
|
|
Download (direct)
|
|
|
|
</a>
|
|
|
|
<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}}">
|
|
|
|
Download (proxied)
|
|
|
|
</a>
|
|
|
|
</div>
|
2024-02-17 11:19:10 -05:00
|
|
|
{{end}}
|