Mohammed Foud
commited on
Commit
Β·
137bc9e
1
Parent(s):
6f4ab5b
all
Browse files
join.py
CHANGED
@@ -33,7 +33,7 @@ session_dir = "mfoud73" # Combine the "join" directory with session name
|
|
33 |
#OUTPUT_CSV = "groups_with_status.csv" # Output CSV file with status
|
34 |
|
35 |
# Delay between joining groups to avoid rate limiting
|
36 |
-
SLEEP_TIME =
|
37 |
|
38 |
# Flask App
|
39 |
app = Flask(__name__)
|
@@ -78,6 +78,7 @@ async def join_groups():
|
|
78 |
status = "Joined (public)"
|
79 |
print(f"β
Joined public group: {group_name} ({username})")
|
80 |
time.sleep(SLEEP_TIME)
|
|
|
81 |
else:
|
82 |
status = "Already a member"
|
83 |
print(f"β‘ Already a member: {group_name} ({username})")
|
@@ -86,6 +87,7 @@ async def join_groups():
|
|
86 |
await client(ImportChatInviteRequest(group_id))
|
87 |
status = "Joined (private)"
|
88 |
print(f"β
Joined private group: {group_name}")
|
|
|
89 |
|
90 |
except InviteHashExpiredError:
|
91 |
status = "Failed (private) - Invite link expired"
|
@@ -95,6 +97,7 @@ async def join_groups():
|
|
95 |
print(f"β Failed to join {group_name}: {e}")
|
96 |
|
97 |
writer.writerow(row + [status])
|
|
|
98 |
|
99 |
|
100 |
print(f"\nβ
Process completed. Results saved to {OUTPUT_CSV}")
|
|
|
33 |
#OUTPUT_CSV = "groups_with_status.csv" # Output CSV file with status
|
34 |
|
35 |
# Delay between joining groups to avoid rate limiting
|
36 |
+
SLEEP_TIME = 5 # Adjust as needed (in seconds)
|
37 |
|
38 |
# Flask App
|
39 |
app = Flask(__name__)
|
|
|
78 |
status = "Joined (public)"
|
79 |
print(f"β
Joined public group: {group_name} ({username})")
|
80 |
time.sleep(SLEEP_TIME)
|
81 |
+
|
82 |
else:
|
83 |
status = "Already a member"
|
84 |
print(f"β‘ Already a member: {group_name} ({username})")
|
|
|
87 |
await client(ImportChatInviteRequest(group_id))
|
88 |
status = "Joined (private)"
|
89 |
print(f"β
Joined private group: {group_name}")
|
90 |
+
time.sleep(SLEEP_TIME)
|
91 |
|
92 |
except InviteHashExpiredError:
|
93 |
status = "Failed (private) - Invite link expired"
|
|
|
97 |
print(f"β Failed to join {group_name}: {e}")
|
98 |
|
99 |
writer.writerow(row + [status])
|
100 |
+
|
101 |
|
102 |
|
103 |
print(f"\nβ
Process completed. Results saved to {OUTPUT_CSV}")
|