From 285391df4381cf14612977c26b60d4a87e1673ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Sat, 6 May 2023 17:40:55 +0200 Subject: [PATCH] add '-C' as short option for '--cookies' and put cookie options into their own section --- docs/options.md | 18 ++++++++++-------- gallery_dl/option.py | 42 ++++++++++++++++++++++-------------------- 2 files changed, 32 insertions(+), 28 deletions(-) diff --git a/docs/options.md b/docs/options.md index 8ab88b423a6..b0abcf85341 100644 --- a/docs/options.md +++ b/docs/options.md @@ -18,14 +18,6 @@ --user-agent UA User-Agent request header --clear-cache MODULE Delete cached login sessions, cookies, etc. for MODULE (ALL to delete everything) - --cookies FILE File to load additional cookies from - --cookies-export FILE Export session cookies to FILE - --cookies-from-browser BROWSER[/DOMAIN][+KEYRING][:PROFILE][::CONTAINER] - Name of the browser to load cookies from, with - optional domain prefixed with '/', keyring name - prefixed with '+', profile prefixed with ':', - and container prefixed with '::' ('none' for no - container) ## Output Options: -q, --quiet Activate quiet mode @@ -86,6 +78,16 @@ -p, --password PASS Password belonging to the given username --netrc Enable .netrc authentication data +## Cookie Options: + -C, --cookies FILE File to load additional cookies from + --cookies-export FILE Export session cookies to FILE + --cookies-from-browser BROWSER[/DOMAIN][+KEYRING][:PROFILE][::CONTAINER] + Name of the browser to load cookies from, with + optional domain prefixed with '/', keyring name + prefixed with '+', profile prefixed with ':', + and container prefixed with '::' ('none' for no + container) + ## Selection Options: --download-archive FILE Record all downloaded or skipped files in FILE and skip downloading any file already in it diff --git a/gallery_dl/option.py b/gallery_dl/option.py index e954d95c5ef..08e6e70105d 100644 --- a/gallery_dl/option.py +++ b/gallery_dl/option.py @@ -148,26 +148,6 @@ def build_parser(): help="Delete cached login sessions, cookies, etc. for MODULE " "(ALL to delete everything)", ) - general.add_argument( - "--cookies", - dest="cookies", metavar="FILE", action=ConfigAction, - help="File to load additional cookies from", - ) - general.add_argument( - "--cookies-export", - dest="cookies-update", metavar="FILE", action=ConfigAction, - help="Export session cookies to FILE", - ) - general.add_argument( - "--cookies-from-browser", - dest="cookies_from_browser", - metavar="BROWSER[/DOMAIN][+KEYRING][:PROFILE][::CONTAINER]", - help=("Name of the browser to load cookies from, with optional " - "domain prefixed with '/', " - "keyring name prefixed with '+', " - "profile prefixed with ':', and " - "container prefixed with '::' ('none' for no container)"), - ) output = parser.add_argument_group("Output Options") output.add_argument( @@ -380,6 +360,28 @@ def build_parser(): help="Enable .netrc authentication data", ) + cookies = parser.add_argument_group("Cookie Options") + cookies.add_argument( + "-C", "--cookies", + dest="cookies", metavar="FILE", action=ConfigAction, + help="File to load additional cookies from", + ) + cookies.add_argument( + "--cookies-export", + dest="cookies-update", metavar="FILE", action=ConfigAction, + help="Export session cookies to FILE", + ) + cookies.add_argument( + "--cookies-from-browser", + dest="cookies_from_browser", + metavar="BROWSER[/DOMAIN][+KEYRING][:PROFILE][::CONTAINER]", + help=("Name of the browser to load cookies from, with optional " + "domain prefixed with '/', " + "keyring name prefixed with '+', " + "profile prefixed with ':', and " + "container prefixed with '::' ('none' for no container)"), + ) + selection = parser.add_argument_group("Selection Options") selection.add_argument( "--download-archive",