Skip to content

Instantly share code, notes, and snippets.

@KrammyGod
Last active March 19, 2024 02:34
Show Gist options
  • Save KrammyGod/bca6eb7d424064517d779a5e449d4586 to your computer and use it in GitHub Desktop.
Save KrammyGod/bca6eb7d424064517d779a5e449d4586 to your computer and use it in GitHub Desktop.
Ayaka Autocollector Cookie extraction

Instructions for retrieving cookies

Note: Make sure to reset your cookies if they are exposed (you see unauthorized logins) by logging out of the device where you retrieved the cookie!!

Step 1:

Navigate to hoyolab and sign in.

Step 2a: For PC ONLY!

Open developer tools (Right click + "Inspect Element" OR CTRL + SHIFT + I).
Click the 'Console' tab in the newly opened sidebar.
Type document.cookie, hit ENTER. This is your cookie session that is shared between all your hoyolab games.

Step 2b: Easiest way on mobile (so far)

Type MANUALLY javascript: into the search bar. This allows us to execute javascript code. Then, you can type or copy over document.cookie; (mind the semi-colon). If this doesn't work, try step 2c. Otherwise, copy the cookie into your clipboard.

Step 2c: Safest(?) way of getting cookie on any device (only chrome confirmed so far)

Type MANUALLY javascript: into the search bar. Then, type or copy over prompt("Cookie:", document.cookie); (mind the semi-colon). Copy the cookie into your clipboard.

STEP 2: If the above steps give incorrect cookie, use this workaround to get the correct cookie:

Will be further updated when easier method is found.

Note: This works only on PC

Click on your profile page once you've logged in. It should look something like this:

image

Open inspect element, and click the "Network" tab

image

Now reload the page, DO NOT CLOSE THE TAB.

In the filter section, type getGameRecordCard. You should get exactly one result like shown:

image

Click on the result and scroll down until you see "Request Headers", and "Cookie" as shown:

image

Copy the entire cookie string.

Step 3:

Now you can paste this cookie into the autocollector.

Source Code of auto collector (can be used with a little modification).

Genshin collector was originally from takagg's python script, modified for Node.JS, expanded to all three games.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment