Skip to content

Commit

Permalink
Update - Download Tilesets
Browse files Browse the repository at this point in the history
  • Loading branch information
mu-ramadan committed Feb 23, 2023
1 parent 8bebdc8 commit afb671c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion matterport-dl.py
Original file line number Diff line number Diff line change
Expand Up @@ -420,27 +420,31 @@ def downloadPage(pageid):
downloadFile(tilesetUrl, urlparse(tilesetUrl).path[1:])
tileSet = requests.get(tilesetUrl)
uris = re.findall(r'"uri":"(.+?)"', tileSet.text)
uris.sort()
for uri in uris :
url = tileset['urlTemplate'].replace("<file>", uri)
downloadFile(url, urlparse(url).path[1:])
chunk = requests.get(url)
chunks = re.findall(r'(lod[0-9]_[a-zA-Z0-9-_]+\.(jpg|ktx2))', chunk.text)
chunks.sort()
try:
for ktx2 in chunks:
chunkUri = f"{uri[:2]}{ktx2[0]}"
chunkUrl = tileset['urlTemplate'].replace("<file>", chunkUri)
print(chunkUri)
downloadFile(chunkUrl, urlparse(chunkUrl).path[1:])
except:
pass

try:
for file in range(6):
try:
tileseUrlTemplate = tileset['urlTemplate'].replace("<file>", f'{file}.json')
downloadFile(tileseUrlTemplate, urlparse(tileseUrlTemplate).path[1:])
getFile = requests.get(tileseUrlTemplate)
fileUris = re.findall(r'"uri":"(.*?)"', getFile.text)
fileUris.sort()
for fileuri in fileUris:
print(fileuri)
fileUrl = tileset['urlTemplate'].replace("<file>", fileuri)
downloadFile(fileUrl, urlparse(fileUrl).path[1:])

Expand Down

1 comment on commit afb671c

@cstout1
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if this is where the process is handled, but as of my run this morning it appears there are more missing required assets.
2023-03-13 10:31:35 WARNING 404 error: /models/510ce690174d4049b8928238c5342d6b/assets/mesh_tiles/~/3.json?t=2-b973f1da444c33b3593690551a3f786e2f7acef7-1678728616-1&k=models%2F510ce690174d4049b8928238c5342d6b%2Fassets%2Fmesh_tiles may not be downloading everything right

The "mesh_tiles" folder doesn't exist after a reportedly successful download. Offline viewing of the page halts at the loading page.

Please sign in to comment.