Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,4 +1,5 @@
|
|
| 1 |
import time
|
|
|
|
| 2 |
|
| 3 |
from mastodon import Mastodon, MastodonNotFoundError # Mastodon.py
|
| 4 |
|
|
@@ -227,7 +228,9 @@ def block_user(user_id, user, reason):
|
|
| 227 |
try:
|
| 228 |
user ="alcinnz@floss.social"
|
| 229 |
user_dict = client.account_search(user)
|
| 230 |
-
|
|
|
|
|
|
|
| 231 |
print("Blocked {} for {}".format(user, reason))
|
| 232 |
except MastodonNotFoundError as e:
|
| 233 |
if "Record not found" in str(e):
|
|
|
|
| 1 |
import time
|
| 2 |
+
from pprint import pprint
|
| 3 |
|
| 4 |
from mastodon import Mastodon, MastodonNotFoundError # Mastodon.py
|
| 5 |
|
|
|
|
| 228 |
try:
|
| 229 |
user ="alcinnz@floss.social"
|
| 230 |
user_dict = client.account_search(user)
|
| 231 |
+
pprint(user_dict)
|
| 232 |
+
|
| 233 |
+
client.account_block(user_dict[0]["id"])
|
| 234 |
print("Blocked {} for {}".format(user, reason))
|
| 235 |
except MastodonNotFoundError as e:
|
| 236 |
if "Record not found" in str(e):
|