Skip to content

Commit

Permalink
fix: Mastodon export was only exporting first page
Browse files Browse the repository at this point in the history
  • Loading branch information
Guts committed Mar 9, 2024
1 parent 239a417 commit ca80776
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions geotribu_cli/social/mastodon_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
from urllib import request
from urllib.parse import urlparse

# 3rd party
from mastodon import Mastodon, MastodonAPIError, MastodonError
from requests import Session
from rich import print

Expand All @@ -27,6 +25,9 @@
from geotribu_cli.constants import GeotribuDefaults
from geotribu_cli.utils.proxies import get_proxy_settings

# 3rd party
from mastodon import Mastodon, MastodonAPIError, MastodonError

# ############################################################################
# ########## GLOBALS #############
# ################################
Expand Down Expand Up @@ -236,7 +237,9 @@ def export_data(
if dest_path_lists is not None or dest_path_lists_only_accounts is not None:
try:
dico_listes = {
liste.get("title"): self.list_accounts(id=liste.get("id"))
liste.get("title"): self.fetch_remaining(
self.list_accounts(id=liste.get("id"))
)
for liste in self.lists()
}
except Exception as err:
Expand All @@ -249,7 +252,9 @@ def export_data(
# récupération des comptes suivis
if dest_path_following_accounts is not None:
try:
masto_following_accounts = self.account_following(id=self.me())
masto_following_accounts = self.fetch_remaining(
self.account_following(id=self.me())
)
except Exception as err:
logger.critical(
"La récupération des comptes suivis a échoué. L'export est "
Expand Down

0 comments on commit ca80776

Please sign in to comment.