Add authentication options for various extractors in gallery.py

This commit is contained in:
Danilo Reyes 2025-10-09 23:19:14 -06:00
parent 6aea101721
commit 5c13b806a0

View File

@ -34,6 +34,18 @@ class Gallery:
command += f" --download-archive {database}" if self.archive else "" command += f" --download-archive {database}" if self.archive else ""
command += self.opt_args if self.opt_args else "" command += self.opt_args if self.opt_args else ""
# Add authentication options from environment variables
command += ' -o "extractor.pixiv.refresh-token=${GALLERY_DL_PIXIV_REFRESH_TOKEN}"'
command += ' -o "extractor.bluesky.password=${GALLERY_DL_BLUESKY_PASSWORD}"'
command += ' -o "extractor.deviantart.refresh-token=${GALLERY_DL_DEVIANTART_REFRESH_TOKEN}"'
command += ' -o "extractor.flickr.access-token=${GALLERY_DL_FLICKR_ACCESS_TOKEN}"'
command += ' -o "extractor.flickr.access-token-secret=${GALLERY_DL_FLICKR_ACCESS_TOKEN_SECRET}"'
command += ' -o "extractor.reddit.refresh-token=${GALLERY_DL_REDDIT_REFRESH_TOKEN}"'
command += ' -o "extractor.tumblr.access-token=${GALLERY_DL_TUMBLR_ACCESS_TOKEN}"'
command += ' -o "extractor.tumblr.access-token-secret=${GALLERY_DL_TUMBLR_ACCESS_TOKEN_SECRET}"'
command += ' -o "extractor.tumblr.api-key=${GALLERY_DL_TUMBLR_API_KEY}"'
command += ' -o "extractor.tumblr.api-secret=${GALLERY_DL_TUMBLR_API_SECRET}"'
if self.link and not self.list: if self.link and not self.list:
command += f" {quote(self.link)}" command += f" {quote(self.link)}"
if self.list and not self.link: if self.list and not self.link: