Guest User

currentworld.sh

a guest
Sep 21st, 2020
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.11 KB | None | 0 0
  1. #!/usr/bin/env bash
  2. # prints shortlink to whichever instance (You) are currently in
  3. # for very strange reasons, you'll have
  4. # see https://vrchatapi.github.io/#/ for details of the APIs used
  5. # or just poke around in the network inspector on vrchat.com
  6. key=JlE5Jldo5Jibnk5O5hTx6XVqsJu4WJ26
  7.  
  8. # or you can hardcode these for convenience
  9. # user=(You)
  10. # password=hunter2
  11. echo -n "User: "
  12. read -s user
  13. echo
  14. echo -n "Password: "
  15. read -s password
  16. echo
  17.  
  18. usr_id=$(curl -u "$user:$password" "https://vrchat.com/api/1/auth/user?apiKey=$key" | jq -r .id)
  19. echo usr_id: $usr_id
  20. # uncoment to send yourself a friend request so you can see your own location
  21. # accept the request in the UI or in game
  22. # curl -u "$user:$password" -X POST "https://api.vrchat.cloud/api/1/user/$usr_id/friendRequest?apiKey=$key"
  23.  
  24. usr=$(curl -u "$user:$password" "https://vrchat.com/api/1/users/$usr_id?apiKey=$key&userId=$usr_id")
  25. jq . <<< "$usr"
  26. location=$(jq -r .location <<< "$usr")
  27. echo location: $location
  28. shortname=$(curl "https://vrchat.com/api/1/instances/$location/shortName?apiKey=$key")
  29.  
  30. echo "https://vrchat.com/i/$shortname"
  31.  
  32.  
Add Comment
Please, Sign In to add comment