add cookie and x-csrf-token

This commit is contained in:
one.cat 2021-09-08 16:02:53 +08:00
parent d8dd7d54ea
commit 31c9e5da5a
5 changed files with 58 additions and 1 deletions

View file

@ -3,6 +3,7 @@ package twitterscraper
import (
"context"
"fmt"
"log"
"strconv"
)
@ -41,6 +42,7 @@ func (s *Scraper) FetchTweets(user string, maxTweetsNbr int, cursor string) ([]*
req.URL.RawQuery = q.Encode()
var timeline timeline
log.Println(req, timeline, "getuser tww")
err = s.RequestAPI(req, &timeline)
if err != nil {
return nil, "", err