amara

package module
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2021 License: Apache-2.0 Imports: 13 Imported by: 1

README

amara

Build Status

Go client for the Amara API.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	*pester.Client
	// contains filtered or unexported fields
}

func NewClient

func NewClient(apiKey, team string) *Client

func (*Client) CreateLanguage

func (c *Client) CreateLanguage(videoID, langCode string) (*Language, error)

func (*Client) CreateSubtitles

func (c *Client) CreateSubtitles(videoID, langCode, format string, params url.Values) (*SubtitleInfo, error)

func (*Client) CreateVideo

func (c *Client) CreateVideo(params url.Values) (*Video, error)

func (*Client) DisableRateLimitProtection added in v0.4.0

func (c *Client) DisableRateLimitProtection()

func (*Client) EditorLogin

func (c *Client) EditorLogin(videoID, langCode, userName string) (*EditorLoginSession, error)

func (*Client) EnableRateLimitProtection added in v0.4.0

func (c *Client) EnableRateLimitProtection()

func (*Client) GetLanguage

func (c *Client) GetLanguage(videoID, langCode string) (*Language, error)

func (*Client) GetRawSubtitles added in v0.3.0

func (c *Client) GetRawSubtitles(videoID, langCode string, captionFormat string) ([]byte, error)

func (*Client) GetSubtitleInfo added in v0.3.0

func (c *Client) GetSubtitleInfo(videoID, langCode string) (*SubtitleInfo, error)

func (*Client) GetVideo

func (c *Client) GetVideo(id string) (*Video, error)

func (*Client) SetRateLimitProtection added in v0.4.0

func (c *Client) SetRateLimitProtection(rlp RateLimitProtection)

func (*Client) UpdateLanguage

func (c *Client) UpdateLanguage(videoID, langCode string, complete bool) (*Language, error)

type EditorLoginSession

type EditorLoginSession struct {
	URL string `json:"url"`
}

type Language

type Language struct {
	Created              time.Time   `json:"created"`
	LanguageCode         string      `json:"language_code"`
	OriginalLanguageCode interface{} `json:"original_language_code"`
	Name                 string      `json:"name"`
	Title                string      `json:"title"`
	Description          string      `json:"description"`
	Metadata             struct {
		SpeakerName string `json:"speaker-name"`
		Location    string `json:"location"`
	} `json:"metadata"`
	Versions []struct {
		Author struct {
			Username string `json:"username"`
			ID       string `json:"id"`
			URI      string `json:"uri"`
		} `json:"author"`
		Published bool `json:"published"`
		VersionNo int  `json:"version_no"`
	} `json:"versions"`
	SubtitlesURI           string `json:"subtitles_uri"`
	ResourceURI            string `json:"resource_uri"`
	SubtitleCount          int    `json:"subtitle_count"`
	SubtitlesComplete      bool   `json:"subtitles_complete"`
	IsPrimaryAudioLanguage bool   `json:"is_primary_audio_language"`
	IsRtl                  bool   `json:"is_rtl"`
	Published              bool   `json:"published"`
}

type RateLimitProtection added in v0.4.0

type RateLimitProtection struct {
	MinRetryDuration time.Duration
	MaxRetryDuration time.Duration
	// contains filtered or unexported fields
}

type SubtitleInfo added in v0.3.0

type SubtitleInfo struct {
	VersionNumber int    `json:"version_number"`
	SubFormat     string `json:"sub_format"`
	Subtitles     string `json:"subtitles"`
	Author        struct {
		Username string `json:"username"`
		ID       string `json:"id"`
		URI      string `json:"uri"`
	} `json:"author"`
	Language struct {
		Code string `json:"code"`
		Name string `json:"name"`
		Dir  string `json:"dir"`
	} `json:"language"`
	Title       string `json:"title"`
	Description string `json:"description"`
	Metadata    struct {
		SpeakerName string `json:"speaker-name"`
		Location    string `json:"location"`
	} `json:"metadata"`
	VideoTitle       string `json:"video_title"`
	VideoDescription string `json:"video_description"`
	ActionsURI       string `json:"actions_uri"`
	NotesURI         string `json:"notes_uri"`
	ResourceURI      string `json:"resource_uri"`
	SiteURI          string `json:"site_uri"`
	Video            string `json:"video"`
	VersionNo        int    `json:"version_no"`
}

type Video

type Video struct {
	ID                       string      `json:"id"`
	VideoType                string      `json:"video_type"`
	PrimaryAudioLanguageCode string      `json:"primary_audio_language_code"`
	Title                    string      `json:"title"`
	Description              string      `json:"description"`
	Duration                 int         `json:"duration"`
	Thumbnail                string      `json:"thumbnail"`
	Created                  time.Time   `json:"created"`
	Team                     interface{} `json:"team"`
	TeamType                 interface{} `json:"team_type"`
	Project                  interface{} `json:"project"`
	AllUrls                  []string    `json:"all_urls"`
	Metadata                 struct {
		SpeakerName string `json:"speaker-name"`
		Location    string `json:"location"`
	} `json:"metadata"`
	Languages []struct {
		Code         string `json:"code"`
		Name         string `json:"name"`
		Published    bool   `json:"published"`
		Dir          string `json:"dir"`
		SubtitlesURI string `json:"subtitles_uri"`
		ResourceURI  string `json:"resource_uri"`
	} `json:"languages"`
	ActivityURI          string `json:"activity_uri"`
	UrlsURI              string `json:"urls_uri"`
	SubtitleLanguagesURI string `json:"subtitle_languages_uri"`
	ResourceURI          string `json:"resource_uri"`
}

Jump to

Keyboard shortcuts

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