Compare commits
No commits in common. "master" and "hooktest1" have entirely different histories.
@ -60,9 +60,9 @@ type AlpineLinuxPackageUpdate struct {
|
||||
|
||||
func (u *AlpineLinuxPackageUpdate) Update() {
|
||||
|
||||
u.apkLock.Lock()
|
||||
log.Println("Updating packages...")
|
||||
cmd := exec.Command("apk", u.Packages...)
|
||||
u.apkLock.Lock()
|
||||
stdout, err := cmd.Output()
|
||||
u.apkLock.Unlock()
|
||||
if err != nil {
|
||||
|
21
main.go
21
main.go
@ -183,12 +183,21 @@ func handleDownload(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
|
||||
ctx.DownloadURL = downloadURL
|
||||
ctx.DownloadURL = fmt.Sprintf("/download-direct?URL=%s&filename=%s",
|
||||
w.Header().Add(
|
||||
"Hx-Redirect",
|
||||
fmt.Sprintf("/download-direct?URL=%s&filename=%s",
|
||||
url.QueryEscape(ctx.DownloadURL),
|
||||
url.QueryEscape(filename),
|
||||
url.QueryEscape(filename)),
|
||||
)
|
||||
|
||||
w.Header().Add("Hx-Redirect", ctx.DownloadURL)
|
||||
err = templates.ExecuteTemplate(w,"download-result.html", ctx)
|
||||
if err != nil {
|
||||
log.Println(err.Error())
|
||||
ctx.StatusCode = 500
|
||||
ctx.Err = &err
|
||||
err = templates.ExecuteTemplate(w,"download-result.html", ctx)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
func handleDirectDownload(w http.ResponseWriter, r *http.Request) {
|
||||
@ -267,7 +276,7 @@ func handleDirectDownload(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
func handleRoot(w http.ResponseWriter, r *http.Request) {
|
||||
if r.URL.Path != "/" && r.URL.Path != "" {
|
||||
http.Redirect(w, r, "/", http.StatusPermanentRedirect)
|
||||
w.WriteHeader(http.StatusNotFound)
|
||||
return
|
||||
}
|
||||
|
||||
@ -367,8 +376,8 @@ func main() {
|
||||
|
||||
wrappedHandler := NewLogger(handler)
|
||||
srv := http.Server{
|
||||
ReadTimeout: 1 * time.Minute,
|
||||
WriteTimeout: 1 * time.Minute,
|
||||
ReadTimeout: 60 * time.Second,
|
||||
WriteTimeout: 60 * time.Second,
|
||||
Addr: ":" + DEFAULT_HTTP_PORT,
|
||||
Handler: wrappedHandler,
|
||||
}
|
||||
|
@ -24,7 +24,7 @@
|
||||
<form hx-post="/download" hx-target="#get-btn" hx-swap="outerHTML" hx-indicator="#progress">
|
||||
<div class="grid">
|
||||
<div hx-target="this" hx-swap="outerHTML">
|
||||
<label>Link
|
||||
<label data-tooltip="Link can be on any platform!">Link
|
||||
<input
|
||||
type="url" id="URL" name="URL"
|
||||
hx-post="/valid-link"
|
||||
@ -45,12 +45,17 @@
|
||||
Convert to MP3 audio
|
||||
</label>
|
||||
</fieldset>
|
||||
<button class="outline" id="get-btn" role="button">Get
|
||||
<button class=" outline" id="get-btn" role="button">Get
|
||||
<!-- <a class="htmx-indicator" href="#" aria-busy="true"></a> -->
|
||||
</button>
|
||||
|
||||
</form>
|
||||
<progress class="htmx-indicator" id="progress"></progress>
|
||||
</div>
|
||||
<div>
|
||||
<img src="/assets/images/play.png">
|
||||
</div>
|
||||
<script data-cfasync="false" type="text/javascript" src="//brightadnetwork.com/a/display.php?r=7440414"></script>
|
||||
<script data-cfasync="false" type="text/javascript" data-adel="atag" src="//acscdn.com/script/atg.js" czid="gobrl6fkye"></script>
|
||||
</main>
|
||||
</html>
|
||||
|
Loading…
Reference in New Issue
Block a user