Documentation
¶
Index ¶
- Variables
- func CycleAudioTrack(socketPath string) error
- func CycleSubtitleTrack(socketPath string) error
- func DownloadFolderFormatter(str string) string
- func DownloadVideo(url, destPath string, numThreads int, m *model) error
- func ExtractEpisodeNumber(episodeStr string) string
- func ExtractVideoSources(episodeURL string) ([]struct{ ... }, error)
- func ExtractVideoSourcesWithPrompt(episodeURL string) (string, error)
- func GetAudioTracks(socketPath string) ([]map[string]interface{}, error)
- func GetCurrentAudioTrack(socketPath string) (int, error)
- func GetCurrentSubtitleTrack(socketPath string) (int, error)
- func GetPlaybackStats(socketPath string) (map[string]interface{}, error)
- func GetSubtitleTracks(socketPath string) ([]map[string]interface{}, error)
- func GetVideoURLForEpisode(episodeURL string) (string, error)
- func GetVideoURLForEpisodeEnhanced(episode *models.Episode, anime *models.Anime) (string, error)
- func HandleBatchDownload(episodes []models.Episode, animeURL string) error
- func HandleBatchDownloadRange(episodes []models.Episode, animeURL string, startNum, endNum int) error
- func HandleDownloadAndPlay(videoURL string, episodes []models.Episode, selectedEpisodeNum int, ...) error
- func InitTrackerAsync()
- func MpvSendCommand(socketPath string, command []interface{}) (interface{}, error)
- func SelectEpisodeWithFuzzyFinder(episodes []models.Episode) (string, string, error)
- func SetAudioTrack(socketPath string, trackID int) error
- func SetPlaybackSpeed(socketPath string, speed float64) error
- func SetSubtitleTrack(socketPath string, trackID int) error
- func StartVideo(link string, args []string) (string, error)
- func ToggleSubtitle(socketPath string) error
- type VideoData
- type VideoResponse
Constants ¶
This section is empty.
Variables ¶
var ErrBackRequested = errors.New("back requested")
ErrBackRequested is returned when user selects the back option
var ErrBackToAnimeSelection = errors.New("back to anime selection")
ErrBackToAnimeSelection is returned when user wants to go back to anime selection
var ErrBackToDownloadOptions = errors.New("back to download options")
ErrBackToDownloadOptions is returned when user wants to go back to download options
var ErrBackToEpisodeSelection = errors.New("back to episode selection")
ErrBackToEpisodeSelection is returned when user wants to go back to episode selection
var ErrChangeAnime = errors.New("user requested to change anime")
ErrChangeAnime is returned when the user chooses to change anime
var ErrUserQuit = errors.New("user requested to quit application")
ErrUserQuit is returned when the user chooses to quit the application
Functions ¶
func CycleAudioTrack ¶ added in v1.6.0
CycleAudioTrack cycles through available audio tracks
func CycleSubtitleTrack ¶ added in v1.6.0
CycleSubtitleTrack cycles through available subtitle tracks
func DownloadFolderFormatter ¶ added in v1.0.6
DownloadFolderFormatter formats the anime URL to create a download folder name.
This function extracts a specific part of the anime video URL to use it as the name for the download folder. It uses a regular expression to capture the part of the URL after "/video/", which is often unique and suitable as a folder name.
Steps: 1. Compiles a regular expression that matches URLs of the form "https://<domain>/video/<unique-part>". 2. Extracts the "<unique-part>" from the URL. 3. If the match is successful, it returns the extracted part as the folder name. 4. If no match is found, it returns an empty string.
Parameters: - str: The anime video URL as a string.
Returns: - A string representing the formatted folder name, or an empty string if no match is found.
func DownloadVideo ¶ added in v1.0.6
DownloadVideo downloads a video using multiple threads.
func ExtractEpisodeNumber ¶
ExtractEpisodeNumber extracts the episode number from the episode string
func ExtractVideoSources ¶ added in v1.1.0
ExtractVideoSources returns the available video sources for an episode.
func ExtractVideoSourcesWithPrompt ¶ added in v1.1.0
ExtractVideoSourcesWithPrompt allows the user to choose video quality.
func GetAudioTracks ¶ added in v1.6.0
GetAudioTracks returns list of available audio tracks
func GetCurrentAudioTrack ¶ added in v1.6.0
GetCurrentAudioTrack returns the current audio track ID
func GetCurrentSubtitleTrack ¶ added in v1.6.0
GetCurrentSubtitleTrack returns the current subtitle track ID
func GetPlaybackStats ¶ added in v1.0.9
GetPlaybackStats returns current playback statistics
func GetSubtitleTracks ¶ added in v1.6.0
GetSubtitleTracks returns list of available subtitle tracks
func GetVideoURLForEpisode ¶
GetVideoURLForEpisode gets the video URL for a given episode URL
func GetVideoURLForEpisodeEnhanced ¶ added in v1.6.0
GetVideoURLForEpisodeEnhanced gets the video URL using the enhanced API with AllAnime navigation support
func HandleBatchDownload ¶ added in v1.0.7
HandleBatchDownload performs batch download of episodes.
func HandleBatchDownloadRange ¶ added in v1.6.0
func HandleBatchDownloadRange(episodes []models.Episode, animeURL string, startNum, endNum int) error
HandleBatchDownloadRange performs batch download of episodes using a provided range. It mirrors HandleBatchDownload but skips prompting for the range and enables optional AniSkip sidecar generation when AllAnime Smart is enabled.
func HandleDownloadAndPlay ¶
func HandleDownloadAndPlay( videoURL string, episodes []models.Episode, selectedEpisodeNum int, animeURL string, episodeNumberStr string, animeMalID int, updater *discord.RichPresenceUpdater, ) error
HandleDownloadAndPlay handles the download and playback of the video
func InitTrackerAsync ¶ added in v1.6.0
func InitTrackerAsync()
InitTrackerAsync initializes the tracker in the background. Call this early in the application lifecycle to avoid delays later.
func MpvSendCommand ¶ added in v1.1.0
MpvSendCommand is a wrapper function to expose mpvSendCommand to other packages
func SelectEpisodeWithFuzzyFinder ¶
SelectEpisodeWithFuzzyFinder allows the user to select an episode using fuzzy finder
func SetAudioTrack ¶ added in v1.6.0
SetAudioTrack sets a specific audio track by ID
func SetPlaybackSpeed ¶ added in v1.0.9
SetPlaybackSpeed sets the video playback speed
func SetSubtitleTrack ¶ added in v1.6.0
SetSubtitleTrack sets a specific subtitle track by ID
func StartVideo ¶ added in v1.0.9
StartVideo opens mpv with a socket for IPC Modify the StartVideo function in player.go
func ToggleSubtitle ¶ added in v1.0.9
ToggleSubtitle toggles subtitle visibility
Types ¶
type VideoResponse ¶
type VideoResponse struct {
Data []VideoData `json:"data"`
}
VideoResponse represents the video response structure with a slice of VideoData