Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No cameras found #67

Closed
awhiskin opened this issue Sep 23, 2021 · 5 comments
Closed

No cameras found #67

awhiskin opened this issue Sep 23, 2021 · 5 comments
Assignees

Comments

@awhiskin
Copy link

awhiskin commented Sep 23, 2021

Hey there,

Just having some trouble with the tool - I've managed to get it working (I think..) in Docker, but now getting the following response:

docker run --volume /tmp:/downloads unifitoolbox/protect-archiver download --address 172.16.31.1 --username="redacted" --password="redacted" --use-subfolders --start="2021-08-31 07:00:00" --end="2021-08-31 17:00:00" /downloads

Getting camera list
Successfully authenticated as user redacted using a session cookie
Successfully retrieved data from https://172.16.31.1:443/proxy/protect/api/cameras
Cameras found:

0 files downloaded (0.0 b), 0 files skipped, 0 files failed, 0 files total

Details:

I'm using Docker on my M1 Macbook Air (fresh installation, never used Docker before). Unsure what to do from here.

I've also tried cloning the repo and running the python scripts manually, but it doesn't work when trying the following command in the directory: python3 protect_archiver

returns the following error: /opt/homebrew/opt/python@3.9/bin/python3.9: can't find '__main__' module in '/Users/awhiskin/Downloads/unifi-protect-video-downloader-master/protect_archiver'

I note in a previous reply you were offering to write up further detail on these python scripts directly? I think i might prefer that if possible.

@danielfernau danielfernau self-assigned this Sep 23, 2021
@danielfernau
Copy link
Owner

Hi there!
Are your cameras by any chance offline while you're trying to download files? There's a known bug where the API only returns cameras which are online at the time of running the tool, and therefore (until I can fix this) only video clips of online cameras are being downloaded.
If that's not the case and your cameras are online but you are still unable to download clips, let me know and I'll try to help.

@awhiskin
Copy link
Author

awhiskin commented Sep 23, 2021

@danielfernau hi, thanks for the response :) no, they're definitely online. Going to the URL directly in the browser definitely returns info about the cameras (https://<address>/proxy/protect/api/cameras) but the script is saying that no cameras are found.

@danielfernau
Copy link
Owner

Sorry for the delay :)

Alright, I see. That could also be a permissions issue. Your local user on the UDMP/UNVR needs to have "view" access to the Protect app; if you open that URL in your browser where you're logged in as an admin then you'll of course see the list. But that doesn't necessarily mean that the user account for the Downloader Tool has the necessary rights. Mine's set up as Limited Admin, UniFi Protect: View Only, all other apps: None. Please have a look at the user permissions and let me know if it – in case it's already configured correctly – still doesn't work.

Aside from that, and not sure if this is directly related to the camera list issue, but since you're using Docker on macOS you might also want to check if your download target directory is added to the shared folders in Docker settings. Otherwise files will end up "somewhere in the Docker VM" since Docker on macOS runs in some kind of additional virtualized environment (see also #63 (comment)). Just something to keep in mind in case you can't find the files where you'd expect them to be after downloading them.

@awhiskin
Copy link
Author

I think it was actually just an issue on my end - the user account I had created for this tool didn't have the correct permissions, I changed the UniFi Protect permissions to View Only and it now works and detects all of our cameras :)

I've been able to download footage, thanks a lot! Sorry to trouble you with such a silly issue.

@danielfernau
Copy link
Owner

No worries, thanks a lot for the update. Glad you were able to resolve the permissions issue. Happy downloading! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants