[twitter] update 'x-csrf-token' header after ct init (#7467)

This commit is contained in:
Mike Fährmann
2025-05-03 12:55:31 +02:00
parent 771317b36c
commit edc67983ed

View File

@@ -1510,6 +1510,13 @@ class TwitterAPI():
self.log.info("Initializing client transaction keys")
ct = transaction_id.ClientTransaction()
ct.initialize(self.extractor)
# update 'x-csrf-token' header (#7467)
csrf_token = self.extractor.cookies.get(
"ct0", domain=self.extractor.cookies_domain)
if csrf_token:
self.headers["x-csrf-token"] = csrf_token
return ct
def _transaction_id(self, url, method="GET"):