diff --git a/src/auto_archiver/core/base_module.py b/src/auto_archiver/core/base_module.py index d717e4b..642b8ee 100644 --- a/src/auto_archiver/core/base_module.py +++ b/src/auto_archiver/core/base_module.py @@ -59,7 +59,8 @@ class BaseModule(ABC): setattr(self, key, val) def setup(self): - # For any additional setup required by modules, e.g. autehntication + # For any additional setup required by modules outside of the configs in the manifesst, + # e.g. authentication pass def auth_for_site(self, site: str, extract_cookies=True) -> Mapping[str, Any]: @@ -88,7 +89,7 @@ class BaseModule(ABC): # 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? - site = UrlUtil.domain_for_url(site).lstrip("www.") + site = UrlUtil.domain_for_url(site).removeprefix("www.") # add the 'www' version of the site to the list of sites to check authdict = {} diff --git a/src/auto_archiver/core/config.py b/src/auto_archiver/core/config.py index 6c4300f..59c1eec 100644 --- a/src/auto_archiver/core/config.py +++ b/src/auto_archiver/core/config.py @@ -65,7 +65,7 @@ class AuthenticationJsonParseAction(argparse.Action): auth_dict = json.loads(values) setattr(namespace, self.dest, auth_dict) except json.JSONDecodeError as e: - raise argparse.ArgumentTypeError(f"Invalid JSON input for argument '{self.dest}': {e}") + raise argparse.ArgumentTypeError(f"Invalid JSON input for argument '{self.dest}': {e}") from e def load_from_file(path): try: diff --git a/src/auto_archiver/core/module.py b/src/auto_archiver/core/module.py index 6eac968..94b4e48 100644 --- a/src/auto_archiver/core/module.py +++ b/src/auto_archiver/core/module.py @@ -194,7 +194,7 @@ class LazyBaseModule: try: manifest.update(ast.literal_eval(f.read())) except (ValueError, TypeError, SyntaxError, MemoryError, RecursionError) as e: - raise ValueError(f"Error loading manifest from file {self.path}/{MANIFEST_FILE}: {e}") + raise ValueError(f"Error loading manifest from file {self.path}/{MANIFEST_FILE}: {e}") from e self._manifest = manifest self._entry_point = manifest["entry_point"]