Skip to content

Commit

Permalink
vsco json fix
Browse files Browse the repository at this point in the history
Signed-off-by: Omri Bornstein <omribor@gmail.com>
  • Loading branch information
AppleGamer22 committed Jan 29, 2025
1 parent 599d258 commit fa93a36
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 3 deletions.
2 changes: 0 additions & 2 deletions server/configuration/log.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package configuration

import (
"fmt"
"net/http"
"time"

Expand All @@ -17,7 +16,6 @@ func NewLoggerMiddleware(handler http.Handler) *LoggerMiddleware {
}

func (lm *LoggerMiddleware) ServeHTTP(writer http.ResponseWriter, request *http.Request) {
fmt.Println(request.RequestURI)
statusWriter := newStatusLogWriter(writer)
startTime := time.Now()
lm.handler.ServeHTTP(statusWriter, request)
Expand Down
1 change: 0 additions & 1 deletion server/configuration/tiktok.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ func (server *RakerServer) tiktok(request *http.Request) (db.User, db.History, [
continue
}
fileName := fmt.Sprintf("%s_%s", post, path.Base(URL.Path))
fmt.Println(fileName)
if !strings.HasSuffix(fileName, ".jpeg") {
fileName = fmt.Sprintf("%s.jpeg", fileName)
}
Expand Down
1 change: 1 addition & 0 deletions shared/vsco.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ func VSCO(owner, post string) (URL string, username string, err error) {
}

jsonText := script[len("<script>window.__PRELOADED_STATE__ =") : len(script)-len("</script>")]
jsonText = strings.ReplaceAll(jsonText, "undefined", "null")
var vscoPost VSCOPost
if err := json.Unmarshal([]byte(jsonText), &vscoPost); err != nil {
return URL, username, err
Expand Down

0 comments on commit fa93a36

Please sign in to comment.