-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathzoom_diagnostic.py
More file actions
250 lines (207 loc) · 9.73 KB
/
Copy pathzoom_diagnostic.py
File metadata and controls
250 lines (207 loc) · 9.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
import asyncio
import re
from playwright.async_api import async_playwright
async def diagnose_zoom_meeting(meeting_url):
"""Diagnostic script to help troubleshoot Zoom meeting joining issues"""
print("=== ZOOM MEETING DIAGNOSTIC TOOL ===")
print(f"Meeting URL: {meeting_url}")
# Extract meeting ID and password
meeting_id = None
password = None
if 'zoom.us/j/' in meeting_url:
match = re.search(r'zoom\.us/j/(\d+)', meeting_url)
if match:
meeting_id = match.group(1)
pwd_match = re.search(r'pwd=([^&]+)', meeting_url)
if pwd_match:
password = pwd_match.group(1)
if not meeting_id:
match = re.search(r'/(\d{9,11})', meeting_url)
if match:
meeting_id = match.group(1)
print(f"Extracted Meeting ID: {meeting_id}")
print(f"Extracted Password: {password if password else 'None'}")
async with async_playwright() as p:
browser = await p.chromium.launch(headless=False, args=[
'--use-fake-ui-for-media-stream',
'--disable-infobars',
'--disable-extensions',
'--disable-notifications',
'--no-sandbox',
'--disable-web-security',
'--allow-running-insecure-content',
])
context = await browser.new_context(
viewport={'width': 1280, 'height': 720},
user_agent='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36'
)
page = await context.new_page()
try:
print("\n=== NAVIGATING TO MEETING ===")
await page.goto(meeting_url, wait_until='domcontentloaded', timeout=30000)
print("✓ Successfully loaded the page")
# Wait for page to settle
await page.wait_for_timeout(5000)
print("\n=== PAGE INFORMATION ===")
title = await page.title()
current_url = page.url
print(f"Page Title: {title}")
print(f"Current URL: {current_url}")
# Check for common Zoom page states
print("\n=== CHECKING PAGE STATE ===")
# Check if it's a waiting room
waiting_room_indicators = [
'text="Waiting for the host to start this meeting"',
'text="waiting for the host"',
'text="Please wait"',
'text="Meeting hasn\'t started"',
'text="meeting hasn\'t started"'
]
for indicator in waiting_room_indicators:
try:
element = await page.query_selector(indicator)
if element:
print(f"⚠️ Found waiting room indicator: {indicator}")
except:
continue
# Check for join options
print("\n=== LOOKING FOR JOIN OPTIONS ===")
join_selectors = [
'a:has-text("Join from Your Browser")',
'button:has-text("Join from Your Browser")',
'a:has-text("launch meeting")',
'a:has-text("Launch Meeting")',
'button:has-text("Join")',
'button:has-text("Join Meeting")',
'[data-testid="join-from-browser"]',
'.join-from-browser',
'.join-btn',
'[aria-label*="Join from your browser"]',
'[aria-label*="join from your browser"]',
'a[href*="join"]',
'button[onclick*="join"]',
'.zm-btn-join',
'[class*="join"]',
'button:has-text("Continue")',
'button:has-text("Next")',
'button:has-text("Proceed")'
]
found_join_options = []
for selector in join_selectors:
try:
element = await page.query_selector(selector)
if element:
text = await element.text_content()
found_join_options.append((selector, text.strip()))
except:
continue
if found_join_options:
print("✓ Found join options:")
for selector, text in found_join_options:
print(f" - {selector}: '{text}'")
else:
print("❌ No join options found")
# Check for all buttons and links
print("\n=== ALL CLICKABLE ELEMENTS ===")
buttons = await page.query_selector_all('button')
links = await page.query_selector_all('a')
print(f"Found {len(buttons)} buttons and {len(links)} links")
all_elements = []
for i, button in enumerate(buttons):
try:
text = await button.text_content()
aria_label = await button.get_attribute('aria-label')
class_name = await button.get_attribute('class')
all_elements.append(('button', text.strip() if text else '', aria_label, class_name))
except:
continue
for i, link in enumerate(links):
try:
text = await link.text_content()
href = await link.get_attribute('href')
class_name = await link.get_attribute('class')
all_elements.append(('link', text.strip() if text else '', href, class_name))
except:
continue
# Show elements that might be relevant
relevant_keywords = ['join', 'launch', 'continue', 'enter', 'start', 'browser', 'web']
relevant_elements = []
for element_type, text, attr1, attr2 in all_elements:
if any(keyword in (text + str(attr1) + str(attr2)).lower() for keyword in relevant_keywords):
relevant_elements.append((element_type, text, attr1, attr2))
if relevant_elements:
print("Relevant elements found:")
for element_type, text, attr1, attr2 in relevant_elements[:10]: # Show first 10
print(f" {element_type}: '{text}' (aria-label: {attr1}, class: {attr2})")
# Check for error messages
print("\n=== CHECKING FOR ERROR MESSAGES ===")
error_indicators = [
'text="You can\'t join"',
'text="can\'t join"',
'text="Unable to join"',
'text="unable to join"',
'text="Error"',
'text="error"',
'text="Failed"',
'text="failed"',
'text="Please install"',
'text="please install"',
'text="Download"',
'text="download"'
]
errors_found = []
for indicator in error_indicators:
try:
element = await page.query_selector(indicator)
if element:
text = await element.text_content()
errors_found.append(text.strip())
except:
continue
if errors_found:
print("❌ Error messages found:")
for error in errors_found:
print(f" - {error}")
else:
print("✓ No obvious error messages found")
# Take a screenshot
await page.screenshot(path="zoom_diagnostic_screenshot.png")
print("\n✓ Screenshot saved as 'zoom_diagnostic_screenshot.png'")
# Provide recommendations
print("\n=== RECOMMENDATIONS ===")
if not found_join_options:
print("❌ No join options found. This might mean:")
print(" - The meeting requires the Zoom desktop app")
print(" - The meeting hasn't started yet")
print(" - You don't have permission to join")
print(" - The meeting URL is invalid")
if errors_found:
print("❌ Error messages detected. Common solutions:")
print(" - Install the Zoom desktop app")
print(" - Check if the meeting has started")
print(" - Verify the meeting URL and password")
print(" - Try joining from a different browser")
if found_join_options:
print("✓ Join options found. The script should be able to join automatically.")
print("\n=== DIAGNOSTIC COMPLETE ===")
print("Check the screenshot for visual confirmation of the page state.")
# Keep browser open for manual inspection
input("\nPress Enter to close the browser...")
except Exception as e:
print(f"❌ Error during diagnosis: {e}")
import traceback
traceback.print_exc()
try:
await page.screenshot(path="zoom_diagnostic_error.png")
print("Error screenshot saved as 'zoom_diagnostic_error.png'")
except:
pass
finally:
await browser.close()
if __name__ == "__main__":
import sys
if len(sys.argv) > 1:
meeting_url = sys.argv[1]
else:
meeting_url = input("Enter Zoom meeting URL: ")
asyncio.run(diagnose_zoom_meeting(meeting_url))