parent
16e8b34638
commit
e52022e31a
10 changed files with 224 additions and 34 deletions
6
api.go
6
api.go
|
|
@ -33,7 +33,11 @@ func (s *Scraper) RequestAPI(req *http.Request, target interface{}) error {
|
|||
req.Header.Set("X-Guest-Token", s.guestToken)
|
||||
}
|
||||
|
||||
req.Header.Set("Authorization", "Bearer "+s.bearerToken)
|
||||
if s.oAuthToken != "" && s.oAuthSecret != "" {
|
||||
req.Header.Set("Authorization", s.sign(req.Method, req.URL))
|
||||
} else {
|
||||
req.Header.Set("Authorization", "Bearer "+s.bearerToken)
|
||||
}
|
||||
|
||||
for _, cookie := range s.client.Jar.Cookies(req.URL) {
|
||||
if cookie.Name == "ct0" {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue