Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env bash
- # prints shortlink to whichever instance (You) are currently in
- # for very strange reasons, you'll have
- # see https://vrchatapi.github.io/#/ for details of the APIs used
- # or just poke around in the network inspector on vrchat.com
- key=JlE5Jldo5Jibnk5O5hTx6XVqsJu4WJ26
- # or you can hardcode these for convenience
- # user=(You)
- # password=hunter2
- echo -n "User: "
- read -s user
- echo
- echo -n "Password: "
- read -s password
- echo
- usr_id=$(curl -u "$user:$password" "https://vrchat.com/api/1/auth/user?apiKey=$key" | jq -r .id)
- echo usr_id: $usr_id
- # uncoment to send yourself a friend request so you can see your own location
- # accept the request in the UI or in game
- # curl -u "$user:$password" -X POST "https://api.vrchat.cloud/api/1/user/$usr_id/friendRequest?apiKey=$key"
- usr=$(curl -u "$user:$password" "https://vrchat.com/api/1/users/$usr_id?apiKey=$key&userId=$usr_id")
- jq . <<< "$usr"
- location=$(jq -r .location <<< "$usr")
- echo location: $location
- shortname=$(curl "https://vrchat.com/api/1/instances/$location/shortName?apiKey=$key")
- echo "https://vrchat.com/i/$shortname"
Add Comment
Please, Sign In to add comment