blinkgo

module
v0.8.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 4, 2023 License: MIT

README

blinkgo

Go Report license Build Status

blinkgo

Simple library for interacting with blink cameras, mainly: authentication, listing devices/networks/clips, and downloading clips from local storage

This library was made for my purposes but if you would like to see more features open an issue and I will get to it

Credit to MattTW, who's findings: BlinkMonitorProtocol I used to create this implementation

Features

  • authentication
  • read networks, cameras, sync modules
  • list videos
  • download videos

Getting Started

Prerequisites
Getting blinkgo

With Go module support, simply add the following import

import "github.com/rekram1-node/blinkgo/blink"

to your code, and then go [build|run|test] will automatically fetch the necessary dependencies.

Otherwise, run the following to install the blinkgo library

$ go get -u github.com/rekram1-node/blinkgo/blink

Documentation

Read the documentation for usage instructions

Authentication

Simple login and 2FA verify pin
package main

import (
	"fmt"
	"log"

	"github.com/rekram1-node/blinkgo/blink"
)

func main() {
	email := "example@example.com"
	password := "PLEASE_DON'T_PLAINTEXT_REAL_PASSWORDS"

    // returns account object with: email, password, uuid
	account := blink.NewAccount(email, password)

	// this returns a login response that you can use
	// however, it is unneccessary for this example
	if _, err := account.Login(); err != nil {
		log.Fatal(err)
	}

	fmt.Print("Enter Pin: ")
	var pin string
	fmt.Scanln(&pin)

	// this returns a verify pin response that you can use
	// however, it is unneccessary for this example
	if _, err = account.VerifyPin(pin); err != nil {
		log.Fatal(err)
	}
}

Local-Storage

I did not discover this myself, this is from blinkpy

The steps for pulling videos from local storage

  1. Query sync module for information regarding stored clips
  2. Upload the clips to the cloud
  3. Download the clips from a cloud URL

Beware the upload/download sequence, there must be a waiting period between the two as the operation is not instantenous

Issues

If you have an issue: report it on the issue tracker

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL