download

package
v0.0.0-...-e976548 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2021 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Cmd = &cobra.Command{
	Use:   "download",
	Short: "download an item or collection",
	Run: func(c *cobra.Command, args []string) {
		Assert(len(args) > 0, "missing item identifier")
		p, _ := c.Flags().GetString("save-dir")
		cc, _ := c.Flags().GetInt("concurrency")
		nso, _ := c.Flags().GetBool("no-original")
		nsm, _ := c.Flags().GetBool("no-metadata")
		ysd, _ := c.Flags().GetBool("yes-derivative")

		if nso {
			sources = stringsu.Remove(sources, "original")
		}
		if nsm {
			sources = stringsu.Remove(sources, "metadata")
		}
		if ysd {
			sources = append(sources, "derivative")
		}

		d, _ := filepath.Abs(p)
		mbpp.Init(cc)
		dlItem(d, args[0], nil)
		mbpp.Wait()
		time.Sleep(time.Second)
		log.Println(mbpp.GetCompletionMessage())
	},
}

Cmd is the cobra.Command

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