2015-11-03 22:08:19 +01:00
|
|
|
==========
|
|
|
|
gallery-dl
|
|
|
|
==========
|
|
|
|
|
2017-05-09 15:43:55 +02:00
|
|
|
*gallery-dl* is a command-line program to download image-galleries and
|
2018-11-17 17:42:26 +01:00
|
|
|
-collections from several image hosting sites (see `Supported Sites`_).
|
|
|
|
It is a cross-platform tool with many configuration options
|
|
|
|
and powerful filenaming capabilities.
|
2016-07-25 11:13:54 +02:00
|
|
|
|
2015-11-03 22:08:19 +01:00
|
|
|
|
2018-01-09 15:10:40 +01:00
|
|
|
|pypi| |build| |gitter|
|
2017-01-25 02:31:36 +01:00
|
|
|
|
2018-11-17 17:42:26 +01:00
|
|
|
|
|
|
|
Dependencies
|
|
|
|
============
|
|
|
|
|
|
|
|
- Python_ 3.4+
|
|
|
|
- Requests_
|
|
|
|
|
|
|
|
Optional
|
|
|
|
--------
|
|
|
|
|
|
|
|
- FFmpeg_: Pixiv Ugoira to WebM conversion
|
|
|
|
- youtube-dl_: Video downloads
|
2017-01-25 02:31:36 +01:00
|
|
|
|
|
|
|
|
2015-11-03 22:08:19 +01:00
|
|
|
Installation
|
2015-11-10 21:13:43 +01:00
|
|
|
============
|
2015-11-03 22:08:19 +01:00
|
|
|
|
2018-11-17 17:42:26 +01:00
|
|
|
Pip
|
|
|
|
---
|
2017-05-09 15:43:55 +02:00
|
|
|
|
|
|
|
The stable releases of *gallery-dl* are distributed on PyPI_ and can be
|
2017-10-27 15:45:38 +02:00
|
|
|
easily installed or upgraded using pip_:
|
2017-05-09 15:43:55 +02:00
|
|
|
|
|
|
|
.. code:: bash
|
|
|
|
|
2019-11-08 16:41:27 +01:00
|
|
|
$ python3 -m pip install --upgrade gallery-dl
|
2017-05-09 15:43:55 +02:00
|
|
|
|
2017-10-27 15:45:38 +02:00
|
|
|
Installing the latest dev-version directly from GitHub can be done with
|
|
|
|
pip_ as well:
|
2015-11-03 22:08:19 +01:00
|
|
|
|
|
|
|
.. code:: bash
|
|
|
|
|
2019-11-08 16:41:27 +01:00
|
|
|
$ python3 -m pip install --upgrade https://github.com/mikf/gallery-dl/archive/master.tar.gz
|
2015-11-03 22:08:19 +01:00
|
|
|
|
2019-11-08 16:41:27 +01:00
|
|
|
Note: Windows users should use :code:`py -3` instead of :code:`python3`.
|
2017-05-09 15:43:55 +02:00
|
|
|
|
2019-11-08 22:34:56 +01:00
|
|
|
| It is advised to use the latest version of pip_,
|
|
|
|
including the essential packages :code:`setuptools` and :code:`wheel`.
|
|
|
|
| To ensure that these packages are up-to-date, run
|
2019-11-08 16:41:27 +01:00
|
|
|
|
|
|
|
.. code:: bash
|
|
|
|
|
|
|
|
$ python3 -m pip install --upgrade pip setuptools wheel
|
2019-11-03 23:52:50 +01:00
|
|
|
|
2017-05-09 15:43:55 +02:00
|
|
|
|
2018-11-28 14:53:27 +01:00
|
|
|
From Source
|
|
|
|
-----------
|
2017-06-02 09:08:08 +02:00
|
|
|
|
|
|
|
Get the code by either
|
|
|
|
|
|
|
|
* Downloading a stable_ or dev_ archive and unpacking it
|
2018-11-17 17:42:26 +01:00
|
|
|
* Or via :code:`git clone https://github.com/mikf/gallery-dl.git`
|
2017-06-02 09:08:08 +02:00
|
|
|
|
|
|
|
Navigate into the respective directory and run the :code:`setup.py` file.
|
2015-11-03 22:08:19 +01:00
|
|
|
|
|
|
|
.. code:: bash
|
|
|
|
|
2019-11-08 16:41:27 +01:00
|
|
|
$ wget https://github.com/mikf/gallery-dl/archive/master.tar.gz
|
|
|
|
$ tar -xf master.tar.gz
|
2017-06-02 09:08:08 +02:00
|
|
|
# or
|
2015-11-03 22:08:19 +01:00
|
|
|
$ git clone https://github.com/mikf/gallery-dl.git
|
2017-06-02 09:08:08 +02:00
|
|
|
|
2019-11-08 16:41:27 +01:00
|
|
|
$ cd gallery-dl*
|
|
|
|
$ python3 setup.py install
|
2017-05-09 15:43:55 +02:00
|
|
|
|
2015-11-03 22:08:19 +01:00
|
|
|
|
2019-05-04 22:50:00 +02:00
|
|
|
Standalone Executable
|
|
|
|
---------------------
|
2017-05-09 15:43:55 +02:00
|
|
|
|
2019-05-04 22:50:00 +02:00
|
|
|
Download a standalone executable file,
|
|
|
|
put it into your `PATH <https://en.wikipedia.org/wiki/PATH_(variable)>`__,
|
|
|
|
and run it inside a command prompt (like ``cmd.exe``).
|
|
|
|
|
2020-11-28 00:05:32 +01:00
|
|
|
- `Windows <https://github.com/mikf/gallery-dl/releases/download/v1.15.4/gallery-dl.exe>`__
|
|
|
|
- `Linux <https://github.com/mikf/gallery-dl/releases/download/v1.15.4/gallery-dl.bin>`__
|
2019-05-04 22:50:00 +02:00
|
|
|
|
2020-01-12 20:06:02 +01:00
|
|
|
These executables include a Python 3.8 interpreter
|
2019-05-04 22:50:00 +02:00
|
|
|
and all required Python packages.
|
2017-06-02 09:08:08 +02:00
|
|
|
|
2017-01-25 02:31:36 +01:00
|
|
|
|
2019-05-04 22:27:34 +02:00
|
|
|
Snap
|
|
|
|
----
|
|
|
|
|
|
|
|
Linux users that are using a distro that is supported by Snapd_ can install *gallery-dl* from the Snap Store:
|
|
|
|
|
|
|
|
.. code:: bash
|
|
|
|
|
|
|
|
$ snap install gallery-dl
|
2017-01-24 02:36:43 +01:00
|
|
|
|
2020-05-18 20:34:08 +02:00
|
|
|
Chocolatey
|
2020-05-30 01:25:20 +02:00
|
|
|
----------
|
2020-05-18 20:34:08 +02:00
|
|
|
|
|
|
|
Windows users that have Chocolatey_ installed can install *gallery-dl* from the Chocolatey Community Packages repository:
|
|
|
|
|
|
|
|
.. code:: powershell
|
|
|
|
|
|
|
|
$ choco install gallery-dl
|
2019-05-04 22:50:00 +02:00
|
|
|
|
2020-10-08 19:08:33 +02:00
|
|
|
Scoop
|
|
|
|
----------
|
|
|
|
|
|
|
|
Apart from Chocolatey, *gallery-dl* is also available in Scoop_ "main" bucket for Windows users.
|
|
|
|
|
|
|
|
.. code:: powershell
|
|
|
|
|
|
|
|
$ scoop install gallery-dl
|
2020-05-30 01:25:20 +02:00
|
|
|
|
2015-11-03 22:08:19 +01:00
|
|
|
Usage
|
2015-11-10 21:13:43 +01:00
|
|
|
=====
|
2015-11-03 22:08:19 +01:00
|
|
|
|
2017-05-09 15:43:55 +02:00
|
|
|
To use *gallery-dl* simply call it with the URLs you wish to download images
|
2017-01-24 02:36:43 +01:00
|
|
|
from:
|
2016-11-10 16:22:59 +01:00
|
|
|
|
2015-11-03 22:08:19 +01:00
|
|
|
.. code:: bash
|
|
|
|
|
2017-01-24 02:36:43 +01:00
|
|
|
$ gallery-dl [OPTION]... URL...
|
2015-11-03 22:08:19 +01:00
|
|
|
|
2016-11-10 16:22:59 +01:00
|
|
|
See also :code:`gallery-dl --help`.
|
|
|
|
|
2017-01-24 02:36:43 +01:00
|
|
|
|
|
|
|
Examples
|
|
|
|
--------
|
|
|
|
|
2017-10-27 15:45:38 +02:00
|
|
|
Download images; in this case from danbooru via tag search for 'bonocho':
|
2017-01-24 02:36:43 +01:00
|
|
|
|
|
|
|
.. code:: bash
|
|
|
|
|
2019-12-21 20:41:02 +01:00
|
|
|
$ gallery-dl "https://danbooru.donmai.us/posts?tags=bonocho"
|
2017-01-24 02:36:43 +01:00
|
|
|
|
|
|
|
|
|
|
|
Get the direct URL of an image from a site that requires authentication:
|
|
|
|
|
|
|
|
.. code:: bash
|
|
|
|
|
2019-12-21 20:41:02 +01:00
|
|
|
$ gallery-dl -g -u "<username>" -p "<password>" "https://seiga.nicovideo.jp/seiga/im3211703"
|
2017-01-24 02:36:43 +01:00
|
|
|
|
|
|
|
|
2020-02-07 23:21:44 +01:00
|
|
|
Filter manga chapters by language and chapter number:
|
|
|
|
|
|
|
|
.. code:: bash
|
|
|
|
|
|
|
|
$ gallery-dl --chapter-filter "lang == 'fr' and 10 <= chapter < 20" "https://mangadex.org/title/2354/"
|
|
|
|
|
|
|
|
|
2017-01-24 02:36:43 +01:00
|
|
|
| Search a remote resource for URLs and download images from them:
|
|
|
|
| (URLs for which no extractor can be found will be silently ignored)
|
|
|
|
|
|
|
|
.. code:: bash
|
|
|
|
|
2019-12-21 20:41:02 +01:00
|
|
|
$ gallery-dl "r:https://pastebin.com/raw/FLwrCYsT"
|
2017-01-24 02:36:43 +01:00
|
|
|
|
|
|
|
|
2020-08-15 21:29:02 +02:00
|
|
|
If a site's address is nonstandard for its extractor, you can prefix the URL with the
|
2020-07-15 21:28:20 +02:00
|
|
|
extractor's name to force the use of a specific extractor:
|
|
|
|
|
|
|
|
.. code:: bash
|
|
|
|
|
|
|
|
$ gallery-dl "tumblr:https://sometumblrblog.example"
|
|
|
|
|
|
|
|
|
2015-11-03 22:08:19 +01:00
|
|
|
Configuration
|
2015-11-10 21:13:43 +01:00
|
|
|
=============
|
2015-11-03 22:08:19 +01:00
|
|
|
|
2017-05-09 15:43:55 +02:00
|
|
|
Configuration files for *gallery-dl* use a JSON-based file format.
|
2015-11-03 22:08:19 +01:00
|
|
|
|
2018-03-12 18:15:30 +01:00
|
|
|
| For a (more or less) complete example with options set to their default values,
|
|
|
|
see gallery-dl.conf_.
|
|
|
|
| For a configuration file example with more involved settings and options,
|
|
|
|
see gallery-dl-example.conf_.
|
|
|
|
| A list of all available configuration options and their
|
|
|
|
descriptions can be found in configuration.rst_.
|
|
|
|
|
|
|
|
*gallery-dl* searches for configuration files in the following places:
|
2015-11-03 22:08:19 +01:00
|
|
|
|
2016-11-10 16:22:59 +01:00
|
|
|
+--------------------------------------------+------------------------------------------+
|
|
|
|
| Linux | Windows |
|
|
|
|
+--------------------------------------------+------------------------------------------+
|
2020-05-28 02:56:38 +02:00
|
|
|
|* ``/etc/gallery-dl.conf`` |* ``%APPDATA%\gallery-dl\config.json`` |
|
2016-11-10 16:22:59 +01:00
|
|
|
|* ``${HOME}/.config/gallery-dl/config.json``|* ``%USERPROFILE%\gallery-dl\config.json``|
|
|
|
|
|* ``${HOME}/.gallery-dl.conf`` |* ``%USERPROFILE%\gallery-dl.conf`` |
|
|
|
|
+--------------------------------------------+------------------------------------------+
|
2015-11-03 22:08:19 +01:00
|
|
|
|
2018-03-12 18:15:30 +01:00
|
|
|
(``%USERPROFILE%`` usually refers to the user's home directory,
|
2016-11-10 16:22:59 +01:00
|
|
|
i.e. ``C:\Users\<username>\``)
|
2015-11-03 22:08:19 +01:00
|
|
|
|
2016-11-10 16:22:59 +01:00
|
|
|
Values in later configuration files will override previous ones.
|
2015-11-03 22:08:19 +01:00
|
|
|
|
2020-05-10 23:47:20 +02:00
|
|
|
Command line options will override all related settings in the configuration file(s),
|
|
|
|
e.g. using ``--write-metadata`` will enable writing metadata using the default values
|
|
|
|
for all ``postprocessors.metadata.*`` settings, overriding any specific settings in
|
|
|
|
configuration files.
|
|
|
|
|
2017-01-24 02:36:43 +01:00
|
|
|
|
2016-07-25 11:13:54 +02:00
|
|
|
Authentication
|
|
|
|
==============
|
|
|
|
|
2017-06-23 16:14:51 +02:00
|
|
|
Username & Password
|
|
|
|
-------------------
|
|
|
|
|
2020-05-30 01:25:20 +02:00
|
|
|
Some extractors require you to provide valid login credentials in the form of
|
2019-07-29 18:22:31 +02:00
|
|
|
a username & password pair. This is necessary for
|
|
|
|
``pixiv``, ``nijie``, and ``seiga``
|
2020-03-14 01:13:14 +01:00
|
|
|
and optional for
|
2020-08-27 22:45:30 +02:00
|
|
|
``aryion``, ``danbooru``, ``e621``, ``exhentai``, ``idolcomplex``, ``inkbunny``,
|
2020-10-15 00:51:53 +02:00
|
|
|
``instagram``, ``luscious``, ``pinterest``, ``sankaku``, ``subscribestar``,
|
|
|
|
``tsumino``, and ``twitter``.
|
2016-07-25 11:13:54 +02:00
|
|
|
|
|
|
|
You can set the necessary information in your configuration file
|
|
|
|
(cf. gallery-dl.conf_)
|
|
|
|
|
2020-05-30 01:25:20 +02:00
|
|
|
.. code:: json
|
2016-07-25 11:13:54 +02:00
|
|
|
|
|
|
|
{
|
|
|
|
"extractor": {
|
2016-10-06 19:12:07 +02:00
|
|
|
"pixiv": {
|
2016-07-25 11:13:54 +02:00
|
|
|
"username": "<username>",
|
|
|
|
"password": "<password>"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
or you can provide them directly via the
|
|
|
|
:code:`-u/--username` and :code:`-p/--password` or via the
|
|
|
|
:code:`-o/--option` command-line options
|
|
|
|
|
|
|
|
.. code:: bash
|
|
|
|
|
|
|
|
$ gallery-dl -u <username> -p <password> URL
|
|
|
|
$ gallery-dl -o username=<username> -o password=<password> URL
|
|
|
|
|
2020-05-30 01:25:20 +02:00
|
|
|
Cookies
|
|
|
|
-------
|
|
|
|
|
|
|
|
For sites where login with username & password is not possible due to
|
|
|
|
CAPTCHA or similar, or has not been implemented yet, you can use the
|
|
|
|
cookies from a browser login session and input them into *gallery-dl*.
|
|
|
|
|
|
|
|
This can be done via the
|
|
|
|
`cookies <https://github.com/mikf/gallery-dl/blob/master/docs/configuration.rst#extractorcookies>`__
|
|
|
|
option in your configuration file by specifying
|
|
|
|
|
|
|
|
- | the path to a Mozilla/Netscape format cookies.txt file exported by a browser addon
|
|
|
|
| (e.g. `cookies.txt <https://chrome.google.com/webstore/detail/cookiestxt/njabckikapfpffapmjgojcnbfjonfjfg>`__ for Chrome,
|
|
|
|
`Export Cookies <https://addons.mozilla.org/en-US/firefox/addon/export-cookies-txt/?src=search>`__ for Firefox)
|
|
|
|
|
|
|
|
- | a list of name-value pairs gathered from your browser's web developer tools
|
|
|
|
| (in `Chrome <https://developers.google.com/web/tools/chrome-devtools/storage/cookies>`__,
|
|
|
|
in `Firefox <https://developer.mozilla.org/en-US/docs/Tools/Storage_Inspector>`__)
|
|
|
|
|
|
|
|
For example:
|
|
|
|
|
|
|
|
.. code:: json
|
|
|
|
|
|
|
|
{
|
|
|
|
"extractor": {
|
|
|
|
"instagram": {
|
|
|
|
"cookies": "$HOME/path/to/cookies.txt"
|
|
|
|
},
|
|
|
|
"patreon": {
|
|
|
|
"cookies": {
|
|
|
|
"session_id": "K1T57EKu19TR49C51CDjOJoXNQLF7VbdVOiBrC9ye0a"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
You can also specify a cookies.txt file with
|
|
|
|
the :code:`--cookies` command-line option:
|
|
|
|
|
|
|
|
.. code:: bash
|
|
|
|
|
|
|
|
$ gallery-dl --cookies "$HOME/path/to/cookies.txt" URL
|
|
|
|
|
2017-06-23 16:14:51 +02:00
|
|
|
OAuth
|
|
|
|
-----
|
|
|
|
|
2017-12-18 00:12:08 +01:00
|
|
|
*gallery-dl* supports user authentication via OAuth_ for
|
2018-05-10 18:58:05 +02:00
|
|
|
``deviantart``, ``flickr``, ``reddit``, ``smugmug`` and ``tumblr``.
|
2017-12-18 00:12:08 +01:00
|
|
|
This is entirely optional, but grants *gallery-dl* the ability
|
2017-06-23 16:14:51 +02:00
|
|
|
to issue requests on your account's behalf and enables it to access resources
|
|
|
|
which would otherwise be unavailable to a public user.
|
|
|
|
|
|
|
|
To link your account to *gallery-dl*, start by invoking it with
|
2020-05-30 01:25:20 +02:00
|
|
|
``oauth:<sitename>`` as an argument. For example:
|
2017-06-23 16:14:51 +02:00
|
|
|
|
|
|
|
.. code:: bash
|
|
|
|
|
|
|
|
$ gallery-dl oauth:flickr
|
|
|
|
|
|
|
|
You will be sent to the site's authorization page and asked to grant read
|
2019-03-23 22:11:08 +01:00
|
|
|
access to *gallery-dl*. Authorize it and you will be shown one or more
|
2017-06-23 16:14:51 +02:00
|
|
|
"tokens", which should be added to your configuration file.
|
|
|
|
|
2017-01-25 02:31:36 +01:00
|
|
|
|
2018-03-12 18:15:30 +01:00
|
|
|
.. _gallery-dl.conf: https://github.com/mikf/gallery-dl/blob/master/docs/gallery-dl.conf
|
|
|
|
.. _gallery-dl-example.conf: https://github.com/mikf/gallery-dl/blob/master/docs/gallery-dl-example.conf
|
|
|
|
.. _configuration.rst: https://github.com/mikf/gallery-dl/blob/master/docs/configuration.rst
|
2018-11-17 17:42:26 +01:00
|
|
|
.. _Supported Sites: https://github.com/mikf/gallery-dl/blob/master/docs/supportedsites.rst
|
2020-11-28 00:05:32 +01:00
|
|
|
.. _stable: https://github.com/mikf/gallery-dl/archive/v1.15.4.tar.gz
|
2019-11-26 12:05:31 +01:00
|
|
|
.. _dev: https://github.com/mikf/gallery-dl/archive/master.tar.gz
|
2018-11-17 17:42:26 +01:00
|
|
|
|
|
|
|
.. _Python: https://www.python.org/downloads/
|
|
|
|
.. _PyPI: https://pypi.org/
|
|
|
|
.. _pip: https://pip.pypa.io/en/stable/
|
2019-10-11 18:19:39 +02:00
|
|
|
.. _Requests: https://requests.readthedocs.io/en/master/
|
2018-11-17 17:42:26 +01:00
|
|
|
.. _FFmpeg: https://www.ffmpeg.org/
|
2019-03-12 21:13:33 +01:00
|
|
|
.. _youtube-dl: https://ytdl-org.github.io/youtube-dl/
|
2019-07-09 23:07:55 +02:00
|
|
|
.. _pyOpenSSL: https://pyopenssl.org/
|
2019-05-04 22:50:00 +02:00
|
|
|
.. _Snapd: https://docs.snapcraft.io/installing-snapd
|
2018-11-17 17:42:26 +01:00
|
|
|
.. _OAuth: https://en.wikipedia.org/wiki/OAuth
|
2020-05-30 01:25:20 +02:00
|
|
|
.. _Chocolatey: https://chocolatey.org/install
|
2020-10-08 19:08:33 +02:00
|
|
|
.. _Scoop: https://scoop.sh
|
2017-01-25 02:31:36 +01:00
|
|
|
|
|
|
|
.. |pypi| image:: https://img.shields.io/pypi/v/gallery-dl.svg
|
2018-11-17 17:42:26 +01:00
|
|
|
:target: https://pypi.org/project/gallery-dl/
|
2017-01-25 02:31:36 +01:00
|
|
|
|
2020-11-17 19:40:45 +01:00
|
|
|
.. |build| image:: https://github.com/mikf/gallery-dl/workflows/tests/badge.svg
|
|
|
|
:target: https://github.com/mikf/gallery-dl/actions
|
2018-01-09 15:10:40 +01:00
|
|
|
|
|
|
|
.. |gitter| image:: https://badges.gitter.im/gallery-dl/main.svg
|
|
|
|
:target: https://gitter.im/gallery-dl/main
|