aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCody Logan <clpo13@gmail.com>2019-06-14 10:52:56 -0700
committerCody Logan <clpo13@gmail.com>2019-06-14 10:52:56 -0700
commitb9a987735a16862722bf28493cc26d4c70945d82 (patch)
treea381ea0769f279c609e8371b97bc0e45cbe0a98c
parent27378329cac5334398438d6b917d323c2941ec50 (diff)
downloadwikiget-b9a987735a16862722bf28493cc26d4c70945d82.tar.gz
wikiget-b9a987735a16862722bf28493cc26d4c70945d82.zip
Documentation updates
-rw-r--r--README.md14
-rw-r--r--setup.py2
-rw-r--r--test/test_wikiget.py4
-rw-r--r--wikiget/version.py4
-rw-r--r--wikiget/wikiget.py10
5 files changed, 23 insertions, 11 deletions
diff --git a/README.md b/README.md
index 9658e24..aa6c1eb 100644
--- a/README.md
+++ b/README.md
@@ -17,6 +17,9 @@ If `FILE` is in the form `File:Example.jpg` or `Example.jpg`, it will be fetched
from the default site, which is "en.wikipedia.org". If it's the fully-qualified
URL of a file description page, like `https://commons.wikimedia.org/wiki/File:Example.jpg`,
the file is fetched from the specified site, in this case "commons.wikimedia.org".
+Full URLs may contain characters your shell interprets differently, so you can
+either escape those characters with a backslash `\` or surround the entire URL
+with single `'` or double `"` quotes.
The site can also be specified with the `--site` flag, though this will not have
any effect if the full URL is given.
@@ -29,8 +32,17 @@ By default, the program won't overwrite existing files with the same name as the
target, but this can be forced with `-f` or `--force`. Additionally, the file can
be downloaded to a different name with `-o`.
+### Examples
+
+```bash
+wikiget File:Example.jpg
+wikiget --site commons.wikimedia.org File:Example.jpg
+wikiget https://en.wikipedia.org/wiki/File:Example.jpg -o test.jpg
+```
+
## Future plans
+- compare downloaded file hash with server
- batch download categories and user uploads
- download from any MediaWiki-powered site, not just Wikimedia projects
- download Wikipedia articles, in plain text, wikitext, or other formats
@@ -61,7 +73,7 @@ executable script. Unit tests can be run with `python setup.py test`.
## License
-Copyright (C) 2018 Cody Logan
+Copyright (C) 2018-2019 Cody Logan
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
diff --git a/setup.py b/setup.py
index fb35851..53057e2 100644
--- a/setup.py
+++ b/setup.py
@@ -1,6 +1,6 @@
"""wikiget
Simple wget clone for downloading files from Wikimedia sites.
-Copyright (C) 2018 Cody Logan; licensed GPLv3+
+Copyright (C) 2018-2019 Cody Logan; licensed GPLv3+
SPDX-License-Identifier: GPL-3.0-or-later
"""
diff --git a/test/test_wikiget.py b/test/test_wikiget.py
index 8a30a37..71c9006 100644
--- a/test/test_wikiget.py
+++ b/test/test_wikiget.py
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
"""wikiget
Simple wget clone for downloading files from Wikimedia sites.
-Copyright (C) 2018 Cody Logan; licensed GPLv3+
+Copyright (C) 2018-2019 Cody Logan; licensed GPLv3+
SPDX-License-Identifier: GPL-3.0-or-later
"""
@@ -61,7 +61,7 @@ def test_valid_file_input():
"""
valid_input = ["Image:example.jpg", "file:example.jpg",
"File:example.file-01.jpg",
- "File:ß handwritten sample.gif"]
+ "File:ß handwritten sample.gif", "File:A (1).jpeg"]
for i in valid_input:
file_match = wikiget.valid_file(i)
assert file_match is not None
diff --git a/wikiget/version.py b/wikiget/version.py
index 412bf1e..efd9297 100644
--- a/wikiget/version.py
+++ b/wikiget/version.py
@@ -1,7 +1,7 @@
"""wikiget
Simple wget clone for downloading files from Wikimedia sites.
-Copyright (C) 2018 Cody Logan; licensed GPLv3+
+Copyright (C) 2018-2019 Cody Logan; licensed GPLv3+
SPDX-License-Identifier: GPL-3.0-or-later
"""
-__version__ = "0.1.1"
+__version__ = "0.1.2"
diff --git a/wikiget/wikiget.py b/wikiget/wikiget.py
index 52f0f66..30a7d17 100644
--- a/wikiget/wikiget.py
+++ b/wikiget/wikiget.py
@@ -1,6 +1,6 @@
"""wikiget
Simple wget clone for downloading files from Wikimedia sites.
-Copyright (C) 2018 Cody Logan; licensed GPLv3+
+Copyright (C) 2018-2019 Cody Logan; licensed GPLv3+
SPDX-License-Identifier: GPL-3.0-or-later
"""
@@ -40,10 +40,10 @@ def main():
using the file name or description page URL
""",
epilog="""
- Copyright (C) 2018 Cody Logan. License GPLv3+: GNU GPL version 3
- or later <http://www.gnu.org/licenses/gpl.html>.
- This is free software; you are free to change and redistribute it.
- There is NO WARRANTY, to the extent permitted by law.
+ Copyright (C) 2018-2019 Cody Logan. License GPLv3+: GNU GPL
+ version 3 or later <http://www.gnu.org/licenses/gpl.html>.
+ This is free software; you are free to change and redistribute
+ it. There is NO WARRANTY, to the extent permitted by law.
""")
parser.add_argument("FILE", help="""
name of the file to download with the File: or Image: prefix,