rebane2001 / matterport-dl

A downloader for matterport virtual tours
The Unlicense
294 stars 75 forks source link

Feature: Add support for downloading matterport models that require authentication #37

Open rebane2001 opened 2 years ago

rebane2001 commented 2 years ago

Quite self-explanatory, use cookies of a logged in account to perform the download.

Here is some sample code that I've confirmed working before with an early version of matterport-dl:

# Put your cookies here in request format (can be found from your browser's devtools->network)
cookies = ""

# Install urllib opener that uses cookies
# Works for every `urllib.request.urlretrieve` already in the code
opener = urllib.request.build_opener()
opener.addheaders = [('cookie', cookies)]
urllib.request.install_opener(opener)

# Use cookies with the requests module
 r = requests.get(f"https://example.com", headers={'cookie':cookies})

Would also be a good idea to implement the cookies.txt format.

loudgazelle commented 2 years ago

I'm assuming the lack of authentication support would prevent me from using this to download videos from the my.matterport.com site, correct?

mitchcapper commented 2 years ago

If you cannot access the video without logging in yes you would need the above, the easier option is just make it unlisted rather htan private, download it, and the make it private again.

loudgazelle commented 2 years ago

The link was provided by my general contractor, I'll see if they have the ability to do that.

rebane2001 commented 2 years ago

If it was just a link you could visit without signing in, then authentication is unnecessary.

loudgazelle commented 2 years ago

the link definitely makes me sign in using a password provided by the general contractor.