api

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package api provides functions to easily access the Piped Api.

Package api provides functions to easily access the Piped Api.

Package api provides functions to easily access the Piped Api.

Package api provides functions to easily access the Piped Api.

Package api provides functions to easily access the Piped Api.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddVideosIntoPlaylist

func AddVideosIntoPlaylist(playlistId string, videoIds *[]string, instanceBaseUrl string, userToken string) error

AddVideosIntoPlaylist calls the remote Piped instance to insert videos into a specific playlist.

Error is returned if the call failed.

func ClearPlaylistVideos added in v1.4.0

func ClearPlaylistVideos(playlistId string, instanceBaseUrl string, userToken string) error

ClearPlaylistVideos calls the remote Piped instance to clear a specific playlist.

Error is returned if the call failed.

func CreatePlaylist

func CreatePlaylist(name string, instanceBaseUrl string, userToken string) (*pipedPlaylistDto.CreatedPlaylistDto, error)

CreatePlaylist calls the remote Piped instance to create a new playlist.

The created playlist is returned if the call succeeded.

Error is returned if the call failed.

func ExtractVideoIdFromUrl

func ExtractVideoIdFromUrl(url string) string

ExtractVideoIdFromUrl returns the video id corresponding to a video url.

Example:

url='/watch?v=123-456789' -> id='123-456789'

func FetchChannel

func FetchChannel(subscription pipedDto.SubscriptionDto, instanceBaseUrl string) (*pipedDto.ChannelDto, error)

FetchChannel calls the remote Piped instance to return a specific channel.

Error is returned if the call failed.

func FetchChannelVideos

func FetchChannelVideos(channel *pipedDto.ChannelDto, startDate time.Time, instanceBaseUrl string) (*[]pipedVideoDto.StreamDto, error)

FetchChannelVideos calls the remote Piped instance to return the videos associated with a specific channel.

Error is returned if the call failed.

func FetchPlaylistVideos

func FetchPlaylistVideos(playlistId string, instanceBaseUrl string, userToken string) (*[]pipedVideoDto.RelatedStreamDto, error)

FetchPlaylistVideos calls the remote Piped instance to return the videos associated with a specific playlist.

Error is returned if the call failed.

func FetchPlaylists

func FetchPlaylists(instanceBaseUrl string, userToken string) (*[]pipedPlaylistDto.PlaylistDto, error)

FetchPlaylists calls the remote Piped instance to return the playlists associated with the user token.

Error is returned if the call failed.

func FetchSubscriptions

func FetchSubscriptions(instanceBaseUrl string, userToken string) (*[]pipedDto.SubscriptionDto, error)

FetchSubscriptions calls the remote Piped instance to return the subscriptions associated with the user token.

Error is returned if the call failed.

func FetchVideo

func FetchVideo(videoMeta pipedVideoDto.RelatedStreamDto, instanceBaseUrl string) (*pipedVideoDto.StreamDto, error)

FetchVideo calls the remote Piped instance and returns the video corresponding to video metadata.

Error is returned if the call failed.

func GetToken

func GetToken() string

GetToken returns the token of the current authenticated user.

func Login

func Login(username string, password string, instanceBaseUrl string) error

Login calls the remote Piped instance in order to authenticate using a username and password. Once done, the related user token can be retrieved using GetToken.

Error is returned if the call failed.

Types

This section is empty.

Jump to

Keyboard shortcuts

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