Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -158,7 +158,7 @@ def block_user(user_id, user, reason):
|
|
| 158 |
print("Could not block, so muted")
|
| 159 |
except tweepy.errors.TooManyRequests as e:
|
| 160 |
if attempts == 0:
|
| 161 |
-
time.sleep(
|
| 162 |
attempts = attempts + 1
|
| 163 |
else:
|
| 164 |
finished = True
|
|
@@ -180,8 +180,11 @@ def block_user(user_id, user, reason):
|
|
| 180 |
continue
|
| 181 |
#time.sleep(1)
|
| 182 |
finished = True
|
| 183 |
-
|
| 184 |
-
|
|
|
|
|
|
|
|
|
|
| 185 |
return blocked
|
| 186 |
|
| 187 |
def block_users(client, threshold, dataset):
|
|
|
|
| 158 |
print("Could not block, so muted")
|
| 159 |
except tweepy.errors.TooManyRequests as e:
|
| 160 |
if attempts == 0:
|
| 161 |
+
time.sleep(60)
|
| 162 |
attempts = attempts + 1
|
| 163 |
else:
|
| 164 |
finished = True
|
|
|
|
| 180 |
continue
|
| 181 |
#time.sleep(1)
|
| 182 |
finished = True
|
| 183 |
+
try:
|
| 184 |
+
me = client.get_me()
|
| 185 |
+
print("{} blocked {}, for {}".format(me.data["username"], user, reason))
|
| 186 |
+
except tweepy.errors.BadRequest as e:
|
| 187 |
+
print("Blocked {}, for {}".format(user, reason))
|
| 188 |
return blocked
|
| 189 |
|
| 190 |
def block_users(client, threshold, dataset):
|