From 5b131996c6067a7020a6099dd5dd60afb2c1f338 Mon Sep 17 00:00:00 2001 From: Patrick Robertson Date: Fri, 21 Mar 2025 11:55:12 +0400 Subject: [PATCH] Add return type for auth_for_site --- src/auto_archiver/core/base_module.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/auto_archiver/core/base_module.py b/src/auto_archiver/core/base_module.py index 642b8ee..bcaa59b 100644 --- a/src/auto_archiver/core/base_module.py +++ b/src/auto_archiver/core/base_module.py @@ -71,7 +71,16 @@ class BaseModule(ABC): :param site: the domain of the site to get authentication information for :param extract_cookies: whether or not to extract cookies from the given browser/file and return the cookie jar (disabling can speed up processing if you don't actually need the cookies jar). - :returns: authdict dict of login information for the given site + :returns: authdict dict -> { + "username": str, + "password": str, + "api_key": str, + "api_secret": str, + "cookie": str, + "cookies_file": str, + "cookies_from_browser": str, + "cookies_jar": CookieJar + } **Global options:**\n * cookies_from_browser: str - the name of the browser to extract cookies from (e.g. 'chrome', 'firefox' - uses ytdlp under the hood to extract\n @@ -85,6 +94,7 @@ class BaseModule(ABC): * cookie: str - a cookie string to use for login (specific to this site)\n * cookies_file: str - the path to a cookies file to use for login (specific to this site)\n * cookies_from_browser: str - the name of the browser to extract cookies from (specitic for this site)\n + """ # TODO: think about if/how we can deal with sites that have multiple domains (main one is x.com/twitter.com) # for now the user must enter them both, like "x.com,twitter.com" in their config. Maybe we just hard-code?