rebane2001 / matterport-dl

A downloader for matterport virtual tours
The Unlicense
291 stars 73 forks source link

Still have an authentification issue, is it an integration problem ? #69

Open renoproc opened 1 year ago

renoproc commented 1 year ago

Hi, two weeks ago I opened the issue #67 and reban2001 redirect me on the solution Authentification required #37. To resume : I've a free matterport account, a company sent a model on it, but because my account is free it is only visible in private mode.

Today I tried to integrate the proposed solution, with the help of the following 2 urls because I don't know Python : How to use cookies in python requests and How to send cookie with urllib opener.

I still have the issue

Downloading base page... Traceback (most recent call last): File "/.../matterport-dl-brute-js/matterport-dl.py", line 595, in initiateDownload(pageId) File "/.../matterport-dl-brute-js/matterport-dl.py", line 469, in initiateDownload downloadPage(getPageId(url)) File "/.../matterport-dl-brute-js/matterport-dl.py", line 389, in downloadPage raise Exception("Can't find urls") Exception: Can't find urls

I suppose my modification is crappy and I don't see how to fix it.

Here is my dirty modification : At the beginning of the script I set these two variables, just after SHOWCASE_INTERNAL_NAME myCookieGet={"cookie_consent_v3":"value_of_my_cookie"} myCookieHeader="cookie_consent_v3=value_of_my_cookie"

I've replaced line 379 r = requests.get(f"https://my.matterport.com/show/?m={pageid}") with r = requests.get(f"https://my.matterport.com/show/?m={pageid}",cookies=myCookieGet)

Also line 390 file_type_content = requests.get(f"https://my.matterport.com/api/player/models/{pageid}/files?type=3") #get a valid access key, there are a few but this is a common client used one, this also makes sure it is fresh with
file_type_content = requests.get(f"https://my.matterport.com/api/player/models/{pageid}/files?type=3", cookies=myCookieGet)

And line 568 opener.addheaders = [('User-Agent','Mozilla/5.0 (Windows NT 10.0; Win64; x64)'),('x-matterport-application-name','showcase')] with opener.addheaders = [('User-Agent','Mozilla/5.0 (Windows NT 10.0; Win64; x64)'),('x-matterport-application-name','showcase'),('Cookie',myCookieHeader)]

If reban2001 or someone with Python3 knowledge could help me a little bit, that could be cool. Thanks