extend 'cookies-update' functionality

Allow writing cookies to a different file than a given cookies.txt,
making it possible to export cookies imported with --cookies-from-browser

To convert browser cookies to cookies.txt format:
  gallery-dl --cookies-fr chromium \
             -o cookies-update=cookies.txt \
             --no-download \
             http://example.org/file.jpg
This commit is contained in:
Mike Fährmann
2023-05-04 15:10:47 +02:00
parent bc6d65d203
commit 3ca5dac8b6
2 changed files with 24 additions and 10 deletions

View File

@@ -457,13 +457,17 @@ Description
extractor.*.cookies-update
--------------------------
Type
``bool``
* ``bool``
* |Path|_
Default
``true``
Description
If `extractor.*.cookies`_ specifies the |Path|_ of a cookies.txt
file and it can be opened and parsed without errors,
update its contents with cookies received during data extraction.
Export session cookies in cookies.txt format.
* If this is a |Path|_, write cookies to the given file path.
* If this is ``true`` and `extractor.*.cookies`_ specifies the |Path|_
of a valid cookies.txt file, update its contents.
extractor.*.proxy