gopro

package
v0.0.0-...-9c5431e Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2022 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var FIRMWARE_CATALOG = "https://firmware-api.gopro.com/v2/firmware/catalog"
View Source
var FileTypeMatches = map[GoProType][]FileTypeMatch{
	V2: {
		{
			Regex:    regexp.MustCompile(`GOPR\d+.JPG`),
			Type:     Photo,
			HeroMode: true,
		},
		{
			Regex:    regexp.MustCompile(`GP\d+.JPG`),
			Type:     Photo,
			HeroMode: true,
		},
		{
			Regex:    regexp.MustCompile(`GX\d+.MP4`),
			Type:     Video,
			HeroMode: true,
		},
		{
			Regex:    regexp.MustCompile(`GH\d+.MP4`),
			Type:     Video,
			HeroMode: true,
		},
		{
			Regex:    regexp.MustCompile(`GL\d+.LRV`),
			Type:     LowResolutionVideo,
			HeroMode: true,
		},
		{
			Regex:    regexp.MustCompile(`GH\d+.THM`),
			Type:     Thumbnail,
			HeroMode: true,
		},
		{
			Regex:    regexp.MustCompile(`GX\d+.THM`),
			Type:     Thumbnail,
			HeroMode: true,
		},
		{
			Regex:    regexp.MustCompile(`GG\d+.MP4`),
			Type:     Video,
			HeroMode: true,
		},
		{
			Regex:    regexp.MustCompile(`G\d+.JPG`),
			Type:     Multishot,
			HeroMode: true,
		},
		{
			Regex:    regexp.MustCompile(`.GPR`),
			Type:     RawPhoto,
			HeroMode: true,
		},
	},
	MAX: {
		{
			Regex:    regexp.MustCompile(`GS\d+.360`),
			Type:     Video,
			HeroMode: false,
		},
		{
			Regex:    regexp.MustCompile(`GS_+\d+.JPG`),
			Type:     Photo,
			HeroMode: false,
		},
		{
			Regex:    regexp.MustCompile(`GP_+\d+.JPG`),
			Type:     Photo,
			HeroMode: true,
		},
		{
			Regex:    regexp.MustCompile(`GH\d+.MP4`),
			Type:     Video,
			HeroMode: true,
		},
		{
			Regex:    regexp.MustCompile(`GX\d+.MP4`),
			Type:     Video,
			HeroMode: true,
		},
		{
			Regex:    regexp.MustCompile(`GPAA\d+.JPG`),
			Type:     Multishot,
			HeroMode: true,
		},
		{
			Regex:    regexp.MustCompile(`GH\d+.LRV`),
			Type:     LowResolutionVideo,
			HeroMode: true,
		},
		{
			Regex:    regexp.MustCompile(`GH\d+.THM`),
			Type:     Thumbnail,
			HeroMode: true,
		},
		{
			Regex:    regexp.MustCompile(`GS\d+.LRV`),
			Type:     LowResolutionVideo,
			HeroMode: false,
		},
		{
			Regex:    regexp.MustCompile(`GS\d+.THM`),
			Type:     Thumbnail,
			HeroMode: false,
		},
		{
			Regex:    regexp.MustCompile(`GSAA\d+.JPG`),
			Type:     Multishot,
			HeroMode: false,
		},
	},
	V1: {
		{
			Regex:    regexp.MustCompile(`GOPR\d+.JPG`),
			Type:     Photo,
			HeroMode: true,
		},
		{
			Regex:    regexp.MustCompile(`G\d+.JPG`),
			Type:     Multishot,
			HeroMode: true,
		},
		{
			Regex:    regexp.MustCompile(`GOPR\d+.MP4`),
			Type:     Video,
			HeroMode: true,
		},
		{
			Regex:    regexp.MustCompile(`GP\d+.MP4`),
			Type:     ChapteredVideo,
			HeroMode: true,
		},
		{
			Regex:    regexp.MustCompile(`GOPR\d+.LRV`),
			Type:     LowResolutionVideo,
			HeroMode: true,
		},
		{
			Regex:    regexp.MustCompile(`GOPR\d+.THM`),
			Type:     Thumbnail,
			HeroMode: true,
		},
		{
			Regex:    regexp.MustCompile(`.GPR`),
			Type:     RawPhoto,
			HeroMode: true,
		},
	},
}
View Source
var MediaFolderRegex = regexp.MustCompile(`\d\d\dGOPRO`)

Functions

func Import

func Import(in, out, dateFormat string, bufferSize int, prefix string, dateRange []string, cameraOptions map[string]interface{}) (*utils.Result, error)

func ImportConnect

func ImportConnect(in, out string, sortOptions SortOptions) (*utils.Result, error)

func UpdateCamera

func UpdateCamera(sdcard string) error

Types

type Camera

type Camera struct {
	Model                  int      `json:"model"`
	ModelString            string   `json:"model_string"`
	Name                   string   `json:"name"`
	Version                string   `json:"version"`
	URL                    string   `json:"url"`
	ReleaseDate            string   `json:"release_date"`
	Sha1                   string   `json:"sha1"`
	RequiredFreeLocalSpace int      `json:"required_free_local_space"`
	CriticalUpdate         bool     `json:"criticalUpdate"`
	Languages              []string `json:"languages"`
	ReleaseHTML            string   `json:"release_html"`
	LicenseHTML            string   `json:"license_html"`
}

type Directory

type Directory string
const (
	DCIM Directory = "DCIM"
	MISC Directory = "MISC"
)

type FileOfInterest

type FileOfInterest string
const (
	GetStarted FileOfInterest = "Get_started_with_GoPro.url"
	Version    FileOfInterest = "version.txt"
)

type FileType

type FileType string
const (
	Video              FileType = "video"
	Photo              FileType = "photo"
	PowerPano          FileType = "powerpano"
	ChapteredVideo     FileType = "chapteredvideo"
	Multishot          FileType = "multishot"
	LowResolutionVideo FileType = "lrv"
	Thumbnail          FileType = "thm"
	RawPhoto           FileType = "gpr"
)

type FileTypeMatch

type FileTypeMatch struct {
	Regex    *regexp.Regexp
	Type     FileType
	HeroMode bool
}

type FirmwareCatalog

type FirmwareCatalog struct {
	Version string   `json:"version"`
	Magic   string   `json:"magic"`
	Group   string   `json:"group"`
	Cameras []Camera `json:"cameras"`
}

type GoProConnectDevice

type GoProConnectDevice struct {
	IP   string
	Info cameraInfo
}

func GetGoProNetworkAddresses

func GetGoProNetworkAddresses() ([]GoProConnectDevice, error)

type GoProType

type GoProType string
const (
	V2  GoProType = "v2"
	MAX GoProType = "max"
	V1  GoProType = "v1"

	UNKNOWN GoProType = "unknown"
)

type GoProVersion

type GoProVersion struct {
	InfoVersion        string `json:"info version"`
	FirmwareVersion    string `json:"firmware version"`
	WifiMac            string `json:"wifi mac"`
	CameraType         string `json:"camera type"`
	CameraSerialNumber string `json:"camera serial number"`
}

type SortOptions

type SortOptions struct {
	ByDays             bool
	ByLocation         bool
	SkipAuxiliaryFiles bool
	AddHiLightTags     bool
	ByCamera           bool
	DateFormat         string
	BufferSize         int
	Prefix             string
	DateRange          []time.Time
}

Jump to

Keyboard shortcuts

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