Add /sync_x command with X bookmarks import flow
This commit is contained in:
parent
79073b7a2c
commit
874f3ec570
8 changed files with 975 additions and 2 deletions
19
vendor/extract-x-bookmarks/isolate_cookies.py
vendored
Normal file
19
vendor/extract-x-bookmarks/isolate_cookies.py
vendored
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
cookie_str = input("Input your cookies in the Header String format: ").strip()
|
||||
|
||||
cookie_dict = {}
|
||||
for item in cookie_str.split(";"):
|
||||
part = item.strip()
|
||||
if not part or "=" not in part:
|
||||
continue
|
||||
key, value = part.split("=", 1)
|
||||
cookie_dict[key.strip()] = value.strip()
|
||||
|
||||
auth_token = cookie_dict.get("auth_token", "")
|
||||
ct0 = cookie_dict.get("ct0", "")
|
||||
if not auth_token or not ct0:
|
||||
raise SystemExit("Missing auth_token or ct0 in the provided cookie header.")
|
||||
|
||||
login_string = f"auth_token={auth_token};ct0={ct0}"
|
||||
|
||||
with open("creds.txt", "w") as file:
|
||||
file.write(login_string)
|
||||
Loading…
Add table
Add a link
Reference in a new issue