twitter: temporary fix
we're aiming to automatically generate x-client-transaction-id header. due to a recent change on twitter backend, this header is now required. sadly, its not static, so would propably break again anytime soon
This commit is contained in:
parent
1b7ed51060
commit
a959807524
3 changed files with 4 additions and 3 deletions
|
@ -119,7 +119,6 @@ func ParseGQLMedia(
|
|||
})
|
||||
|
||||
case "GraphImage", "XDTGraphImage":
|
||||
|
||||
media.AddFormat(&models.MediaFormat{
|
||||
FormatID: "image",
|
||||
Type: enums.MediaTypePhoto,
|
||||
|
|
|
@ -15,8 +15,9 @@ import (
|
|||
)
|
||||
|
||||
const (
|
||||
apiHostname = "x.com"
|
||||
apiEndpoint = "https://x.com/i/api/graphql/zZXycP0V6H7m-2r0mOnFcA/TweetDetail"
|
||||
apiHostname = "x.com"
|
||||
apiEndpoint = "https://x.com/i/api/graphql/zZXycP0V6H7m-2r0mOnFcA/TweetDetail"
|
||||
transactionID = "H/HJB3naILIqzncBBvY50XFL36IYeol67HU4ZlUe8wYvWdn9q7KJf7k2UBKOMwliRmCnohzCodsUCuvWOl9t0Z/wVY3QHA"
|
||||
)
|
||||
|
||||
var ShortExtractor = &models.Extractor{
|
||||
|
|
|
@ -33,6 +33,7 @@ func BuildAPIHeaders(cookies []*http.Cookie) map[string]string {
|
|||
headers := map[string]string{
|
||||
"authorization": "Bearer " + authToken,
|
||||
"user-agent": util.ChromeUA,
|
||||
"x-client-transaction-id": transactionID,
|
||||
"x-twitter-auth-type": "OAuth2Session",
|
||||
"x-twitter-client-language": "en",
|
||||
"x-twitter-active-user": "yes",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue