aboutsummaryrefslogtreecommitdiff
path: root/docs/wikiget.1.md
blob: d537942a88f0dda9d0a7bedb7385f1937b4420d3 (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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
% WIKIGET(1) Version 0.8.0 | Wikiget User Manual
% Cody Logan <cody@lokken.dev>
% November 16, 2023

# NAME

wikiget - download files from MediaWiki sites

# SYNOPSIS

| **wikiget** \[*options*] *FILE*
| **wikiget** \[*options*] \[\-**a**|\-\-**batch**] *BATCHFILE*
| **wikiget** \[\-**V**|\-\-**version**]
| **wikiget** \[\-**h**|\-\-**help**]

# DESCRIPTION

Something like **wget**(1) for downloading a file from MediaWiki sites (like Wikipedia or Wikimedia Commons) using only
the file name or the URL of its description page.

# OPTIONS

*FILE*

:   The file to be downloaded. If *FILE* is in the form *File:Example.jpg* or *Image:Example.jpg*, it will be fetched
    from the default site, which is "commons.wikimedia.org". If it's the fully-qualified URL of a file description page,
    like *https://en.wikipedia.org/wiki/File:Example.jpg*, the file is fetched from the site in the URL, in this case
    "en.wikipedia.org".

*BATCHFILE*

:   In batch download mode (activated with \-**a** or \-\-**batch**), this is a text file containing multiple file names
    or URLs to be downloaded, one per line. Blank lines and lines starting with "#" are ignored. If an error is
    encountered during download, execution stops immediately and the offending filename is printed.

\-**s**, \-\-**site** *SITE*

:   MediaWiki site to download from. Will not have any effect if the full URL is given in the *FILE* parameter.

\-**P**, \-\-**path** *PATH*

:   Script path for the wiki, where "index.php" and "api.php" live. On Wikimedia sites, it's "/w/", the default, but
    other sites may use "/" or something else entirely.

\-**u**, \-\-**username** *USERNAME*

:   Username for private wikis that require a login even for read access.

\-**p**, \-\-**password** *PASSWORD*

:   Password for private wikis that require a login even for read access.

\-**o**, \-\-**output** *OUTPUT*

:   By default, the output filename is the same as the remote filename (without the File: or Image: prefix), but this
    can be changed with this option.

\-**l**, \-\-**logfile** *LOGFILE*

:   Specify a logfile, which will contain detailed information about the download process. If the logfile already
    exists, new log information is appended to it.

\-**f**, \-\-**force**

:   Force existing files to be overwritten.

\-**a**, \-\-**batch**

:   If this flag is set, **wikiget** will run in batch download mode (see *BATCHFILE*).

\-**j**, \-\-**threads**

:   Number of parallel downloads to attempt in batch mode. This option has no effect if \-**a** is not also set.

\-**n**, \-\-**dry-run**

:   Do a dry-run of the download process. Useful for checking the format of a batch file. Nothing will actually be
    downloaded.

\-**v**, \-\-**verbose**

:   Print additional information, such as the site used and the full URL of the file. Additional invocations will
    increase the level of detail.

\-**q**, \-\-**quiet**

:   Silence warnings and minimize printed output.

\-**V**, \-\-**version**

:   Print the version number of the program.

\-**h**, \-\-**help**

:   Print a brief summary of these options.

# EXAMPLES

```
wikiget File:Example.jpg
wikiget --site en.wikipedia.org File:Example.jpg
wikiget https://en.wikipedia.org/wiki/File:Example.jpg -o test.jpg
```

# BUG REPORTS

https://github.com/clpo13/wikiget/issues

# LICENSE

Copyright (C) 2018-2023 Cody Logan and contributors

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public
License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later
version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see
https://www.gnu.org/licenses/.