Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import requests
- placeId = 9472371402 # The Backrooms [REDACTED] / Set this to the Place ID you want to get sub places for
- r = requests.get('https://apis.roblox.com/universes/v1/places/{}/universe'.format(placeId), headers={'User-Agent':'Roblox/WinInet (Kuromian Device)'})
- universeId = r.json()['universeId']
- places_url = f'https://develop.roblox.com/v1/universes/{universeId}/places'
- cursor = ''
- first_request = True
- places_response = requests.get(places_url)
- places_data = places_response.json()
- place_name_page = places_data['data'][0]['name']
- while True:
- if first_request:
- url = places_url
- first_request = False
- else:
- url = f'{places_url}?cursor={cursor}'
- places_response = requests.get(url)
- places_data = places_response.json()
- if places_response.status_code == 200:
- places = places_data['data']
- for place in places:
- place_id = place['id']
- with open(f'{place_name_page}.txt', 'a+', encoding='utf8') as f:
- place_name = place['name']
- f.write(f'Place ID: {place_id}, Place Name: {place_name}\n')
- print('Place ID:', place_id)
- print('Name:', place_name)
- print('------------')
- if not places_data['nextPageCursor']:
- break
- else:
- cursor = places_data['nextPageCursor']
- else:
- print('Error:', places_response.status_code)
- exit()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement