You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using this code I got a severe crash only in one case: when the followers number of the account is 40:
res = mastodon.account_followers(userid)
for page in mastodon.fetch_remaining(res):
nbfollowers += 1
Below is the issue:
Traceback (most recent call last):
File "./mastocount.py", line 35, in <module>
Main()
File "/home/chaica/progra/python/mastocount/mastocount/main.py", line 38, in __init__
self.main()
File "/home/chaica/progra/python/mastocount/mastocount/main.py", line 63, in main
followers = get_followers(credentials)
File "/home/chaica/progra/python/mastocount/mastocount/followers.py", line 38, in get_followers
for page in mastodon.fetch_remaining(res):
File "/usr/local/lib/python3.5/dist-packages/mastodon/Mastodon.py", line 814, in fetch_remaining
current_page = self.fetch_next(current_page)
File "/usr/local/lib/python3.5/dist-packages/mastodon/Mastodon.py", line 773, in fetch_next
return self.__api_request(method, endpoint, params)
File "/usr/local/lib/python3.5/dist-packages/mastodon/Mastodon.py", line 963, in __api_request
if url['rel'] == 'next':
KeyError: 'rel'
It's only produce when my number of followers is equal to the parameter limit of account_followers. Without limit, it breaks if the number of account followers is 40.
This code perfectly works on 3 other accounts with different number of account_followers and works on the same account if the number of followers is different of 40.
I tested modifying the limit and each time account followers number equals limit, it breaks.
Let me know if you need more information,
Carl
The text was updated successfully, but these errors were encountered:
ghost
changed the title
Ppagination
Pagination breaks when account_followers number == limit
Sep 5, 2017
Hi,
Using this code I got a severe crash only in one case: when the followers number of the account is 40:
Below is the issue:
It's only produce when my number of followers is equal to the parameter limit of account_followers. Without limit, it breaks if the number of account followers is 40.
This code perfectly works on 3 other accounts with different number of account_followers and works on the same account if the number of followers is different of 40.
I tested modifying the limit and each time account followers number equals limit, it breaks.
Let me know if you need more information,
Carl
The text was updated successfully, but these errors were encountered: