download_form.html
⎇
Raw
1{{define "download_form"}}
2<div class="page-header">
3 <h2>Download</h2>
4</div>
5
6<div class="download-form">
7 <article>
8 <form method="post" action="/download">
9 <label for="url">Video/Playlist URL</label>
10 <input type="url" id="url" name="url" placeholder="https://youtube.com/watch?v=..." required value="{{.Data.URL}}">
11
12 <label for="preset_id">Preset</label>
13 <select id="preset_id" name="preset_id">
14 <option value="">-- No preset (manual) --</option>
15 {{range .Data.Presets}}
16 <option value="{{.ID}}" {{if $.Data.DefaultPreset}}{{if eq .ID $.Data.DefaultPreset.ID}}selected{{end}}{{end}}>
17 {{.Name}} {{if .IsDefault}}(default){{end}}
18 </option>
19 {{end}}
20 </select>
21
22 <label for="output_dir">Output Directory</label>
23 <input type="text" id="output_dir" name="output_dir" placeholder="e.g., videos/music (relative to library folder)" value="{{.Data.OutputDir}}">
24 <small>Optional sub-directory within the library folder. Use / for nested paths.</small>
25
26 <label for="format_override">Format Override</label>
27 <input type="text" id="format_override" name="format_override" placeholder="e.g., bestvideo+bestaudio/best or format ID like 22" value="{{.Data.FormatOverride}}">
28 <small>Overrides the preset format selection. Use yt-dlp format syntax or specific format IDs.</small>
29
30 <label for="custom_flags">Custom Flags</label>
31 <textarea id="custom_flags" name="custom_flags" rows="3" placeholder="Any additional yt-dlp flags...">{{.Data.CustomFlags}}</textarea>
32 <small>Additional flags appended after preset flags. Example: --no-playlist --write-thumbnail</small>
33
34 {{template "ytdlp_notes" false}}
35
36 <div class="form-actions">
37 <button type="submit" class="primary">Start Download</button>
38 <button type="submit" class="secondary" formaction="/download" formmethod="get" name="list_formats" value="1">List Available Formats</button>
39 </div>
40 </form>
41 </article>
42
43 {{if .Data.ShowFormats}}
44 {{if .Data.Formats}}
45 <article>
46 <h4>Available Formats</h4>
47 {{if .Data.PlaylistEntry}}
48 <p class="format-note">This URL is a playlist. The formats below are the
49 ones offered for <strong>{{.Data.PlaylistEntry}}</strong>; other entries
50 may offer different formats.</p>
51 {{end}}
52 <table>
53 <thead>
54 <tr>
55 <th>ID</th>
56 <th>Extension</th>
57 <th>Resolution</th>
58 <th>FPS</th>
59 <th>Note</th>
60 </tr>
61 </thead>
62 <tbody>
63 {{range .Data.Formats}}
64 <tr>
65 <td><code>{{.ID}}</code></td>
66 <td>{{.Ext}}</td>
67 <td>{{.Resolution}}</td>
68 <td>{{.FPS}}</td>
69 <td>{{.Note}}</td>
70 </tr>
71 {{end}}
72 </tbody>
73 </table>
74 </article>
75 {{else}}
76 <div class="empty-state">
77 <p>No formats found. Check the URL and try again.</p>
78 </div>
79 {{end}}
80 {{end}}
81</div>
82{{end}}
83