summaryrefslogtreecommitdiff
path: root/doc/git-annex-addurl.mdwn
blob: 991dc5f998b24d4440c2c1053febe02409e5151d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# NAME

git-annex addurl - add urls to annex

# SYNOPSIS

git annex addurl `[url ...]`

# DESCRIPTION

Downloads each url to its own file, which is added to the annex.

When `quvi` is installed, urls are automatically tested to see if they
point to a video hosting site, and the video is downloaded instead.
  
Urls to torrent files (including magnet links) will cause the content of
the torrent to be downloaded, using `aria2c`.

Normally the filename is based on the full url, so will look like
"www.example.com_dir_subdir_bigfile". In some cases, addurl is able to
come up with a better filename based on other information. Options can also
be used to get better filenames.

# OPTIONS

* `--fast`

  Avoid immediately downloading the url. The url is still checked
  (via HEAD) to verify that it exists, and to get its size if possible.

* `--relaxed`

  Avoid storing the size of the url's content, and accept whatever
  content is there at a future point. (Implies `--fast`.)

* `--raw`

  Prevent special handling of urls by quvi, bittorrent, and other
  special remotes. This will for example, make addurl
  download the .torrent file and not the contents it points to.

* `--file=name`

  Use with a filename that does not yet exist to add a new file
  with the specified name and the content downloaded from the url.

  If the file already exists, addurl will record that it can be downloaded
  from the specified url(s).

* `--pathdepth=N`

  Rather than basing the filename on the whole url, this causes a path to
  be constructed, starting at the specified depth within the path of the
  url.

  For example, adding the url http://www.example.com/dir/subdir/bigfile
  with `--pathdepth=1` will use "dir/subdir/bigfile",
  while `--pathdepth=3` will use "bigfile". 

  It can also be negative; `--pathdepth=-2` will use the last
  two parts of the url.

* `--prefix=foo` `--suffix=bar`

  Use to adjust the filenames that are created by addurl. For example,
  `--suffix=.mp3` can be used to add an extension to the file.

* `--jobs=N` `-JN`

  Enables parallel downloads when multiple urls are being added.
  For example: `-J4`  

* `--batch`

  Enables batch mode, in which lines containing urls to add are read from
  stdin.

* `--with-files`

  When batch mode is enabled, makes it parse lines of the form: "$url $file"

  That adds the specified url to the specified file, downloading its
  content if the file does not yet exist; the same as
  `git annex addurl $url --file $file`

* `--json`

  Enable JSON output. This is intended to be parsed by programs that use
  git-annex. Each line of output is a JSON object.

# SEE ALSO

[[git-annex]](1)

[[git-annex-rmurl]](1)

[[git-annex-registerurl]](1)

[[git-annex-importfeed]](1)

# AUTHOR

Joey Hess <id@joeyh.name>

Warning: Automatically converted into a man page by mdwn2man. Edit with care.