diff --git a/app.py b/app.py index ba23e16..dce07d3 100644 --- a/app.py +++ b/app.py @@ -219,7 +219,7 @@ def _get_file_url(url, size, kind): return u # MEDIA_CACHE.cache(url, kind) - app.logger.error("cache not available for {url}/{size}/{kind}") + app.logger.error(f"cache not available for {url}/{size}/{kind}") return url diff --git a/templates/utils.html b/templates/utils.html index 78cd27d..8b15a1a 100644 --- a/templates/utils.html +++ b/templates/utils.html @@ -40,7 +40,7 @@ {% if not perma %} - + {% endif %} diff --git a/utils/lookup.py b/utils/lookup.py index 07627b6..3e97bfb 100644 --- a/utils/lookup.py +++ b/utils/lookup.py @@ -10,9 +10,10 @@ from little_boxes.webfinger import get_actor_url def lookup(url: str) -> ap.BaseActivity: """Try to find an AP object related to the given URL.""" try: - actor_url = get_actor_url(url) - if actor_url: - return ap.fetch_remote_activity(actor_url) + if url.startswith('@'): + actor_url = get_actor_url(url) + if actor_url: + return ap.fetch_remote_activity(actor_url) except NotAnActivityError: pass except requests.HTTPError: