download_form.html
| 1 | {{define "download_form"}} |
| 2 | <div class="page-header"> |
| 3 | <h2>Download</h2> |
| 4 | </div> |
| 5 | |
| 6 | <div class="download-form"> |
| 7 | <form method="post" action="/download" class="form-card"> |
| 8 | <div class="form-group"> |
| 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 | </div> |
| 12 | |
| 13 | <div class="form-group"> |
| 14 | <label for="preset_id">Preset</label> |
| 15 | <select id="preset_id" name="preset_id"> |
| 16 | <option value="">-- No preset (manual) --</option> |
| 17 | {{range .Data.Presets}} |
| 18 | <option value="{{.ID}}" {{if $.Data.DefaultPreset}}{{if eq .ID $.Data.DefaultPreset.ID}}selected{{end}}{{end}}> |
| 19 | {{.Name}} {{if .IsDefault}}(default){{end}} |
| 20 | </option> |
| 21 | {{end}} |
| 22 | </select> |
| 23 | </div> |
| 24 | |
| 25 | <div class="form-group"> |
| 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 | </div> |
| 30 | |
| 31 | <div class="form-group"> |
| 32 | <label for="custom_flags">Custom Flags</label> |
| 33 | <textarea id="custom_flags" name="custom_flags" rows="3" placeholder="Any additional yt-dlp flags...">{{.Data.CustomFlags}}</textarea> |
| 34 | <small>Additional flags appended after preset flags. Example: --no-playlist --write-thumbnail</small> |
| 35 | </div> |
| 36 | |
| 37 | <div class="form-actions"> |
| 38 | <button type="submit" class="primary">Start Download</button> |
| 39 | <button type="submit" class="secondary" formaction="/download" formmethod="get" name="list_formats" value="1">List Available Formats</button> |
| 40 | <a href="/queue" class="button secondary">Cancel</a> |
| 41 | </div> |
| 42 | </form> |
| 43 | |
| 44 | {{if .Data.ShowFormats}} |
| 45 | {{if .Data.Formats}} |
| 46 | <div class="formats-table-container"> |
| 47 | <h4>Available Formats</h4> |
| 48 | <table class="formats-table"> |
| 49 | <thead> |
| 50 | <tr> |
| 51 | <th>ID</th> |
| 52 | <th>Extension</th> |
| 53 | <th>Resolution</th> |
| 54 | <th>FPS</th> |
| 55 | <th>Note</th> |
| 56 | </tr> |
| 57 | </thead> |
| 58 | <tbody> |
| 59 | {{range .Data.Formats}} |
| 60 | <tr> |
| 61 | <td><code>{{.ID}}</code></td> |
| 62 | <td>{{.Ext}}</td> |
| 63 | <td>{{.Resolution}}</td> |
| 64 | <td>{{.FPS}}</td> |
| 65 | <td>{{.Note}}</td> |
| 66 | </tr> |
| 67 | {{end}} |
| 68 | </tbody> |
| 69 | </table> |
| 70 | </div> |
| 71 | {{else}} |
| 72 | <div class="empty-state"> |
| 73 | <p>No formats found. Check the URL and try again.</p> |
| 74 | </div> |
| 75 | {{end}} |
| 76 | {{end}} |
| 77 | </div> |
| 78 | {{end}} |
| 79 |