lib

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	UrlSearch = struct {
		Bing      string
		Google    string
		Kagi      string
		StartPage string
	}{
		Bing:      "https://www.bing.com",
		Google:    "https://www.google.com",
		Kagi:      "https://kagi.com",
		StartPage: "https://www.startpage.com",
	}

	UrlYT = struct {
		Base        string
		History     string
		Playlists   string
		SubChannels string
		SubVideos   string
	}{
		Base:        "https://www.youtube.com",
		History:     "https://www.youtube.com/feed/history",
		Playlists:   "https://www.youtube.com/feed/playlists",
		SubChannels: "https://www.youtube.com/feed/channels",
		SubVideos:   "https://www.youtube.com/feed/subscriptions",
	}
)
View Source
var ConfDefault = TypeConf{
	FileConf: "$HOME/.config/yt-toolbox.json",

	DevtoolsHost: "localhost",
	DevtoolsPort: 9222,
}

Functions

func GetTab

func GetTab(host string, port int) *rod.Page

func UrlCleanup

func UrlCleanup(urlIn string) (urlOut string, err error)

func UrlDecode

func UrlDecode(urlIn string) (urlOut string)

Types

type IsHistorySection

type IsHistorySection struct {
	*is.Processor

	Del         bool // false;
	Deleted     bool // false;
	Desc        bool // false;
	PrintHeader bool // true;
	Remove      bool // false;
	Standalone  bool // false;
	Verbose     bool // false;
	Filter      []string
}

func (*IsHistorySection) New

func (t *IsHistorySection) New(page *rod.Page, urlStr string, remove bool, scrollMax int, verbose bool) *IsHistorySection

func (*IsHistorySection) Run added in v0.7.0

type IsHistoryVideo

type IsHistoryVideo struct {
	*is.Processor

	ClickSleep  float64 // in second
	Del         bool    // false;
	Deleted     bool    // In Run(), elements loop, current element is deleted or not
	Desc        bool    // false;
	PrintHeader bool    // true;
	Remove      bool    // false;
	Standalone  bool    // false;
	Verbose     bool    // false;
	Filter      []string
}

func (*IsHistoryVideo) New

func (t *IsHistoryVideo) New(property *is.Property, del bool, remove bool, filter *[]string) *IsHistoryVideo

func (*IsHistoryVideo) Run added in v0.7.0

func (t *IsHistoryVideo) Run() *IsHistoryVideo

func (*IsHistoryVideo) V021_ElementsRemoveShorts

func (t *IsHistoryVideo) V021_ElementsRemoveShorts(element *rod.Element) *IsHistoryVideo

type IsPlaylist

type IsPlaylist struct {
	*is.Processor

	Exclude *[]string `json:"Exclude"`
	Include *[]string `json:"Include"`
}

func (*IsPlaylist) New

func (t *IsPlaylist) New(page *rod.Page, urlStr string, scrollMax int, exclude *[]string, include *[]string) *IsPlaylist

func (*IsPlaylist) Run added in v0.7.0

func (t *IsPlaylist) Run() *IsPlaylist

type IsPlaylistVideo

type IsPlaylistVideo struct {
	*is.Processor
}

func (*IsPlaylistVideo) New

func (t *IsPlaylistVideo) New(page *rod.Page, urlStr string, scrollMax int) *IsPlaylistVideo

func (*IsPlaylistVideo) Run added in v0.7.0

func (t *IsPlaylistVideo) Run() *IsPlaylistVideo

type IsSubChannel

type IsSubChannel struct {
	*is.Processor
}

func (*IsSubChannel) New

func (t *IsSubChannel) New(page *rod.Page, urlStr string, scrollMax int) *IsSubChannel

func (*IsSubChannel) Run added in v0.7.0

func (t *IsSubChannel) Run() *IsSubChannel

type IsSubVideo

type IsSubVideo struct {
	*is.Processor

	Scroll bool
	Day    uint
}

func (*IsSubVideo) New

func (t *IsSubVideo) New(page *rod.Page, urlStr string, scrollMax int, day uint) *IsSubVideo

func (*IsSubVideo) Run added in v0.7.0

func (t *IsSubVideo) Run() *IsSubVideo

type TypeConf

type TypeConf struct {
	basestruct.Base

	FileConf string `json:"FileConf"`

	HistoryFilter []string `json:"HistoryFilter"`

	DevtoolsHost string `json:"DevtoolsHost"`
	DevtoolsPort int    `json:"DevtoolsPort"`
}

func (*TypeConf) New

func (t *TypeConf) New()

type TypeFlag

type TypeFlag struct {
	Debug   bool // Enable debug output
	Trace   bool // Enable trace output
	Verbose bool

	ScrollMax int
}

Holding all flags from command line

type TypeFlagHistory

type TypeFlagHistory struct {
	ClickSleep float32
	Del        bool
	Desc       bool
	Filter     []string
	NoRemove   bool
}

type TypeFlagPlaylist

type TypeFlagPlaylist struct {
	GetList bool
	Exclude []string
	Include []string
}

type TypeFlagSub

type TypeFlagSub struct {
	Day uint
}

type YT_Info

type YT_Info struct {
	is.InfoBase

	// --- Channel info
	ChName     string `json:"ChName,omitempty"`
	ChUrl      string `json:"ChUrl,omitempty"`
	ChUrlShort string `json:"ChUrlShort,omitempty"`

	// --- Video info
	Text   string   `json:"Text,omitempty"`
	Title  string   `json:"Title,omitempty"`
	Titles []string `json:"Titles,omitempty"`
	Url    string   `json:"Url,omitempty"`
}

Embed is.InfoBase for is.IInfo interface

func (*YT_Info) String

func (t *YT_Info) String() string

Jump to

Keyboard shortcuts

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