Skip to content

Commit

Permalink
fix too verbose output
Browse files Browse the repository at this point in the history
  • Loading branch information
mejgun committed Jul 5, 2020
1 parent 26631b9 commit 9e9528c
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 11 deletions.
Binary file modified bin/amd64/yt-proxy
Binary file not shown.
Binary file modified bin/i386/yt-proxy
Binary file not shown.
3 changes: 1 addition & 2 deletions parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@ func getLink(vidurl string) (retURL string, retErr error) {
}
}
vidurlsize := vidurl + vf + vh
fmt.Println(vidurl)
fmt.Println(vidurlsize)
debugPrint(vidurlsize)
lnk, ok := links[vidurlsize]
if ok {
retURL = lnk.url
Expand Down
13 changes: 4 additions & 9 deletions streamer.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,11 @@ var corrupted []byte
var filesize string

func playVideo(w http.ResponseWriter, req *http.Request) {
// debugPrint(req.UserAgent())
// debugPrint(req.Cookies())
var success bool
success = false
debugPrint(
req.Write(os.Stdout))

if debug {
req.Write(os.Stdout)
}
url := req.URL.Path[len("/play/"):] + "?"
url += req.URL.RawQuery
debugPrint(url)
Expand All @@ -47,15 +45,12 @@ func playVideo(w http.ResponseWriter, req *http.Request) {
request.Header.Set("User-Agent", req.UserAgent())
tr := &http.Transport{}
client := &http.Client{Transport: tr}
// debugPrint(request)
res, err := client.Do(request)
if err != nil {
log.Println(err)
}
defer res.Body.Close()
if debug {
fmt.Printf("%+v\n", res)
}
debugPrint(fmt.Sprintf("%+v\n", res))
h1, ok1 := res.Header["Content-Length"]
h2, ok2 := res.Header["Content-Type"]

Expand Down

0 comments on commit 9e9528c

Please sign in to comment.