api

package
v0.0.0-...-047b7bd Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const BaseUrl string = "https://yt1s.com/api"
View Source
const CheckTaskEndpoint string = "/ajaxConvert/checkTask"
View Source
const ConvertEndpoint string = "/ajaxConvert/convert"
View Source
const IndexEndpoint string = "/ajaxSearch/index"
View Source
const IndexEndpointParam string = "home"

Variables

This section is empty.

Functions

This section is empty.

Types

type Format

type Format string

Format is a video format

const (
	// FormatMp4 is mp4 video format
	FormatMp4 Format = "mp4"

	// FormatM4a is m4a video format
	FormatM4a Format = "m4a"

	// FormatMp3 is mp3 video format
	FormatMp3 Format = "mp3"

	// Format3gp is 3gp video format
	Format3gp Format = "3gp"
)

type Modality

type Modality struct {
	Size    string `json:"size"`
	Format  string `json:"f"`
	Quality string `json:"q"`
	Key     string `json:"k"`
}

Modality is a video modality

type Options

type Options struct {
	Format  Format
	Quality string
}

type ResponseConvert

type ResponseConvert struct {
	CStatus    string `json:"c_status"`
	VideoId    string `json:"vid"`
	Title      string `json:"title"`
	Format     string `json:"ftype"`
	Quality    string `json:"quality"`
	Url        string `json:"dlink"`
	Expiration int    `json:"e_time,omitempty"`
	Bid        string `json:"b_id,omitempty"`
	// contains filtered or unexported fields
}

ResponseConvert is a json response struct of convert response

func NewResponseConvert

func NewResponseConvert(idVideo, token string) (*ResponseConvert, error)

NewResponseConvert creates a ResponseConvert instance

type ResponseIndex

type ResponseIndex struct {
	Process string                         `json:"p"`
	VideoId string                         `json:"vid"`
	Title   string                         `json:"title"`
	Timing  int                            `json:"t"`
	Channel string                         `json:"a"`
	Links   map[string]map[string]Modality `json:"links"`
	// contains filtered or unexported fields
}

ResponseIndex is a type of index api response

func NewResponseIndex

func NewResponseIndex(videoLink string) (*ResponseIndex, error)

NewResponseIndex creates a new ResponseIndex instance

func (*ResponseIndex) ExtractToken

func (ri *ResponseIndex) ExtractToken(opt Options) string

ExtractToken is a ResponseIndex method that extract token from ResponseIndex specifying the video options

func (*ResponseIndex) VideoOptions

func (ri *ResponseIndex) VideoOptions() (opts []*Options)

Jump to

Keyboard shortcuts

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