-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_available_options.py
More file actions
63 lines (55 loc) · 2.18 KB
/
test_available_options.py
File metadata and controls
63 lines (55 loc) · 2.18 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
"""
Test which resolution options are actually available on Hero 12 Black
"""
from gopro_usb import GoProUSB
import time
SN = "C3504224682139" # SN3 from example_usage.py
gopro = GoProUSB(SN)
print("🔍 Testing available resolution options on Hero 12 Black\n")
gopro.power_on()
time.sleep(1)
# Current setting
state = gopro.get_state()
current_res = state['settings'].get('2', 'N/A')
current_fps = state['settings'].get('3', 'N/A')
print(f"📊 Current resolution setting: {current_res}")
print(f"🎬 Current FPS setting: {current_fps}\n")
# Test a wide range of resolution options
print("Testing resolution options (setting=2):\n")
for option in range(0, 50):
try:
url = f"{gopro.base_url}/gopro/camera/setting?setting=2&option={option}"
response = gopro.session.get(url, timeout=2)
if response.status_code == 200:
print(f"✅ Option {option:2d} - WORKS")
time.sleep(0.3)
elif response.status_code == 403:
print(f"🚫 Option {option:2d} - Forbidden (incompatible with current settings)")
else:
print(f"❌ Option {option:2d} - Error {response.status_code}")
except Exception as e:
print(f"❌ Option {option:2d} - {str(e)[:40]}")
time.sleep(0.1)
print("\n" + "="*60)
print("Testing FPS options (setting=3):\n")
for option in [0, 1, 2, 5, 6, 8, 9, 10, 13]:
try:
url = f"{gopro.base_url}/gopro/camera/setting?setting=3&option={option}"
response = gopro.session.get(url, timeout=2)
if response.status_code == 200:
print(f"✅ Option {option:2d} - WORKS")
time.sleep(0.3)
elif response.status_code == 403:
print(f"🚫 Option {option:2d} - Forbidden (incompatible with current settings)")
else:
print(f"❌ Option {option:2d} - Error {response.status_code}")
except Exception as e:
print(f"❌ Option {option:2d} - {str(e)[:40]}")
time.sleep(0.1)
# Check final state
print("\n" + "="*60)
state = gopro.get_state()
final_res = state['settings'].get('2', 'N/A')
final_fps = state['settings'].get('3', 'N/A')
print(f"📊 Final resolution setting: {final_res}")
print(f"🎬 Final FPS setting: {final_fps}")