diff --git a/custom_components/hacs/repositories/plugin.py b/custom_components/hacs/repositories/plugin.py index e7830348aa0..f48cd6a4c5c 100644 --- a/custom_components/hacs/repositories/plugin.py +++ b/custom_components/hacs/repositories/plugin.py @@ -2,6 +2,7 @@ from __future__ import annotations +from contextlib import suppress import re from typing import TYPE_CHECKING @@ -99,14 +100,13 @@ async def update_repository(self, ignore_issues=False, force=False): async def get_package_content(self): """Get package content.""" - try: - package = await self.repository_object.get_contents("package.json", self.ref) - package = json_loads(package.content) - - if package: - self.data.authors = package["author"] - except BaseException: # lgtm [py/catch-base-exception] pylint: disable=broad-except - pass + with suppress(Exception): + result = await self.hacs.async_download_file( + f"https://raw.githubusercontent.com/{self.data.full_name}/{self.ref}/package.json", + nolog=True, + ) + if result is not None and (package := json_loads(result)): + self.data.authors = package.get("author") def update_filenames(self) -> None: """Get the filename to target."""