argparse

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 20, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CLI struct {
	Config string `help:"Alternate config file."`

	Version  VersionCMD  `cmd:"" help:"Print version information."`
	Status   StatusCMD   `cmd:"" help:"Print status of downloaded videos."`
	Update   UpdateCMD   `cmd:"" help:"Update video database."`
	Download DownloadCMD `cmd:"" help:"Download unwatched videos in highest available quality."`
	Mark     MarkCMD     `cmd:"" help:"Mark video status."`
	Export   ExportCMD   `cmd:"" help:"Export unwatched video URLs to urls.txt and mark them watched."`
	List     ListCMD     `cmd:"" help:"List channels and video counts."`
	Add      AddCMD      `cmd:"" help:"Add a channel feed URL to config from a YouTube video URL."`
	Clean    CleanCMD    `cmd:"" help:"Remove RSS feed URLs from config that return 404."`
	Delete   DeleteCMD   `cmd:"" help:"Delete downloaded video files."`
	Sync     SyncCMD     `cmd:"" help:"Run update and then download in one command."`
}

Functions

func Run

func Run(version string)

Types

type AddCMD

type AddCMD struct {
	VideoURL string `arg:"" name:"video-url" help:"Any YouTube video URL."`
}

func (*AddCMD) Run

func (a *AddCMD) Run(o *Opts) error

type CleanCMD

type CleanCMD struct {
	DryRun bool `name:"dry-run" help:"Preview which 404 feeds would be removed."`
}

func (*CleanCMD) Run

func (c *CleanCMD) Run(o *Opts) error

type DeleteCMD

type DeleteCMD struct {
	Creator       string   `name:"creator" help:"Delete downloaded videos for this creator."`
	Slug          []string `name:"slug" help:"Delete videos by slug."`
	Days          int      `name:"days" default:"0" help:"Delete videos older than N days (0 = no filter)."`
	DryRun        bool     `name:"dry-run" help:"Preview what would be deleted without removing files."`
	MarkUnwatched bool     `name:"mark-unwatched" help:"Also mark deleted videos as unwatched so they can be re-downloaded."`
}

func (*DeleteCMD) Run

func (d *DeleteCMD) Run(o *Opts) error

type DownloadCMD

type DownloadCMD struct {
	Days   int `name:"days" default:"0" help:"Download only videos from the last N days (0 = no filter)."`
	Videos int `name:"videos" default:"0" help:"Download only the latest N unwatched videos (0 = no limit)."`
}

func (*DownloadCMD) Run

func (d *DownloadCMD) Run(o *Opts) error

type ExportCMD

type ExportCMD struct {
}

func (*ExportCMD) Run

func (e *ExportCMD) Run(o *Opts) error

type ListCMD

type ListCMD struct {
}

func (*ListCMD) Run

func (l *ListCMD) Run(o *Opts) error

type MarkCMD

type MarkCMD struct {
	Slug             []string `name:"slug" help:"Mark entries by slug."`
	URL              []string `name:"url" help:"Mark entries by video URL."`
	Creator          string   `name:"creator" help:"Mark entries for this creator."`
	AllUnwatched     bool     `name:"all-unwatched" help:"Mark all unwatched entries."`
	MarkAllUnwatched bool     `name:"mark-all-unwatched" help:"Mark every video in the database as unwatched."`
	DryRun           bool     `name:"dry-run" help:"Show what would be marked without updating the database."`
}

func (*MarkCMD) Run

func (m *MarkCMD) Run(o *Opts) error

type Opts

type Opts struct {
	Version string
	Config  string
}

type StatusCMD

type StatusCMD struct {
	JSON    bool   `name:"json" help:"Print status in JSON format."`
	Creator string `name:"creator" help:"Show status for a single creator."`
}

func (*StatusCMD) Run

func (s *StatusCMD) Run(o *Opts) error

type SyncCMD

type SyncCMD struct {
	URL       []string `name:"url" help:"Fetch these RSS feeds instead of config URLs."`
	Limit     int      `name:"limit" default:"0" help:"Process at most N feed entries per URL (0 = all)."`
	SinceDays int      `name:"since-days" default:"0" help:"Only process videos published in the last N days (0 = no filter)."`
	Retries   int      `name:"retries" default:"2" help:"Retry failed feed fetches this many times."`
	Timeout   int      `name:"timeout" default:"30" help:"HTTP timeout in seconds for each feed request."`
	DryRun    bool     `name:"dry-run" help:"Run update in dry-run mode (download will use existing unwatched data)."`
	JSON      bool     `name:"json" help:"Print update summary in JSON format."`
	Days      int      `name:"days" default:"0" help:"Download only videos from the last N days (0 = no filter)."`
	Videos    int      `name:"videos" default:"0" help:"Download only the latest N unwatched videos (0 = no limit)."`
}

func (*SyncCMD) Run

func (s *SyncCMD) Run(o *Opts) error

type UpdateCMD

type UpdateCMD struct {
	URL       []string `name:"url" help:"Fetch these RSS feeds instead of config URLs."`
	Limit     int      `name:"limit" default:"0" help:"Process at most N feed entries per URL (0 = all)."`
	SinceDays int      `name:"since-days" default:"0" help:"Only process videos published in the last N days (0 = no filter)."`
	Retries   int      `name:"retries" default:"2" help:"Retry failed feed fetches this many times."`
	Timeout   int      `name:"timeout" default:"30" help:"HTTP timeout in seconds for each feed request."`
	DryRun    bool     `name:"dry-run" help:"Show what would be inserted without writing to the database."`
	JSON      bool     `name:"json" help:"Print update summary in JSON format."`
}

func (*UpdateCMD) Run

func (u *UpdateCMD) Run(o *Opts) error

type VersionCMD

type VersionCMD struct {
}

func (*VersionCMD) Run

func (v *VersionCMD) Run(o *Opts) error

Jump to

Keyboard shortcuts

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