first commit
This commit is contained in:
25
handler/get.go
Normal file
25
handler/get.go
Normal file
@ -0,0 +1,25 @@
|
||||
package handler
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
func GETIndex(w http.ResponseWriter, r *http.Request) {
|
||||
if r.Method != http.MethodGet {
|
||||
http.Error(w, "405 Method Not Allowed", http.StatusMethodNotAllowed)
|
||||
return
|
||||
}
|
||||
|
||||
fmt.Fprintln(w, "clickNgo")
|
||||
}
|
||||
|
||||
func GETJdcheckJS(w http.ResponseWriter, r *http.Request) {
|
||||
if r.Method != http.MethodGet {
|
||||
http.Error(w, "405 Method Not Allowed", http.StatusMethodNotAllowed)
|
||||
return
|
||||
}
|
||||
|
||||
w.Header().Set("Content-Type", "text/javascript")
|
||||
fmt.Fprintln(w, "jdownloader=true; var version='17461';")
|
||||
}
|
52
handler/post.go
Normal file
52
handler/post.go
Normal file
@ -0,0 +1,52 @@
|
||||
package handler
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
|
||||
"git.0x0001f346.de/andreas/clickNgo/core"
|
||||
)
|
||||
|
||||
func POSTFlashAdd(w http.ResponseWriter, r *http.Request) {
|
||||
if r.Method != http.MethodPost {
|
||||
http.Error(w, "405 Method Not Allowed", http.StatusMethodNotAllowed)
|
||||
return
|
||||
}
|
||||
|
||||
r.ParseForm()
|
||||
URLs := core.ExtractURLsFromString(r.PostFormValue("urls"))
|
||||
if len(URLs) == 0 {
|
||||
http.Error(w, "400 Bad Request", http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
|
||||
printURLs(URLs)
|
||||
|
||||
fmt.Fprintln(w, "OK")
|
||||
}
|
||||
|
||||
func POSTFlashAddcrypted2(w http.ResponseWriter, r *http.Request) {
|
||||
if r.Method != http.MethodPost {
|
||||
http.Error(w, "405 Method Not Allowed", http.StatusMethodNotAllowed)
|
||||
return
|
||||
}
|
||||
|
||||
r.ParseForm()
|
||||
URLs, err := core.DecryptURLs(r.PostFormValue("jk"), r.PostFormValue("crypted"))
|
||||
if err != nil || len(URLs) == 0 {
|
||||
http.Error(w, "400 Bad Request", http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
|
||||
printURLs(URLs)
|
||||
|
||||
fmt.Fprintln(w, "OK")
|
||||
}
|
||||
|
||||
func printURLs(URLs []string) {
|
||||
for _, url := range URLs {
|
||||
fmt.Println(url)
|
||||
}
|
||||
|
||||
fmt.Println("")
|
||||
}
|
Reference in New Issue
Block a user