You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To use this, you want to load Twitter/X, open the DevTools by pressing CTRL + SHIFT + I, filter by Fetch/XHR, refresh the page.
Right-click something, click "Copy", then "copy all as cURL".
Run the python script python extract.py or whatever, then paste what you copied into it. Press enter twice.
importredefextract_headers(curl_command):
# headers you want to extractheaders_to_extract= [
'authorization',
'x-client-uuid',
'x-client-transaction-id'
]
# regex pattern to match the headerspattern=re.compile(r"-H '([^:]+): ([^']+)'")
extracted_headers= {}
# find all headersformatchinpattern.finditer(curl_command):
header_name=match.group(1).strip().lower()
header_value=match.group(2).strip()
ifheader_nameinheaders_to_extract:
extracted_headers[header_name] =header_valuereturnextracted_headersdefmain():
print("Paste your curl command below (end with an empty line):")
curl_command= []
whileTrue:
line=input()
ifline.strip() =="":
breakcurl_command.append(line)
curl_command_str="\n".join(curl_command)
# extract headersheaders=extract_headers(curl_command_str)
# print resultforkey, valueinheaders.items():
print(f"-H '{key}: {value}'")
if__name__=="__main__":
main()
The text was updated successfully, but these errors were encountered:
I've made a fast way to obtain the credentials.
To use this, you want to load Twitter/X, open the DevTools by pressing CTRL + SHIFT + I, filter by Fetch/XHR, refresh the page.
Right-click something, click "Copy", then "copy all as cURL".
Run the python script
python extract.py
or whatever, then paste what you copied into it. Press enter twice.The text was updated successfully, but these errors were encountered: