rebane2001 / matterport-dl

A downloader for matterport virtual tours
The Unlicense
320 stars 79 forks source link

Temporary fix for all current issues #66

Closed mu-ramadan closed 2 months ago

mu-ramadan commented 2 years ago

Fixes all current issues #63 #55 #64 #65 #39

1- add missing model trims api/v1/jsonstore/model/trims/

2- replace "https://cdn-2.matterport.com/' with local host

3- Patch (graph_GetModelDetails.json & graph_GetSnapshots.json) URLs to Get files form local server instead of https://cdn-2.matterport.com/

4- add missing files like ("headset-quest-2", "360_placement_pin_mask" , Update js files "300", "309", "393", "521", "564", "633", "674", "769", "856", "934"

5- add queries.GetModelPrefetch.data.model.locations[X].pano.skyboxes[Y].urlTemplate to fix missing pano files.

6- update and add additional graph queries, including GetLabels GetModelPolicies GetModelViewPrefetch

patricknelson commented 2 years ago

FWIW, my PR #65 is a fix, not an issue.

Seems like this is a constantly shifting target! Feels like this approach the repository takes may require lots of maintenance. I wonder if there's a more abstract approach that might work a little better long term (e.g. asset/request/response capturing via puppeteer). The base concept seems to still apply, i.e. capture downloaded assets, refactor remote references to instead point to the localhost. 🤔

gene1wood commented 2 years ago

This fixes #75 also

larryqiann commented 1 year ago

JS FILE EXTRACTED BUT not known, please file a github issue and tell us to add: 324.js, will download for you though:)

I am using the latest version in this PR

Additionally, I get

127.0.0.1 - - [15/Oct/2022 11:19:29] "GET /models/b4e4fe930f3a4883bc589d4b112717a6/assets/13945016326d4cad80d485ab4a25a25c_50k.dam?t=2-50d81a19d4a68a68a5b049eb484a04bf72f3d609-1665856060-1 HTTP/1.1" 200 -
----------------------------------------
Exception occurred during processing of request from ('127.0.0.1', 60193)
Traceback (most recent call last):
  File "/opt/homebrew/Cellar/python@3.10/3.10.6_2/Frameworks/Python.framework/Versions/3.10/lib/python3.10/socketserver.py", line 316, in _handle_request_noblock
    self.process_request(request, client_address)
  File "/opt/homebrew/Cellar/python@3.10/3.10.6_2/Frameworks/Python.framework/Versions/3.10/lib/python3.10/socketserver.py", line 347, in process_request
    self.finish_request(request, client_address)
  File "/opt/homebrew/Cellar/python@3.10/3.10.6_2/Frameworks/Python.framework/Versions/3.10/lib/python3.10/socketserver.py", line 360, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/opt/homebrew/Cellar/python@3.10/3.10.6_2/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/server.py", line 658, in __init__
    super().__init__(*args, **kwargs)
  File "/opt/homebrew/Cellar/python@3.10/3.10.6_2/Frameworks/Python.framework/Versions/3.10/lib/python3.10/socketserver.py", line 747, in __init__
    self.handle()
  File "/opt/homebrew/Cellar/python@3.10/3.10.6_2/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/server.py", line 432, in handle
    self.handle_one_request()
  File "/opt/homebrew/Cellar/python@3.10/3.10.6_2/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/server.py", line 420, in handle_one_request
    method()
  File "/Users/mini/Downloads/matterport-dl-main 2/matterport-dl.py", line 548, in do_GET
    SimpleHTTPRequestHandler.do_GET(self)
  File "/opt/homebrew/Cellar/python@3.10/3.10.6_2/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/server.py", line 665, in do_GET
    self.copyfile(f, self.wfile)
  File "/opt/homebrew/Cellar/python@3.10/3.10.6_2/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/server.py", line 865, in copyfile
    shutil.copyfileobj(source, outputfile)
  File "/opt/homebrew/Cellar/python@3.10/3.10.6_2/Frameworks/Python.framework/Versions/3.10/lib/python3.10/shutil.py", line 198, in copyfileobj
    fdst_write(buf)
  File "/opt/homebrew/Cellar/python@3.10/3.10.6_2/Frameworks/Python.framework/Versions/3.10/lib/python3.10/socketserver.py", line 826, in write
    self._sock.sendall(b)
BrokenPipeError: [Errno 32] Broken pipe
----------------------------------------
127.0.0.1 - - [15/Oct/2022 11:19:29] "POST /api/v1/event HTTP/1.1" 200 -
127.0.0.1 - - [15/Oct/2022 11:19:29] code 404, message File not found
127.0.0.1 - - [15/Oct/2022 11:19:29] "GET /models/b4e4fe930f3a4883bc589d4b112717a6/assets/13945016326d4cad80d485ab4a25a25c.dam?t=2-655e8b20f77db4e1bf835b19290d880fc2abbf35-1665856060-1 HTTP/1.1" 404 -

but I am uncertain whether this is a problem with my download

Thanks!

lexybarton commented 1 year ago

This works well after I added 519.js which I obtained using this Save All Resources chrome extension

larryqiann commented 1 year ago

Yes, I have tested with 519.js added and it is working correctly now on my end, both the advanced and the default download

MarcosPer commented 1 year ago

I Download with these errors.

JS FILE EXTRACTED BUT not known, please file a github issue and tell us to add: 324.js, will download for you though:) JS FILE EXTRACTED BUT not known, please file a github issue and tell us to add: 378.js, will download for you though:) JS FILE EXTRACTED BUT not known, please file a github issue and tell us to add: 512.js, will download for you though:) JS FILE EXTRACTED BUT not known, please file a github issue and tell us to add: 866.js, will download for you though:)

The download doesn't work i will try to to add in js_files array but fail

rebane2001 commented 1 year ago

@mu-ramadan I'm not actively maintaing this repo myself, would you like to be added as a contributor?

MarcosPer commented 1 year ago

I find a bug! It fails loading .dam file with listen != localhost

http://127.0.0.1:8080/models/xxxxx/assets/xxxxxxxxxx.dam?t=2-xxxxxxxxxxxxxxx I run it matterport-dl with python3 matterport-dl.py 192.168.1.15 8080

The browser loads assets correctly but dam file doen't load correctly by showcase.js file (it's minified). In localhost works great http://127.0.0.1:8080/models/xxxxx/assets/xxxxxxxxxx.dam?t=2-xxxxxxxxxxxxxxx

winder commented 1 year ago

More of these js files...

Unfortunately, even with these changes, the download I'm using doesn't seem to work.

JS FILE EXTRACTED BUT not known, please file a github issue and tell us to add: 189.js, will download for you though:)
JS FILE EXTRACTED BUT not known, please file a github issue and tell us to add: 324.js, will download for you though:)
JS FILE EXTRACTED BUT not known, please file a github issue and tell us to add: 498.js, will download for you though:)
JS FILE EXTRACTED BUT not known, please file a github issue and tell us to add: 512.js, will download for you though:)
JS FILE EXTRACTED BUT not known, please file a github issue and tell us to add: 514.js, will download for you though:)
diff --git a/matterport-dl.py b/matterport-dl.py
index 3715eea..5133d8d 100644
--- a/matterport-dl.py
+++ b/matterport-dl.py
@@ -160,7 +160,7 @@ def downloadAssets(base):
         "30", "46", "47", "66", "79", "134", "136", "143", "164", "250", "251", "316", "321", "356", "371", "376", "383", "386", "422", "423",
         "464", "524", "525", "539", "580", "584", "606", "614", "666", "670", "718", "721", "726", "755", "764", "828", "833", "838", "932",
          "947", "300", "309", "393", "521", "564", "633", "674", "769", "856", "934", "207","260","385","58","794","976","995", "330", "39", "519",
-          "399","438", "62", "76", "926", "933"]
+         "399","438", "62", "76", "926", "933", "189", "324", "498", "512", "514"]

     language_codes = ["af", "sq", "ar-SA", "ar-IQ", "ar-EG", "ar-LY", "ar-DZ", "ar-MA", "ar-TN", "ar-OM",
                       "ar-YE", "ar-SY", "ar-JO", "ar-LB", "ar-KW", "ar-AE", "ar-BH", "ar-QA", "eu", "bg",
mu-ramadan commented 1 year ago

@mu-ramadan I'm not actively maintaing this repo myself, would you like to be added as a contributor?

Yes,that would be great.

ALenfant commented 1 year ago

@rebane2001 Thanks for all your work, the tool is amazing! @mu-ramadan did awesome follow-up work of making the codebase work with current models, it would be great if this PR could be merged! I'm looking into https://github.com/rebane2001/matterport-dl/issues/72 and it would help to be able to contribute on an already working codebase :]

jdstone commented 1 year ago

NOTE 1: Apologies for posting this here since a temporary fix already exists in #72. NOTE 2: Please let me know if you'd like me to delete this comment.

I just checked out this PR and ran it. It downloads the model and gives no errors. But when I run the web server to view it, it sits at the "loading" screen and shows these notes in the browser developer console:

image

This is where it sits at:

image

This shows in the output of the command.

127.0.0.1 - - [22/Feb/2023 12:02:11] "GET /js/519.js HTTP/1.1" 304 -
127.0.0.1 - - [22/Feb/2023 12:02:11] "GET /js/933.js HTTP/1.1" 304 -
127.0.0.1 - - [22/Feb/2023 12:02:11] code 404, message File not found
127.0.0.1 - - [22/Feb/2023 12:02:11] "GET /models/c5e7a343b66b4ec79477fa2b34131e80/assets/mesh_tiles/~/3.json?t=2-c35164b52c8fff6ad6f44d8d4f9be317c1962927-1677095914-1&k=models%2Fc5e7a343b66b4ec79477fa2b34131e80%2Fassets%2Fmesh_tiles HTTP/1.1" 404 -
127.0.0.1 - - [22/Feb/2023 12:02:11] "GET /api/v1/jsonstore/model/trims/87ehWawBGLj HTTP/1.1" 304 -
127.0.0.1 - - [22/Feb/2023 12:02:11] "GET /fonts/mp-font.woff2?05f86168c00eb19af4408a91c7122b10 HTTP/1.1" 304 -
127.0.0.1 - - [22/Feb/2023 12:02:11] "GET /fonts/roboto-700.woff2 HTTP/1.1" 304 -

Here is the full output of the command.

View in browser: http://127.0.0.1:8080
127.0.0.1 - - [22/Feb/2023 12:11:14] "GET / HTTP/1.1" 304 -
127.0.0.1 - - [22/Feb/2023 12:11:14] "GET /css/showcase.css HTTP/1.1" 304 -
127.0.0.1 - - [22/Feb/2023 12:11:14] "GET /css/unsupported_browser.css HTTP/1.1" 304 -
127.0.0.1 - - [22/Feb/2023 12:11:14] "GET /webgl-vendors/three/0.146.0/three.min.js HTTP/1.1" 304 -
127.0.0.1 - - [22/Feb/2023 12:11:14] "GET /js/browser-check.js HTTP/1.1" 304 -
127.0.0.1 - - [22/Feb/2023 12:11:14] "GET /js/showcase.js HTTP/1.1" 304 -
127.0.0.1 - - [22/Feb/2023 12:11:14] "GET /?m=87ehWawBGLj HTTP/1.1" 304 -
127.0.0.1 - - [22/Feb/2023 12:11:14] "GET //api/v2/users/current HTTP/1.1" 304 -
127.0.0.1 - - [22/Feb/2023 12:11:14] "GET /js/995.js HTTP/1.1" 304 -
127.0.0.1 - - [22/Feb/2023 12:11:14] "GET /js/514.js HTTP/1.1" 304 -
127.0.0.1 - - [22/Feb/2023 12:11:14] "GET /js/136.js HTTP/1.1" 304 -
127.0.0.1 - - [22/Feb/2023 12:11:14] "GET /js/189.js HTTP/1.1" 304 -
127.0.0.1 - - [22/Feb/2023 12:11:14] "POST /api/mp/models/graph HTTP/1.1" 200 -
127.0.0.1 - - [22/Feb/2023 12:11:14] "GET /fonts/roboto-regular.woff2 HTTP/1.1" 304 -
127.0.0.1 - - [22/Feb/2023 12:11:14] "GET /locale/strings.json HTTP/1.1" 304 -
127.0.0.1 - - [22/Feb/2023 12:11:15] "POST /api/mp/models/graph HTTP/1.1" 200 -
127.0.0.1 - - [22/Feb/2023 12:11:15] "GET /js/47.js HTTP/1.1" 304 -
127.0.0.1 - - [22/Feb/2023 12:11:15] "GET /js/764.js HTTP/1.1" 304 -
127.0.0.1 - - [22/Feb/2023 12:11:15] "GET /js/917.js HTTP/1.1" 304 -
127.0.0.1 - - [22/Feb/2023 12:11:15] "GET /js/58.js HTTP/1.1" 304 -
127.0.0.1 - - [22/Feb/2023 12:11:15] "GET /css/core.css HTTP/1.1" 304 -
127.0.0.1 - - [22/Feb/2023 12:11:15] "GET /js/321.js HTTP/1.1" 304 -
127.0.0.1 - - [22/Feb/2023 12:11:15] "POST /api/mp/models/graph HTTP/1.1" 200 -
127.0.0.1 - - [22/Feb/2023 12:11:15] "POST /api/mp/models/graph HTTP/1.1" 200 -
127.0.0.1 - - [22/Feb/2023 12:11:15] "GET /images/matterport-logo-light.svg HTTP/1.1" 304 -
127.0.0.1 - - [22/Feb/2023 12:11:15] "GET /js/512.js HTTP/1.1" 304 -
127.0.0.1 - - [22/Feb/2023 12:11:15] "GET /js/833.js HTTP/1.1" 304 -
127.0.0.1 - - [22/Feb/2023 12:11:15] "GET /js/837.js HTTP/1.1" 304 -
127.0.0.1 - - [22/Feb/2023 12:11:15] "GET /css/split.css HTTP/1.1" 304 -
127.0.0.1 - - [22/Feb/2023 12:11:15] "GET /api/v1/player/models/87ehWawBGLj/thumb?width=1664&dpr=1.5&disable=upscale HTTP/1.1" 304 -
127.0.0.1 - - [22/Feb/2023 12:11:15] "GET /fonts/roboto-300.woff2 HTTP/1.1" 304 -
127.0.0.1 - - [22/Feb/2023 12:11:15] "GET /fonts/ibm-plex-sans-700.woff2 HTTP/1.1" 304 -
127.0.0.1 - - [22/Feb/2023 12:11:15] "GET /fonts/ibm-plex-sans-500.woff2 HTTP/1.1" 304 -
127.0.0.1 - - [22/Feb/2023 12:11:15] "POST /api/v1/event HTTP/1.1" 200 -
127.0.0.1 - - [22/Feb/2023 12:11:15] "GET /js/324.js HTTP/1.1" 304 -
127.0.0.1 - - [22/Feb/2023 12:11:15] "GET /js/62.js HTTP/1.1" 304 -
127.0.0.1 - - [22/Feb/2023 12:11:15] "GET /js/519.js HTTP/1.1" 304 -
127.0.0.1 - - [22/Feb/2023 12:11:15] "GET /js/933.js HTTP/1.1" 304 -
127.0.0.1 - - [22/Feb/2023 12:11:15] code 404, message File not found
127.0.0.1 - - [22/Feb/2023 12:11:15] "GET /models/c5e7a343b66b4ec79477fa2b34131e80/assets/mesh_tiles/~/3.json?t=2-c35164b52c8fff6ad6f44d8d4f9be317c1962927-1677095914-1&k=models%2Fc5e7a343b66b4ec79477fa2b34131e80%2Fassets%2Fmesh_tiles HTTP/1.1" 404 -
127.0.0.1 - - [22/Feb/2023 12:11:15] "GET /api/v1/jsonstore/model/trims/87ehWawBGLj HTTP/1.1" 304 -
127.0.0.1 - - [22/Feb/2023 12:11:15] "GET /fonts/mp-font.woff2?05f86168c00eb19af4408a91c7122b10 HTTP/1.1" 304 -
127.0.0.1 - - [22/Feb/2023 12:11:15] "GET /fonts/roboto-700.woff2 HTTP/1.1" 304 -
127.0.0.1 - - [22/Feb/2023 12:11:15] "GET /images/nav_help_mouse_drag_left.png HTTP/1.1" 304 -
127.0.0.1 - - [22/Feb/2023 12:11:15] "GET /images/nav_help_keyboard_left_right.png HTTP/1.1" 304 -
127.0.0.1 - - [22/Feb/2023 12:11:15] "GET /images/nav_help_mouse_click.png HTTP/1.1" 304 -
127.0.0.1 - - [22/Feb/2023 12:11:15] "GET /images/nav_help_keyboard_up_down.png HTTP/1.1" 304 -
127.0.0.1 - - [22/Feb/2023 12:11:15] "GET /images/nav_help_mouse_zoom.png HTTP/1.1" 304 -
127.0.0.1 - - [22/Feb/2023 12:11:15] "GET /images/nav_help_zoom_keys.png HTTP/1.1" 304 -
jackboyce commented 1 year ago

I came across the same issue @jdstone and wrote an additional patch to @mu-ramadan 's code. Here is the code I added to line 306:

j = re.sub(r"(tilesets\"\s:\s[\s{)([\S\s]*?)(}\s]\,)", "tilesets\" : [ {} ],", j)

fligtar commented 1 year ago

@jackboyce Your change fixed my issue -- thank you! Using @mu-ramadan 's latest, I was able to view my download while connected to the internet, but it would not load when I turned off wifi. With your change, it works entirely offline.

One note: I had to escape the quotes in your line for it to parse properly, like so: j = re.sub(r"(tilesets\"\s:\s[\s{)([\S\s]*?)(}\s],)", "tilesets\" : [ {} ],", j)

VitalNonsense commented 1 year ago

@jackboyce Your change fixed my issue -- thank you! Using @mu-ramadan 's latest, I was able to view my download while connected to the internet, but it would not load when I turned off wifi. With your change, it works entirely offline.

One note: I had to escape the quotes in your line for it to parse properly, like so: j = re.sub(r"(tilesets\"\s:\s[\s{)([\S\s]*?)(}\s],)", "tilesets\" : [ {} ],", j)

Thanks to both of you, I was able to resolve my issues today. This change in code made my downloads today function properly.

rolledback commented 1 year ago

@jackboyce Your change fixed my issue -- thank you! Using @mu-ramadan 's latest, I was able to view my download while connected to the internet, but it would not load when I turned off wifi. With your change, it works entirely offline.

One note: I had to escape the quotes in your line for it to parse properly, like so: j = re.sub(r"(tilesets\"\s:\s[\s{)([\S\s]*?)(}\s],)", "tilesets\" : [ {} ],", j)

Also worked for me! Though one thing I had to figure out which I didn't notice elsewhere was I needed to use the --advanced-download flag! Without it, the local version wouldn't load.

jakemauer commented 1 year ago

Just wanted to say thanks to @mu-ramadan for fixing enough issues to get this running. I hope the original maintainer comes back and merges it in or cedes control of the repo.

rebane2001 commented 1 year ago

Huh, I thought I already added @mu-ramadan to the repo last year, but apparently I didn't? In any case I sent out the invite now, thank you for all of your work on maintaining this tool!

jakemauer commented 1 year ago

Awesome thanks for that @rebane2001 and thanks for all your work making this in the first place!

ideasxiang commented 1 year ago

Any solution for "Error: No layers to read for view!", really appreciate!

ideasxiang commented 1 year ago

Thank you so so much! Really !!

Massaaali commented 10 months ago

EDIT: So, I don't know what I supposedly did different, but started again from scratch, and now the model downloaded without errors and works like a charm. Thank you so much for all of your work!

Earlier post:

Hi! Thank you for your work! I wrote this to the reddit thread, but figured out I might get luckier here. So, I tried running this on one model, and it gave me an error:

Patching graph_GetModelDetails.json URLs
Traceback (most recent call last):
File "C:\temp\matterport-dl-main\matterport-dl.py", line 679, in <module>
initiateDownload(pageId)
File "C:\temp\matterport-dl-main\matterport-dl.py", line 544, in initiateDownload
downloadPage(getPageId(url))
File "C:\temp\matterport-dl-main\matterport-dl.py", line 534, in downloadPage
patchGetModelDetails()
File "C:\temp\matterport-dl-main\matterport-dl.py", line 303, in patchGetModelDetails
with open(f"api/mp/models/graph_GetModelDetails.json", "r", encoding="UTF-8") as f:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: 'api/mp/models/graph_GetModelDetails.json'

There is no such file (graph_GetModelDetails.json) in the directory, just a pretty much empty file called graph.

Just to test it out, I created the file graph_GetModelDetails.json basically by copying and renaming the GetModelDetails.json to the directory in question (I know it's silly, but I wanted to test). After this it stopped with the same error but referenced graph_GetSnapshots.json instead. After repeating the process the next reference was graph_GetModelViewPrefetch.json. After I "created" all these files, the whole download ran through without errors and downloaded hundreds of megabytes of more stuff into the model directory.

Still getting the Oops-message when trying to view though. Nothing concerning on the console when running on localhost as far as I can tell, but after quitting there is this line in the server.log:

INFO Handling a post request on /api/mp/models/graph: graph for operationName: GetModelPolicies we don't know how to handle, but likely could add support, returning empty instead".

How would I go about debugging this? I'm kind of on a schedule, as the model I'm trying to download will most likely get removed or expire soon.

If you need any more info, I'll provide it the best I can.

Thank you so much in advance!

EDIT: For the heck of it I copied the GetModelPolicies via the previous process into the directory that gave me trouble earlier while adding a graph_ in front of the filename, and now the server log text changed into Handling a post request on /api/mp/models/graph: graph of operationName: GetModelPolicies we are handling internally, but still just showing the Oops-message on my browser.

Scotho commented 10 months ago

Unfortunately I am experiencing the exact same issue as @Massaaali, but starting again from scratch did not resolve my issue

WttBe commented 10 months ago

I am encountering the same issue as @Massaaali and @Scotho. Did you find a solution? Thanks!

Massaaali commented 10 months ago

I am encountering the same issue as @Massaaali and @Scotho. Did you find a solution? Thanks!

I got it working, but unfortunately don't really know what got me there in the end. I did redo the installation of python libraries at some point to make sure that all the libraries were installed to the same user in the system. Unsure whether this was just before I got it working and I think they were supposedly correct to begin with. Sorry that I cannot be of any more help. :(

jackboyce commented 10 months ago

I am encountering the same issue as @Massaaali and @Scotho. Did you find a solution? Thanks!

Can you check in your file explore and see if the file it is trying to access exists? Are there other files in that folder as well?

WttBe commented 10 months ago

@Massaaali Thanks, I'll try installing the libraries again as well!

@jackboyce Here is what I get in the terminal: 127.0.0.1 - - [04/Dec/2023 21:25:31] "GET / HTTP/1.1" 304 - 127.0.0.1 - - [04/Dec/2023 21:25:31] "GET /js/showcase.js HTTP/1.1" 304 - 127.0.0.1 - - [04/Dec/2023 21:25:31] "GET /?m=gsn**** HTTP/1.1" 304 - 127.0.0.1 - - [04/Dec/2023 21:25:32] "POST /api/mp/models/graph HTTP/1.1" 200 - 127.0.0.1 - - [04/Dec/2023 21:25:32] "POST /api/v1/event HTTP/1.1" 200 -

I kept all the files related to Matterport in one folder, and put the folder in C: to keep it simple.

Update: I updated the libraries and downloaded the files again, but the result is still the same.

Massaaali commented 9 months ago

Right. So all was well, had a working model, even after the original model went offline. Did the latest update by mu-ramadan to fix the stuck at 50 % -issue. No problems. Now all of a sudden when I tried to access the model again, it starts loading as usual, but then after a half or so loaded just switches to the Oops-error. As if something has expired or something, even though that's supposedly fixed already?

Server.log had the following line: 2023-12-17 21:05:32 WARNING 404 error: /api/v1/jsonstore/model/plugins/tourIDhere may not be downloading everything right

Any guesses? There doesn't seem to be a tourIDhere directory under plugins. If I create one, the same thing (Oops...) happens without the error message.

EDIT: I tried to download a few other virtual tours just to see what would get downloaded into the folder mentioned above. Was however unsuccessful, with the following end result:

Downloading base page...
Doing advanced download of dollhouse/floorplan data...
Downloading static assets...
JS FILE EXTRACTED, 217.js
JS FILE EXTRACTED, 231.js
JS FILE EXTRACTED, 27.js
JS FILE EXTRACTED, 324.js
JS FILE EXTRACTED, 325.js
JS FILE EXTRACTED, 327.js
JS FILE EXTRACTED, 33.js
JS FILE EXTRACTED, 378.js
JS FILE EXTRACTED, 401.js
JS FILE EXTRACTED, 477.js
JS FILE EXTRACTED, 625.js
JS FILE EXTRACTED, 648.js
JS FILE EXTRACTED, 662.js
JS FILE EXTRACTED, 679.js
JS FILE EXTRACTED, 782.js
JS FILE EXTRACTED, 858.js
JS FILE EXTRACTED, 948.js
JS FILE EXTRACTED, 952.js
JS FILE EXTRACTED, 958.js
JS FILE EXTRACTED, 983.js
Downloading model info...
Downloading images...
Downloading graph model data...
Patching graph_GetModelDetails.json URLs
Downloading model ID: tourIDhere ...
Traceback (most recent call last):
  File "C:\Users\UserID\AppData\Local\Programs\Python\Python312\matterport-dl.py", line 121, in downloadFile
    _filename, headers = urllib.request.urlretrieve(
  File "C:\Program Files\Python310\lib\urllib\request.py", line 241, in urlretrieve
    with contextlib.closing(urlopen(url, data)) as fp:
  File "C:\Program Files\Python310\lib\urllib\request.py", line 216, in urlopen
    return opener.open(url, data, timeout)
  File "C:\Program Files\Python310\lib\urllib\request.py", line 525, in open
    response = meth(req, response)
  File "C:\Program Files\Python310\lib\urllib\request.py", line 634, in http_response
    response = self.parent.error(
  File "C:\Program Files\Python310\lib\urllib\request.py", line 563, in error
    return self._call_chain(*args)
  File "C:\Program Files\Python310\lib\urllib\request.py", line 496, in _call_chain
    result = func(*args)
  File "C:\Program Files\Python310\lib\urllib\request.py", line 643, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 401: Unauthorized

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\UserID\AppData\Local\Programs\Python\Python312\matterport-dl.py", line 680, in <module>
    initiateDownload(pageId)
  File "C:\Users\UserID\AppData\Local\Programs\Python\Python312\matterport-dl.py", line 545, in initiateDownload
    downloadPage(getPageId(url))
  File "C:\Users\UserID\AppData\Local\Programs\Python\Python312\matterport-dl.py", line 537, in downloadPage
    downloadModel(pageid, accessurl)
  File "C:\Users\UserID\AppData\Local\Programs\Python\Python312\matterport-dl.py", line 279, in downloadModel
    downloadUUID(accessurl, modeldata["job"]["uuid"])
  File "C:\Users\UserID\AppData\Local\Programs\Python\Python312\matterport-dl.py", line 48, in downloadUUID
    downloadFile(accessurl.format(
  File "C:\Users\UserID\AppData\Local\Programs\Python\Python312\matterport-dl.py", line 144, in downloadFile
    raise Exception
Exception

This "unauthorized" thing seems to happen with each tour I try at the moment. So either Matterport did something to stop this, or then I'm getting paranoid. The thing I'm mostly baffled about is that the previously saved model, which was working before, doesn't work now even if I'm completely offline.

Massaaali commented 9 months ago

After the latest update to matterport-dl.py new downloads are working again, but my old download (which used to work just fine) is still giving me the Oops-error after starting to load and loading up to halfway or so. The only clue is the server.log message 2023-12-17 21:05:32 WARNING 404 error: /api/v1/jsonstore/model/plugins/tourIDhere may not be downloading everything right

I have tried to create a plugins directory with an empty file named as tourIDhere, but it just makes the error go away, but still the same experience (Oops...).

Also, no other tours I try to download neither create nor check the directory plugins under the aforementioned path.

Has anyone else stumbled upon this plugins-thing? I cannot find any references to "plugins" in either the py-files or the index file, so I'm lost as to what makes it try and access that url to begin with. And since the downloaded tour used to work, but now works neither on- nor offline, I don't know what to do. The original tour is already offline, so sadly I cannot try and redownload it...

Massaaali commented 9 months ago

After the latest update to matterport-dl.py new downloads are working again, but my old download (which used to work just fine) is still giving me the Oops-error after starting to load and loading up to halfway or so. The only clue is the server.log message 2023-12-17 21:05:32 WARNING 404 error: /api/v1/jsonstore/model/plugins/tourIDhere may not be downloading everything right

I have tried to create a plugins directory with an empty file named as tourIDhere, but it just makes the error go away, but still the same experience (Oops...).

Also, no other tours I try to download neither create nor check the directory plugins under the aforementioned path.

Has anyone else stumbled upon this plugins-thing? I cannot find any references to "plugins" in either the py-files or the index file, so I'm lost as to what makes it try and access that url to begin with. And since the downloaded tour used to work, but now works neither on- nor offline, I don't know what to do. The original tour is already offline, so sadly I cannot try and redownload it...

Now I've found another tour that, when downloaded, checks for the plugins-directory. Doesn't find it either (doesn't exist) and gives a 404, but still works. Offline as well. Very, very strange. In this case the source tour is still online, but it shouldn't matter as the download works offline as well...

AndrewBudziszek commented 9 months ago

I just wanted to say, thanks for making this PR. It let me save and view my virtual walk through. I'm excited to look through it in 10 years to relive some memories.

You should consider forking this into your own project. It doesn't look like this is maintained anymore. I think this is a great tool that will bring smiles to a lot of people's faces.

Thank you for your hard work on this!

Massaaali commented 9 months ago

After the latest update to matterport-dl.py new downloads are working again, but my old download (which used to work just fine) is still giving me the Oops-error after starting to load and loading up to halfway or so. The only clue is the server.log message 2023-12-17 21:05:32 WARNING 404 error: /api/v1/jsonstore/model/plugins/tourIDhere may not be downloading everything right I have tried to create a plugins directory with an empty file named as tourIDhere, but it just makes the error go away, but still the same experience (Oops...). Also, no other tours I try to download neither create nor check the directory plugins under the aforementioned path. Has anyone else stumbled upon this plugins-thing? I cannot find any references to "plugins" in either the py-files or the index file, so I'm lost as to what makes it try and access that url to begin with. And since the downloaded tour used to work, but now works neither on- nor offline, I don't know what to do. The original tour is already offline, so sadly I cannot try and redownload it...

Now I've found another tour that, when downloaded, checks for the plugins-directory. Doesn't find it either (doesn't exist) and gives a 404, but still works. Offline as well. Very, very strange. In this case the source tour is still online, but it shouldn't matter as the download works offline as well...

So, this ended up being a user error which had nothing to do with the plugins-queries in the logs. Or at least they needn't be solved for this to be solved. I had tried different browsers before, but that didn't help. Now when I emptied the cache of one browser, it started working. So, user error.

Thank you for a great piece of code!

nicolas-charon commented 7 months ago

@mu-ramadan Just tried your fork here https://github.com/mu-ramadan/matterport-dl but unfortunately it doesn't seem to work anymore, getting stuck at the viewing stage with "PermissionError: [WinError 5] Access is denied: 'jqBGKDhniXB'". Any chance you know a fix for this?

I did manage to download the whole thing I think: https://i.imgur.com/kNZ4NLA.png

However when trying to view the space with this command

matterport-dl.py "https://my.matterport.com/show/?m=jqBGKDhniXB" 127.0.0.1 8080

the first frame loads for a couple seconds https://i.imgur.com/ISPBR7e.png

and then I get hit with "Oops, model not available" https://i.imgur.com/bFjQ8Qu.png

Tried it in Incognito or different browsers, same result. I'm also not missing the folder that these people said was missing from their directory since I did use --advanced-download: https://i.imgur.com/VZtJPHM.png

These are the command line errors https://i.imgur.com/5k4l539.png

Any idea what I could do? Appreciate the help, hopefully will manage to save my hometour before the realtor takes it down :)

linkssystem commented 6 months ago

I have the same problem as described above. Does anyone have a solution to this problem? It says this: FileNotFoundError: [Errno 2] No such file or directory: 'api/mp/models/graph_GetModelDetails.json' I uploaded the new update from yesterday 03.31.2024, but the problem remains. I don't know, am I doing something wrong?

ideasxiang commented 5 months ago

Hi Ramadan

I seem to be receiving this error: showcase.js:2 Uncaught (in promise) Forbidden: Access denied (403) at L.modelExists (http://127.0.0.1:8080/js/showcase.js:2:579413) at async Qe.loginToModel (

Is this because Matterport-dl requires authentication? Is there any way around this

Thank you!

On Tue, Apr 2, 2024 at 3:46 AM linkssystem @.***> wrote:

I have the same problem as described above. Does anyone have a solution to this problem? It says this: FileNotFoundError: [Errno 2] No such file or directory: 'api/mp/models/graph_GetModelDetails.json' I uploaded the new update from yesterday 03.31.2024, but the problem remains. I don't know, am I doing something wrong?

— Reply to this email directly, view it on GitHub https://github.com/rebane2001/matterport-dl/pull/66#issuecomment-2030439721, or unsubscribe https://github.com/notifications/unsubscribe-auth/AF5PZFI4EKLO26F2XTGP2G3Y3G2S3AVCNFSM53SAUS22U5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TEMBTGA2DGOJXGIYQ . You are receiving this because you commented.Message ID: @.***>

RRomain14 commented 5 months ago

Hello,

I encountered the same error as @ideasxiang when inspecting browser console on 127.0.0.1:8080 :

[engine] 0.034s Forbidden: Access denied (403) s http://127.0.0.1:8080/js/showcase.js:2 s http://127.0.0.1:8080/js/showcase.js:2 a http://127.0.0.1:8080/js/showcase.js:2 modelExists http://127.0.0.1:8080/js/showcase.js:2 loginToModel http://127.0.0.1:8080/js/showcase.js:17 startAuthAndPolicyModules http://127.0.0.1:8080/js/showcase.js:17 load http://127.0.0.1:8080/js/showcase.js:17 loadApplication http://127.0.0.1:8080/js/showcase.js:17 n http://127.0.0.1:8080/js/showcase.js:17

http://127.0.0.1:8080/js/showcase.js:17 http://127.0.0.1:8080/?m=8PdTekNZEzW:132 I wonder if it may be linked to this one in server.log, since both look like authentication/account issues : WARNING 404 error: /api/mp/accounts/graph may not be downloading everything right (It doesn't appear in my files either, and there is nothing containing "account" in run_report.log) Has anyone tried anything that has worked ? Thank you and have a nice day.
nilpunning commented 5 months ago

@ideasxiang, @RRomain14 I've seen the same issue and have a fix on my fork: https://github.com/nilpunning/matterport-dl. @mu-ramadan, I've opened this PR for you to pull in this fix to your branch: https://github.com/mu-ramadan/matterport-dl/pull/2.

ideasxiang commented 5 months ago

Hi @nilpunning thanks! I am facing a client 401 error, any idea how to fix?

Traceback (most recent call last): File "C:\Users\chang\Downloads\matterport-dl\matterport-dl.py", line 129, in downloadFile response.raise_for_status() # Raise an exception if the response has an error status code ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\chang\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\requests\models.py", line 1021, in raise_for_status raise HTTPError(http_error_msg, response=self) requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: https://cdn-2.matterport.com/models/4ed511e322834aa9be89e32985180fe9/assets/~/3c7ed17cabf74cf096172ccca8caf16a_50k.dam?t=2-40f4094a09234232e065e269bd2ceff5a163db50-1715176422-1

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Users\chang\Downloads\matterport-dl\matterport-dl.py", line 689, in initiateDownload(pageId) File "C:\Users\chang\Downloads\matterport-dl\matterport-dl.py", line 554, in initiateDownload downloadPage(getPageId(url)) File "C:\Users\chang\Downloads\matterport-dl\matterport-dl.py", line 546, in downloadPage downloadModel(pageid, accessurl) File "C:\Users\chang\Downloads\matterport-dl\matterport-dl.py", line 288, in downloadModel downloadUUID(accessurl, modeldata["job"]["uuid"]) File "C:\Users\chang\Downloads\matterport-dl\matterport-dl.py", line 48, in downloadUUID downloadFile(accessurl.format( File "C:\Users\chang\Downloads\matterport-dl\matterport-dl.py", line 154, in downloadFile raise Exception Exception

ni0ki commented 4 months ago

Hello ! I'm stumbling on this nice little project which may definitely be of use to me.

I've been forking the work of @mu-ramadan as well, and fixed most of the 401 | 403. (There are still some , unfortunately, might be due to differences across shows, but it did not block me.)

This is likely due to Cloudflare, as a CDN, preventing HTTP libraries to work as expected. Replacing requests with curl_cffi, I was able to get much more success. Along with the MR of @nilpunning, I was able to get a complete show downloaded and working.

As a result:

chromepro88 commented 3 months ago

Thanks @ni0ki ! I am having the following error Downloading base page... Downloading static assets... Traceback (most recent call last): File "/Users/chang/Documents/new/matterport-dl/matterport-dl.py", line 129, in downloadFile response.raise_for_status() # Raise an exception if the response has an error status code ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/chang/.pyenv/versions/3.12.3/lib/python3.12/site-packages/curl_cffi/requests/models.py", line 136, in raise_for_status raise RequestsError(f"HTTP Error {self.status_code}: {self.reason}") curl_cffi.requests.errors.RequestsError: HTTP Error 404:

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/Users/chang/Documents/new/matterport-dl/matterport-dl.py", line 689, in initiateDownload(pageId) File "/Users/chang/Documents/new/matterport-dl/matterport-dl.py", line 554, in initiateDownload downloadPage(getPageId(url)) File "/Users/chang/Documents/new/matterport-dl/matterport-dl.py", line 533, in downloadPage downloadAssets(staticbase) File "/Users/chang/Documents/new/matterport-dl/matterport-dl.py", line 208, in downloadAssets downloadFile("https://my.matterport.com/favicon.ico", "favicon.ico") File "/Users/chang/Documents/new/matterport-dl/matterport-dl.py", line 154, in downloadFile raise Exception Exception

ni0ki commented 3 months ago

@chromepro88 Would you be able to share the URL from which you're trying to download so I can reproduce ?

chromepro88 commented 3 months ago

@ni0ki sure! https://my.matterport.com/show/?m=LTSFPXuTCsN

ni0ki commented 3 months ago

Edit: Will double-check the PR of @chromepro88. Thanks 👍

@chromepro88 There are 2 problems: First one is quite stupid and we just need to make the favicon download optional, which is pretty straightforward to do. ~~2nd one is a bit more difficult to overcome, as it seems even with curl_cffi, cloudflare is returning 403, so requests are blocked. This mean we need to find again another way to bypass this. I'll try to find some time to investigate asap~~

chromepro88 commented 3 months ago

@ni0ki this seems to work for me https://github.com/ni0ki/matterport-dl/pull/1 thanks!