Debian Codegraph @

PKG-INFO

raw
1 Metadata-Version: 2.4
2 Name: gallery_dl
3 Version: 1.32.14
4 Summary: Command-line program to download image galleries and collections from several image hosting sites
5 Home-page: https://codeberg.org/mikf/gallery-dl
6 Download-URL: https://codeberg.org/mikf/gallery-dl/releases/latest
7 Author: Mike Fährmann
8 Author-email: [email protected]
9 Maintainer: Mike Fährmann
10 Maintainer-email: [email protected]
11 License: GPL-2.0-only
12 Keywords: image gallery downloader crawler scraper
13 Classifier: Development Status :: 5 - Production/Stable
14 Classifier: Environment :: Console
15 Classifier: Intended Audience :: End Users/Desktop
16 Classifier: License :: OSI Approved :: GNU General Public License v2 (GPLv2)
17 Classifier: Operating System :: OS Independent
18 Classifier: Programming Language :: Python
19 Classifier: Programming Language :: Python :: 3
20 Classifier: Programming Language :: Python :: 3 :: Only
21 Classifier: Programming Language :: Python :: 3.8
22 Classifier: Programming Language :: Python :: 3.9
23 Classifier: Programming Language :: Python :: 3.10
24 Classifier: Programming Language :: Python :: 3.11
25 Classifier: Programming Language :: Python :: 3.12
26 Classifier: Programming Language :: Python :: 3.13
27 Classifier: Programming Language :: Python :: 3.14
28 Classifier: Programming Language :: Python :: Implementation :: CPython
29 Classifier: Programming Language :: Python :: Implementation :: PyPy
30 Classifier: Topic :: Internet :: WWW/HTTP
31 Classifier: Topic :: Multimedia :: Graphics
32 Classifier: Topic :: Utilities
33 Requires-Python: >=3.8
34 Description-Content-Type: text/x-rst
35 License-File: LICENSE
36 Requires-Dist: requests>=2.11.0
37 Provides-Extra: video
38 Requires-Dist: yt-dlp; extra == "video"
39 Provides-Extra: extra
40 Requires-Dist: requests[socks]; extra == "extra"
41 Requires-Dist: yt-dlp[default]; extra == "extra"
42 Requires-Dist: jinja2; extra == "extra"
43 Requires-Dist: pyyaml; extra == "extra"
44 Requires-Dist: toml; python_version < "3.11" and extra == "extra"
45 Requires-Dist: truststore; python_version >= "3.10" and extra == "extra"
46 Requires-Dist: secretstorage; sys_platform == "linux" and extra == "extra"
47 Dynamic: author
48 Dynamic: author-email
49 Dynamic: classifier
50 Dynamic: description
51 Dynamic: description-content-type
52 Dynamic: download-url
53 Dynamic: home-page
54 Dynamic: keywords
55 Dynamic: license
56 Dynamic: license-file
57 Dynamic: maintainer
58 Dynamic: maintainer-email
59 Dynamic: provides-extra
60 Dynamic: requires-dist
61 Dynamic: requires-python
62 Dynamic: summary
63
64 ==========
65 gallery-dl
66 ==========
67
68 *gallery-dl* is a command-line program
69 to download image galleries and collections
70 from several image hosting sites
71 (see `Supported Sites <https://codeberg.org/mikf/gallery-dl/src/branch/master/docs/supportedsites.md>`__).
72 It is a cross-platform tool
73 with many
74 `command-line <https://gdl-org.github.io/docs/options.html>`__ and
75 `configuration <https://gdl-org.github.io/docs/configuration.html>`__
76 options, as well as powerful
77 `file-naming capabilities <https://gdl-org.github.io/docs/formatting.html>`__.
78
79
80 |pypi| |discord| |build|
81
82 .. contents::
83
84
85 Dependencies
86 ============
87
88 - Python_ 3.8+
89 - Requests_
90
91 Optional
92 --------
93
94 - yt-dlp_ or youtube-dl_: HLS/DASH video downloads, ``ytdl`` integration
95 - FFmpeg_: Pixiv Ugoira conversion
96 - mkvmerge_: Accurate Ugoira frame timecodes
97 - PySocks_: SOCKS proxy support
98 - brotli_ or brotlicffi_: Brotli compression support
99 - zstandard_: Zstandard compression support
100 - PyYAML_: YAML configuration file support
101 - toml_: TOML configuration file support for Python<3.11
102 - SecretStorage_: GNOME keyring passwords for ``--cookies-from-browser``
103 - Psycopg_: PostgreSQL archive support
104 - truststore_: Native system certificate support
105 - Jinja_: Jinja template support
106
107
108 Installation
109 ============
110
111
112 Pip
113 ---
114
115 The stable releases of *gallery-dl* are distributed on PyPI_ and can be
116 easily installed or upgraded using pip_:
117
118 .. code:: bash
119
120 python -m pip install -U gallery-dl
121
122 Installing the latest dev version directly from ``master``
123 can be done with pip_ as well:
124
125 .. code:: bash
126
127 python -m pip install -U --force-reinstall --no-deps https://codeberg.org/mikf/gallery-dl/archive/master.tar.gz
128
129 Omit :code:`--no-deps` if Requests_ hasn't been installed yet.
130
131 Note: Windows users should use :code:`py` instead of :code:`python`.
132
133 It is advised to use the latest version of pip_,
134 including the essential packages :code:`setuptools` and :code:`wheel`.
135 To ensure these packages are up-to-date, run
136
137 .. code:: bash
138
139 python -m pip install --upgrade pip setuptools wheel
140
141
142 Standalone Executable
143 ---------------------
144
145 Prebuilt executable files with a Python interpreter and
146 required Python packages included are available for
147
148 - `Windows <https://codeberg.org/mikf/gallery-dl/releases/download/v1.32.14/gallery-dl.exe>`__
149 (Requires `Microsoft Visual C++ Redistributable Package (x86) <https://aka.ms/vs/17/release/vc_redist.x86.exe>`__)
150 - `Linux <https://codeberg.org/mikf/gallery-dl/releases/download/v1.32.14/gallery-dl.bin>`__
151
152
153 Nightly Builds
154 --------------
155
156 | Executables built from the latest commit can be found at
157 | https://github.com/gdl-org/builds/releases
158
159
160 Snap
161 ----
162
163 Linux users that are using a distro that is supported by Snapd_ can install *gallery-dl* from the Snap Store:
164
165 .. code:: bash
166
167 snap install gallery-dl
168
169
170 Chocolatey
171 ----------
172
173 Windows users that have Chocolatey_ installed can install *gallery-dl* from the Chocolatey Community Packages repository:
174
175 .. code:: powershell
176
177 choco install gallery-dl
178
179
180 Scoop
181 -----
182
183 *gallery-dl* is also available in the Scoop_ "main" bucket for Windows users:
184
185 .. code:: powershell
186
187 scoop install gallery-dl
188
189 Homebrew
190 --------
191
192 For macOS or Linux users using Homebrew:
193
194 .. code:: bash
195
196 brew install gallery-dl
197
198 MacPorts
199 --------
200
201 For macOS users with MacPorts:
202
203 .. code:: bash
204
205 sudo port install gallery-dl
206
207 Docker
208 --------
209 Using the Dockerfile in the repository:
210
211 .. code:: bash
212
213 git clone https://codeberg.org/mikf/gallery-dl.git
214 cd gallery-dl/
215 docker build -t gallery-dl:latest .
216
217 Pulling image from `Docker Hub <https://hub.docker.com/r/mikf123/gallery-dl>`__:
218
219 .. code:: bash
220
221 docker pull mikf123/gallery-dl
222 docker tag mikf123/gallery-dl gallery-dl
223
224 Pulling image from `GitHub Container Registry <https://github.com/mikf/gallery-dl/pkgs/container/gallery-dl>`__:
225
226 .. code:: bash
227
228 docker pull ghcr.io/mikf/gallery-dl
229 docker tag ghcr.io/mikf/gallery-dl gallery-dl
230
231 Pulling *Nightly Build* images built from the latest commit by using the ``dev`` tag:
232
233 .. code:: bash
234
235 docker pull mikf123/gallery-dl:dev
236 docker pull ghcr.io/mikf/gallery-dl:dev
237
238 To run the container you will probably want to attach some directories on the host so that the config file and downloads can persist across runs.
239
240 Make sure to either download the example config file reference in the repo and place it in the mounted volume location or touch an empty file there.
241
242 If you gave the container a different tag or are using podman then make sure you adjust. Run ``docker image ls`` to check the name if you are not sure.
243
244 This will remove the container after every use so you will always have a fresh environment for it to run. If you setup a ci-cd pipeline to autobuild the container you can also add a ``--pull=newer`` flag so that when you run it docker will check to see if there is a newer container and download it before running.
245
246 .. code:: bash
247
248 docker run --rm -v $HOME/Downloads/:/gallery-dl/ -v $HOME/.config/gallery-dl/gallery-dl.conf:/etc/gallery-dl.conf -it gallery-dl:latest
249
250 You can also add an alias to your shell for "gallery-dl" or create a simple bash script and drop it somewhere in your $PATH to act as a shim for this command.
251
252 Nix and Home Manager
253 --------------------------
254
255 Adding *gallery-dl* to your system environment:
256
257 .. code:: nix
258
259 environment.systemPackages = with pkgs; [
260 gallery-dl
261 ];
262
263 Using :code:`nix-shell`
264
265 .. code:: bash
266
267 nix-shell -p gallery-dl
268
269 .. code:: bash
270
271 nix-shell -p gallery-dl --run "gallery-dl <args>"
272
273 For Home Manager users, you can manage *gallery-dl* declaratively:
274
275 .. code:: nix
276
277 programs.gallery-dl = {
278 enable = true;
279 settings = {
280 extractor.base-directory = "~/Downloads";
281 };
282 };
283
284 Alternatively, you can just add it to :code:`home.packages` if you don't want to manage it declaratively:
285
286 .. code:: nix
287
288 home.packages = with pkgs; [
289 gallery-dl
290 ];
291
292 After making these changes, simply rebuild your configuration and open a new shell to have *gallery-dl* available.
293
294 Usage
295 =====
296
297 To use *gallery-dl* simply call it with the URLs you wish to download images
298 from:
299
300 .. code:: bash
301
302 gallery-dl [OPTIONS]... URLS...
303
304 Use :code:`gallery-dl --help` or see `docs/options.md <https://codeberg.org/mikf/gallery-dl/src/branch/master/docs/options.md>`__
305 for a full list of all command-line options.
306
307
308 Examples
309 --------
310
311 Download images; in this case from danbooru via tag search for 'bonocho':
312
313 .. code:: bash
314
315 gallery-dl "https://danbooru.donmai.us/posts?tags=bonocho"
316
317
318 Get the direct URL of an image from a site supporting authentication with username & password:
319
320 .. code:: bash
321
322 gallery-dl -g -u "<username>" -p "<password>" "https://twitter.com/i/web/status/604341487988576256"
323
324
325 Filter manga chapters by chapter number and language:
326
327 .. code:: bash
328
329 gallery-dl --chapter-filter "10 <= chapter < 20" -o "lang=fr" "https://mangadex.org/title/59793dd0-a2d8-41a2-9758-8197287a8539"
330
331
332 | Search a remote resource for URLs and download images from them:
333 | (URLs for which no extractor can be found will be silently ignored)
334
335 .. code:: bash
336
337 gallery-dl "r:https://pastebin.com/raw/FLwrCYsT"
338
339
340 If a site's address is nonstandard for its extractor, you can prefix the URL with the
341 extractor's name to force the use of a specific extractor:
342
343 .. code:: bash
344
345 gallery-dl "tumblr:https://sometumblrblog.example"
346
347
348 Configuration
349 =============
350
351 Configuration files for *gallery-dl* use a JSON-based file format.
352
353
354 Documentation
355 -------------
356
357 A list of all available configuration options and their descriptions
358 can be found at `<https://gdl-org.github.io/docs/configuration.html>`__.
359
360 | For a default configuration file with available options set to their
361 default values, see `docs/gallery-dl.conf <https://codeberg.org/mikf/gallery-dl/src/branch/master/docs/gallery-dl.conf>`__.
362
363 | For a commented example with more involved settings and option usage,
364 see `docs/gallery-dl-example.conf <https://codeberg.org/mikf/gallery-dl/src/branch/master/docs/gallery-dl-example.conf>`__.
365
366
367 Locations
368 ---------
369
370 *gallery-dl* searches for configuration files in the following places:
371
372 Windows:
373 * ``%APPDATA%\gallery-dl\config.json``
374 * ``%USERPROFILE%\gallery-dl\config.json``
375 * ``%USERPROFILE%\gallery-dl.conf``
376
377 (``%USERPROFILE%`` usually refers to a user's home directory,
378 i.e. ``C:\Users\<username>\``)
379
380 Linux, macOS, etc.:
381 * ``/etc/gallery-dl.conf``
382 * ``${XDG_CONFIG_HOME}/gallery-dl/config.json``
383 * ``${HOME}/.config/gallery-dl/config.json``
384 * ``${HOME}/.gallery-dl.conf``
385
386 When run as `executable <Standalone Executable_>`__,
387 *gallery-dl* will also look for a ``gallery-dl.conf`` file
388 in the same directory as said executable.
389
390 It is possible to use more than one configuration file at a time.
391 In this case, any values from files after the first will get merged
392 into the already loaded settings and potentially override previous ones.
393
394
395 Authentication
396 ==============
397
398 Username & Password
399 -------------------
400
401 Some extractors require you to provide valid login credentials in the form of
402 a username & password pair. This is necessary for
403 ``nijie``
404 and optional for
405 ``aryion``,
406 ``danbooru``,
407 ``e621``,
408 ``exhentai``,
409 ``idolcomplex``,
410 ``imgbb``,
411 ``inkbunny``,
412 ``mangadex``,
413 ``mangoxo``,
414 ``pillowfort``,
415 ``sankaku``,
416 ``subscribestar``,
417 ``tapas``,
418 ``tsumino``,
419 ``twitter``,
420 and ``zerochan``.
421
422 You can set the necessary information in your
423 `configuration file <Configuration_>`__
424
425 .. code:: json
426
427 {
428 "extractor": {
429 "subscribestar": {
430 "username": "<username>",
431 "password": "<password>"
432 }
433 }
434 }
435
436 or you can provide them directly via the
437 :code:`-u/--username` and :code:`-p/--password` or via the
438 :code:`-o/--option` command-line options
439
440 .. code:: bash
441
442 gallery-dl -u "<username>" -p "<password>" "URL"
443 gallery-dl -o "username=<username>" -o "password=<password>" "URL"
444
445
446 Cookies
447 -------
448
449 For sites where login with username & password is not possible due to
450 CAPTCHA or similar, or has not been implemented yet, you can use the
451 cookies from a browser login session and input them into *gallery-dl*.
452
453 This can be done via the
454 `cookies <https://gdl-org.github.io/docs/configuration.html#extractor-cookies>`__
455 option in your configuration file by specifying
456
457 - | the path to a Mozilla/Netscape format cookies.txt file exported by a browser addon
458 | (e.g. `Get cookies.txt LOCALLY <https://chrome.google.com/webstore/detail/get-cookiestxt-locally/cclelndahbckbenkjhflpdbgdldlbecc>`__ for Chrome,
459 `Export Cookies <https://addons.mozilla.org/en-US/firefox/addon/export-cookies-txt/>`__ for Firefox)
460
461 - | a list of name-value pairs gathered from your browser's web developer tools
462 | (in `Chrome <https://developers.google.com/web/tools/chrome-devtools/storage/cookies>`__,
463 in `Firefox <https://developer.mozilla.org/en-US/docs/Tools/Storage_Inspector>`__)
464
465 - | the name of a browser to extract cookies from
466 | (supported browsers are Chromium-based ones, Firefox, and Safari)
467
468 For example:
469
470 .. code:: json
471
472 {
473 "extractor": {
474 "instagram": {
475 "cookies": "$HOME/path/to/cookies.txt"
476 },
477 "patreon": {
478 "cookies": {
479 "session_id": "K1T57EKu19TR49C51CDjOJoXNQLF7VbdVOiBrC9ye0a"
480 }
481 },
482 "twitter": {
483 "cookies": ["firefox"]
484 }
485 }
486 }
487
488 | You can also specify a cookies.txt file with
489 the :code:`--cookies` command-line option
490 | or a browser to extract cookies from with :code:`--cookies-from-browser`:
491
492 .. code:: bash
493
494 gallery-dl --cookies "$HOME/path/to/cookies.txt" "URL"
495 gallery-dl --cookies-from-browser firefox "URL"
496
497
498 OAuth
499 -----
500
501 *gallery-dl* supports user authentication via OAuth_ for some extractors.
502 This is necessary for
503 ``pixiv``
504 and optional for
505 ``deviantart``,
506 ``flickr``,
507 ``reddit``,
508 ``smugmug``,
509 ``tumblr``,
510 and ``mastodon`` instances.
511
512 Linking your account to *gallery-dl* grants it the ability to issue requests
513 on your account's behalf and enables it to access resources which would
514 otherwise be unavailable to a public user.
515
516 To do so, start by invoking it with ``oauth:<sitename>`` as an argument.
517 For example:
518
519 .. code:: bash
520
521 gallery-dl oauth:flickr
522
523 You will be sent to the site's authorization page and asked to grant read
524 access to *gallery-dl*. Authorize it and you will be shown one or more
525 "tokens", which should be added to your configuration file.
526
527 To authenticate with a ``mastodon`` instance, run *gallery-dl* with
528 ``oauth:mastodon:<instance>`` as argument. For example:
529
530 .. code:: bash
531
532 gallery-dl oauth:mastodon:pawoo.net
533 gallery-dl oauth:mastodon:https://mastodon.social/
534
535
536 .. _Python: https://www.python.org/downloads/
537 .. _PyPI: https://pypi.org/
538 .. _pip: https://pip.pypa.io/en/stable/
539 .. _Requests: https://requests.readthedocs.io/en/latest/
540 .. _FFmpeg: https://www.ffmpeg.org/
541 .. _mkvmerge: https://www.matroska.org/downloads/mkvtoolnix.html
542 .. _yt-dlp: https://github.com/yt-dlp/yt-dlp
543 .. _youtube-dl: https://ytdl-org.github.io/youtube-dl/
544 .. _PySocks: https://pypi.org/project/PySocks/
545 .. _brotli: https://github.com/google/brotli
546 .. _brotlicffi: https://github.com/python-hyper/brotlicffi
547 .. _zstandard: https://github.com/indygreg/python-zstandard
548 .. _PyYAML: https://pyyaml.org/
549 .. _toml: https://pypi.org/project/toml/
550 .. _SecretStorage: https://pypi.org/project/SecretStorage/
551 .. _Psycopg: https://www.psycopg.org/
552 .. _truststore: https://truststore.readthedocs.io/en/latest/
553 .. _Jinja: https://jinja.palletsprojects.com/
554 .. _Snapd: https://docs.snapcraft.io/installing-snapd
555 .. _OAuth: https://en.wikipedia.org/wiki/OAuth
556 .. _Chocolatey: https://chocolatey.org/install
557 .. _Scoop: https://scoop.sh/
558
559 .. |pypi| image:: https://img.shields.io/pypi/v/gallery-dl?logo=pypi&label=PyPI
560 :target: https://pypi.org/project/gallery-dl/
561
562 .. |build| image:: https://github.com/mikf/gallery-dl/actions/workflows/tests.yml/badge.svg
563 :target: https://github.com/mikf/gallery-dl/actions
564
565 .. |gitter| image:: https://badges.gitter.im/gallery-dl/main.svg
566 :target: https://gitter.im/gallery-dl/main
567
568 .. |discord| image:: https://img.shields.io/discord/1067148002722062416?logo=discord&label=Discord&color=blue
569 :target: https://discord.gg/rSzQwRvGnE