diff options
Diffstat (limited to 'mastodon')
-rw-r--r-- | mastodon/Mastodon.py | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/mastodon/Mastodon.py b/mastodon/Mastodon.py index c3c02a0..9386882 100644 --- a/mastodon/Mastodon.py +++ b/mastodon/Mastodon.py | |||
@@ -459,12 +459,13 @@ class Mastodon: | |||
459 | self.api_base_url = try_base_url | 459 | self.api_base_url = try_base_url |
460 | 460 | ||
461 | # For EVEN newer vesions, we ALSO ALSO store the client id and secret so that you don't need to reauth to revoke | 461 | # For EVEN newer vesions, we ALSO ALSO store the client id and secret so that you don't need to reauth to revoke |
462 | try: | 462 | if self.client_id is None: |
463 | self.client_id = token_file.readline().rstrip() | 463 | try: |
464 | self.client_secret = token_file.readline().rstrip() | 464 | self.client_id = token_file.readline().rstrip() |
465 | except: | 465 | self.client_secret = token_file.readline().rstrip() |
466 | pass | 466 | except: |
467 | 467 | pass | |
468 | |||
468 | # Verify we have a base URL, protocolize | 469 | # Verify we have a base URL, protocolize |
469 | if self.api_base_url is None: | 470 | if self.api_base_url is None: |
470 | raise MastodonIllegalArgumentError("API base URL is required.") | 471 | raise MastodonIllegalArgumentError("API base URL is required.") |
@@ -1356,6 +1357,19 @@ class Mastodon: | |||
1356 | """ | 1357 | """ |
1357 | return self.__api_request('GET', '/api/v1/accounts/lookup', self.__generate_params(locals())) | 1358 | return self.__api_request('GET', '/api/v1/accounts/lookup', self.__generate_params(locals())) |
1358 | 1359 | ||
1360 | @api_version("3.5.0", "3.5.0", __DICT_VERSION_ACCOUNT) | ||
1361 | def account_familiar_followers(self, id): | ||
1362 | """ | ||
1363 | Find followers for the account given by id (can be a list) that also follow the | ||
1364 | logged in account. | ||
1365 | |||
1366 | Returns a list of `familiar follower dicts`_ | ||
1367 | """ | ||
1368 | if not isinstance(id, list): | ||
1369 | id = [id] | ||
1370 | for i in range(len(id)): | ||
1371 | id[i] = self.__unpack_id(id[i]) | ||
1372 | return self.__api_request('GET', '/api/v1/accounts/familiar_followers', {'id': id}, use_json=True) | ||
1359 | 1373 | ||
1360 | ### | 1374 | ### |
1361 | # Reading data: Featured hashtags | 1375 | # Reading data: Featured hashtags |