diff options
Diffstat (limited to 'grimtube.go')
| -rw-r--r-- | grimtube.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/grimtube.go b/grimtube.go index c635418..bd700fb 100644 --- a/grimtube.go +++ b/grimtube.go @@ -14,6 +14,7 @@ import ( ) var docPath string +var dlsrv string func getLangs() []string { return []string{"en", "fr", "de", "ja", "ru"} @@ -67,6 +68,7 @@ func index(w http.ResponseWriter, r *http.Request) { Items []ytparser.Item Page int Lang string + Dlsrv string }{ getLangs(), getOrders(), @@ -75,6 +77,7 @@ func index(w http.ResponseWriter, r *http.Request) { items, page, lang, + dlsrv, } serve(w, "templates/search.html", data) } @@ -118,6 +121,7 @@ func search(w http.ResponseWriter, r *http.Request) { Langs []string Order string Orders []string + Dlsrv string }{ items, term, @@ -126,6 +130,7 @@ func search(w http.ResponseWriter, r *http.Request) { getLangs(), order, getOrders(), + dlsrv, } serve(w, "templates/search.html", data) } @@ -150,8 +155,10 @@ func favicon(w http.ResponseWriter, r *http.Request) { func main() { port := flag.Int("p", 8080, "The port to bind to.") dir := flag.String("d", "", "Location of the templates and static resources.") + dl := flag.String("dlsrv", "", "Link to a download server.") flag.Parse() docPath = *dir + dlsrv = *dl fs := http.FileServer(http.Dir("static")) http.Handle("/static/", http.StripPrefix(path.Join(docPath, "/static/"), fs)) http.HandleFunc("/favicon.ico", favicon) |
