Skip to main content

Python Arlo is a library written in Python 2.7/3x which exposes the Netgear Arlo cameras via the apis that are consumed by their website.

Project description

arlo

Python module for interacting with Netgear's Arlo camera system.


Now in Golang!

If you love the Go programming language, check out arlo-golang. My goal is to bring parity to the Python version asap. If you know what you're doing in Go, I would appreciate any feedback on the general structure of the library, and contributions, etc.


This just a personal utility that I created out of necessity. It is by no means complete, although it does expose quite a bit of the Arlo interface in an easy to use Python pacakge. As such, this package does not come with unit tests (feel free to add them) or guarantees. All contributions are welcome and appreciated!

If you have a specific Arlo device that you want to improve support for, please consider sending me one! Since this project is solely maintained by yours truely and I don't have unlimited funds to support it, I can only really test and debug the code with the first gen Arlo cameras and basestation that I have. I also highly encourage and appreciate Pull Requests!

Please, feel free to contribute to this repo or buy Jeff a beer! Donate


Generous Benefactors (Thank you!)


Awesomely Smart Contributors (Thank you!)

  • kimc78 - Aug 16, 2018 - Added method to get CVR recording list.
  • jurgenweber - Apr 25, 2018 - Added Arlo Baby APIs!
  • pliablepixels - Apr 3, 2018 - Fixed up issues with the README.
  • manluk - Mar 2, 2018 - Squashed a couple of bugs.
  • notalifeform - Feb 10, 2018 - Fixed bug and formatting in example script.
  • erosen - Jan 27, 2018 - Added the ArloQ camera schema to the wiki.
  • deanmcguire - Dec 7, 2017 - Unravelled the mysteries of RTSP streaming video.
  • andijakl - Jul 24, 2017 - Added Python 3 support and cleaned up examples.
  • cemeyer2 - Nov 26, 2016 - Fixed setup issues.
  • LenShustek - Sep 14, 2016, - Added Logout().

If You'd like to make a diffrence in the world and get your name on this most prestegious list, have a look at our help wanted section!


Filing an Issue

Please read the Issue Guidelines and Policies wiki page BEFORE you file an issue. Thanks.


Install

# Install latest stable package
$ pip install arlo

--or--

# Install from master branch
$ pip install git+https://github.com/jeffreydwalter/arlo

NOTE 1: arlo.netgear.com requires TLS 1.2 for their API. So, if you're getting ssl errors, it's most likely related to your version of openssl. You may need to upgrade your openssl library. If you're running this library on OSX or macOS, they ship with openssl v0.9.x which does not support TLS 1.2. You should follow the instructions found here to upgrade your openssl library.

NOTE 2: Please ensure you don't have ANY other sseclient packages installed in addition to sseclient 0.0.18! This may cause this package to fail in unexpected ways. A common one that is known to cause issues is the sseclient-py 1.7 package. If you have a hard requirement to have more than one, please let me know and we can look into making that work.

After installing all of the required libraries, you can import and use this library like so:

from Arlo import Arlo

from datetime import timedelta, date
import datetime
import sys

USERNAME = 'user@example.com'
PASSWORD = 'supersecretpassword'

try:
	# Instantiating the Arlo object automatically calls Login(), which returns an oAuth token that gets cached.
	# Subsequent successful calls to login will update the oAuth token.
	arlo = Arlo(USERNAME, PASSWORD)
	# At this point you're logged into Arlo.

	today = (date.today()-timedelta(days=0)).strftime("%Y%m%d")
	seven_days_ago = (date.today()-timedelta(days=7)).strftime("%Y%m%d")

	# Get all of the recordings for a date range.
	library = arlo.GetLibrary(seven_days_ago, today)

	# Iterate through the recordings in the library.
	for recording in library:

		videofilename = datetime.datetime.fromtimestamp(int(recording['name'])//1000).strftime('%Y-%m-%d %H-%M-%S') + ' ' + recording['uniqueId'] + '.mp4'
		##
		# The videos produced by Arlo are pretty small, even in their longest, best quality settings,
		# but you should probably prefer the chunked stream (see below). 
		###    
		#    # Download the whole video into memory as a single chunk.
		#    video = arlo.GetRecording(recording['presignedContentUrl'])
		#	 with open('videos/'+videofilename, 'wb') as f:
		#        f.write(video)
		#        f.close()
		# Or:
		#
		# Get video as a chunked stream; this function returns a generator.
		stream = arlo.StreamRecording(recording['presignedContentUrl'])
		with open('videos/'+videofilename, 'wb') as f:
			for chunk in stream:
				f.write(chunk)
			f.close()

		print('Downloaded video '+videofilename+' from '+recording['createdDate']+'.')

	# Delete all of the videos you just downloaded from the Arlo library.
	# Notice that you can pass the "library" object we got back from the GetLibrary() call.
	result = arlo.BatchDeleteRecordings(library)

	# If we made it here without an exception, then the videos were successfully deleted.
	print('Batch deletion of videos completed successfully.')

except Exception as e:
    print(e)

For more code examples check out the wiki

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

arlo-1.2.8.tar.gz (20.7 kB view details)

Uploaded Source

Built Distribution

arlo-1.2.8-py2.py3-none-any.whl (21.9 kB view details)

Uploaded Python 2Python 3

File details

Details for the file arlo-1.2.8.tar.gz.

File metadata

  • Download URL: arlo-1.2.8.tar.gz
  • Upload date:
  • Size: 20.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.18.4 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.19.5 CPython/2.7.13

File hashes

Hashes for arlo-1.2.8.tar.gz
Algorithm Hash digest
SHA256 60deebd9abc83c10f9b871b709987349927a81c89d3fa1afbf1372298a08d5bd
MD5 524e23db0a4331735f94a5bf79ac8c19
BLAKE2b-256 a639b53b3adf7d65d12d6363dda7fe2bb8e4329c6e308c65890a8207be258592

See more details on using hashes here.

File details

Details for the file arlo-1.2.8-py2.py3-none-any.whl.

File metadata

  • Download URL: arlo-1.2.8-py2.py3-none-any.whl
  • Upload date:
  • Size: 21.9 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.18.4 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.19.5 CPython/2.7.13

File hashes

Hashes for arlo-1.2.8-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 9ebaeed2691415509459538fbe3a6226209bcdef92b4714394b195253bf8913b
MD5 1711b34cd8b7451f613d79d0d7bf6886
BLAKE2b-256 d7026c220f5dc1e50b91594304fa05d56e886310c6d1f833068fd030eef1c18b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page