runner

package
v0.0.0-...-3407143 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2025 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckAndMergeWithFFmpeg

func CheckAndMergeWithFFmpeg(
	videoFilePath string,
	audioFilePath string,
	videoTitle string,
	mergeProgressMsgChannel chan string,
)

Checks if the FFmpeg is installed in the system. If installed, then it'll run the commands to merge provided video & audio files to create combined single output file. Otherwise, it'll show status message to get FFmpeg & then manually run the required command.

Reference : https://blog.kowalczyk.info/article/wOYk/advanced-command-execution-in-go-with-osexec.html

func GetAboutAppTitle

func GetAboutAppTitle() string

Returns the string of info title.

func GetAppNameTitle

func GetAppNameTitle() string

Returns the string of application's name for title.

func GetAudioBitrate_Size_Type_DropdownLabel

func GetAudioBitrate_Size_Type_DropdownLabel() string

Return label for audio related dropdown.

func GetDownloadButtonLabel

func GetDownloadButtonLabel() string

Return label for Download button.

func GetDownloadButtonProcessingLabel

func GetDownloadButtonProcessingLabel() string

Return label for Download button when download has been started.

func GetDownloadFinishedMessage

func GetDownloadFinishedMessage(downloadingVideoTitle string) string

Return status message for Download Finished.

func GetFFmpegMergeSuccessText

func GetFFmpegMergeSuccessText(
	outputFileName string,
) string

Return string text for files successfully merged to output using FFmpeg.

func GetFFmpegNotFoundText

func GetFFmpegNotFoundText(
	videoFilePath string,
	audioFilePath string,
) string

Return string text for FFmpeg not found in system.

func GetImportantNotesLimitsLabel

func GetImportantNotesLimitsLabel() string

Return label for important notes/limitations.

func GetImportantNotesLimitsText

func GetImportantNotesLimitsText() string

Return string text for important notes/limitations.

func GetInvalidURLMessage

func GetInvalidURLMessage(videoURL string) string

Return status message for Invalid Video URL.

func GetQuitButtonLabel

func GetQuitButtonLabel() string

Return label for Quit button.

func GetQuitInfoLabel

func GetQuitInfoLabel() string

Return label for Quit info.

func GetQuitInfoText

func GetQuitInfoText() string

Return string text for Quit info.

func GetRepoLabel

func GetRepoLabel() string

Return label for GitHub Repo.

func GetRepoLinkText

func GetRepoLinkText() string

Return string text for GitHub Repo link.

func GetStartingDownloadMessage

func GetStartingDownloadMessage(downloadingVideoTitle string) string

Return status message for Starting download.

func GetStatusLabel

func GetStatusLabel() string

Return label for Status.

func GetStepSizeBytes

func GetStepSizeBytes() float64

Returns the byte value 83886.08 for Range header in GET request i.e. almost equal to 0.08 MB.

func GetTuiAppLayout

func GetTuiAppLayout() *tview.Application

Construct & return the application instance.

func GetUsageInfoLabel

func GetUsageInfoLabel() string

Return label for app usage info.

func GetUsageInfoText

func GetUsageInfoText() string

Return string text for app usage info.

func GetVideoIDLink_InputFieldLabel() string

Return label for `Video ID/Link` input field.

func GetVideoMetadataFromYouTubei

func GetVideoMetadataFromYouTubei(videoURL string) map[string]interface{}

Function that sends a POST request to YouTube's internal API endpoint, YouTubei, then returns the fetched metadata map to the caller.

func GetVideoQuality_FPS_Size_Type_DropdownLabel

func GetVideoQuality_FPS_Size_Type_DropdownLabel() string

Return label for video related dropdown.

func GetYouTubeVideoTitleLabel

func GetYouTubeVideoTitleLabel() string

Return label for YouTube video title.

Types

type ClientRequestMapStruct

type ClientRequestMapStruct struct {
	Hl                string `json:"hl"`
	Gl                string `json:"gl"`
	ClientName        string `json:"clientName"`
	ClientVersion     string `json:"clientVersion"`
	ClientScreen      string `json:"clientScreen"`
	AndroidSdkVersion int    `json:"androidSdkVersion"`
}

Structure of client in 'ContextRequestMapStruct'.

type ContextRequestMapStruct

type ContextRequestMapStruct struct {
	Client     ClientRequestMapStruct     `json:"client"`
	ThirdParty ThirdPartyRequestMapStruct `json:"thirdParty"`
}

Structure of context in 'RequestBodyStruct'.

type RequestBodyStruct

type RequestBodyStruct struct {
	Context ContextRequestMapStruct `json:"context"`
	// PlaybackContext PlaybackContextStruct   `json:"playbackContext"`
	VideoId        string `json:"videoId"`
	RacyCheckOk    bool   `json:"racyCheckOk"`
	ContentCheckOk bool   `json:"contentCheckOk"`
}

Structure of request body needed by YouTube's internal APIs.

type ThirdPartyRequestMapStruct

type ThirdPartyRequestMapStruct struct {
	EmbedUrl string `json:"embedUrl"`
}

Structure of embedUrl in 'ContextRequestMapStruct'.

type YouTubeDetailsStruct

type YouTubeDetailsStruct struct {
	VideoUrlOrID            string                 // Store the YouTube's video URL or ID
	SelectedVideoQuality    string                 // Store the user's selected video quality
	SelectedAudioQuality    string                 // Store the user's selected audio quality
	VideoMetaData           map[string]interface{} // Store the metadata of `VideoUrlOrID` fetched from YouTube
	VideoQualitiesMap       map[string]string      // Store map of displayed video qualities to their download URLs
	AudioQualitiesMap       map[string]string      // Store map of displayed audio qualities to their download URLs
	DownloadedVideoFilePath string                 // Store file path where video is downloaded
	DownloadedAudioFilePath string                 // Store file path where audio is downloaded
}

Structure that holds required details about YouTube Shorts/Video.

func (*YouTubeDetailsStruct) DownloadYouTubeAudioFile

func (youtubeDetails *YouTubeDetailsStruct) DownloadYouTubeAudioFile(
	downloadProgressMsgChannel chan string,
	isDownloadFinished *bool,
	application *tview.Application,
)

Function for 'YouTubeDetailsStruct' that downloads the audio file from YouTube.

func (*YouTubeDetailsStruct) DownloadYouTubeVideoFile

func (youtubeDetails *YouTubeDetailsStruct) DownloadYouTubeVideoFile(
	downloadProgressMsgChannel chan string,
	isDownloadFinished *bool,
	application *tview.Application,
)

Function for 'YouTubeDetailsStruct' that downloads the video file from YouTube.

func (*YouTubeDetailsStruct) IsValidYouTubeURL

func (youtubeDetails *YouTubeDetailsStruct) IsValidYouTubeURL(
	videoValidityMsgChannel chan string,
	isValidVideo *bool,
)

Function to validate & return a boolean status of whether the passed URL is right.

Jump to

Keyboard shortcuts

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