gallery-dl-bytes
Programmatically run gallery-dl extractors to download content from the web directly to a bytes object in memory. With an easy, fully typed API.
Installation
With uv (recommended)
uv add gallery-dl-bytes
With pip
pip install gallery-dl-bytes
Usage
Single item
from gallery_dl_bytes import DownloadJob
url = "https://www.reddit.com/r/me_irl/comments/1f4qc59/me_irl/"
job = DownloadJob(url)
job.run()
post = job.files[0]
print(f"{post.name}")
print(post.headers.get("Content-Type"))
print(post.metadata.get("author"))
Gallery
job = DownloadJob("https://imgur.com/gallery/dog-3s8hj1j")
job.run()
for file in job.files:
print(f"{file.name}")
print(file.headers.get("Last-Modified"))
print(file.metadata.get("created_at"))
print()
Access media
from pathlib import Path
job = DownloadJob("https://www.pexels.com/photo/man-riding-white-surfboard-1005456/")
job.run()
file = job.files[0]
Path(file.name).write_bytes(file.data)
Access posts without media
job = DownloadJob("https://bsky.app/profile/dril.bsky.social/post/3lia54f7fg22x")
job.run()
print(job.metadata.get("text"))
Set gallery-dl configuration
[!WARNING]
Note that not all configuration is supported. Options may be silently ignored. This feature is not yet complete.
from gallery_dl_bytes import set_config
set_config(("extractor",), "browser", "firefox")
Metadata
Release files for gallery-dl-bytes 2.5.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| gallery_dl_bytes-2.5.0.tar.gz | 37.6 kB | Without provenance | Details for gallery_dl_bytes-2.5.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| gallery_dl_bytes-2.5.0-py3-none-any.whl | Python 3 | none | any | Details for gallery_dl_bytes-2.5.0-py3-none-any.whl |
Total release size: 55.2 kB
Release files / gallery_dl_bytes-2.5.0.tar.gz
| Download URL | gallery_dl_bytes-2.5.0.tar.gz |
|---|---|
| Size | 37.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
898ac2ec0324d09f0716472e97e7e8b9fa6055f160bc4f022faf08d19120dacc
|
|
BLAKE2b-256 checksum How to use checksums |
f31cfda52ea5ad9bd929d3ff84f1681fbf0a0d3172a10d906b5f2b24075478f6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.5.29
|
Release files / gallery_dl_bytes-2.5.0-py3-none-any.whl
| Download URL | gallery_dl_bytes-2.5.0-py3-none-any.whl |
|---|---|
| Size | 17.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
32bf07bd0caac9b16305b9951cb8549137816bfd9bc7123a35191f96a07c121d
|
|
BLAKE2b-256 checksum How to use checksums |
6cfb961d3fb49c0f1cae133c84ea6792ce83bafb3ae179d5873b01b00338a3cf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.5.29
|
Security for gallery-dl-bytes 2.5.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.