Skip to content

Commit

Permalink
[mastodon] improve account searches (fixes #704)
Browse files Browse the repository at this point in the history
Searching for just the username ("@name") can produce multiple
unrelated results, so we now search for username + mastodon instance
("@name@INSTANCE")
  • Loading branch information
mikf committed Apr 23, 2020
1 parent 400a0df commit 12ff23b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gallery_dl/extractor/mastodon.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ def __init__(self, match):
self.account_name = match.group(1)

def statuses(self):
results = self.api.account_search("@" + self.account_name, 1)
for account in results:
handle = "@{}@{}".format(self.account_name, self.instance)
for account in self.api.account_search(handle, 1):
if account["username"] == self.account_name:
break
else:
Expand Down

0 comments on commit 12ff23b

Please sign in to comment.