dl

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2023 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Cmd = &cobra.Command{
	Use:     "dl",
	Aliases: []string{"download"},
	Short:   "Download anything from Telegram (protected) chat",
	RunE: func(cmd *cobra.Command, args []string) error {

		if len(opts.Include) > 0 && len(opts.Exclude) > 0 {
			return errors.New("only one of `include` and `exclude` can be specified")
		}

		if opts.Continue && opts.Restart {
			return errors.New("only one of `continue` and `restart` can be specified, or none of them")
		}

		if err := os.MkdirAll(opts.Dir, os.ModePerm); err != nil {
			return err
		}

		opts.Template = viper.GetString(consts.FlagDlTemplate)
		return dl.Run(logger.Named(cmd.Context(), "dl"), opts)
	},
}

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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