Skip to content

Commit

Permalink
Update the libravatar checker to look for the email we use, not openid
Browse files Browse the repository at this point in the history
Signed-off-by: Aurélien Bompard <aurelien@bompard.org>
  • Loading branch information
abompard committed Jun 8, 2024
1 parent 92fadc9 commit 9418f13
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions fedbadges/manual/libravatar.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ def _giveup_hdlr(details):
@backoff.on_exception(
backoff.expo,
(requests.exceptions.SSLError, requests.exceptions.ConnectionError),
max_tries=10,
max_tries=3,
on_backoff=_backoff_hdlr,
on_giveup=_giveup_hdlr,
raise_on_giveup=False,
)
def query_libravatar(http, nickname):
openid = f"http://{nickname}.id.fedoraproject.org/"
hash = hashlib.sha256(openid.encode("utf-8")).hexdigest()
def query_libravatar(http, email):
hash = hashlib.sha256(email.encode("utf-8")).hexdigest()
url = f"https://seccdn.libravatar.org/avatar/{hash}?d=404"
log.debug("Looking for an avatar of %s at %s", email, url)
return http.get(url, timeout=HTTP_TIMEOUT)


Expand Down Expand Up @@ -70,7 +70,7 @@ def main(debug):
log.debug("Skipping %s", person)
continue

response = query_libravatar(http, person.nickname)
response = query_libravatar(http, person.avatar)
if response is None:
# Query failed, ignore
continue
Expand Down

0 comments on commit 9418f13

Please sign in to comment.