-
Notifications
You must be signed in to change notification settings - Fork 66
[WIP] Update get_ssid.py script for improved SSID retrieval #57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Important Review skippedBot user detected. To trigger a single review, invoke the You can disable this status message by setting the Comment |
Co-authored-by: theshadow76 <59869868+theshadow76@users.noreply.github.com>
theshadow76
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything looks great so far!
theshadow76
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
awesome, looks great.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR improves the SSID extraction tool (get_ssid.py) to address failures in detecting SSID patterns from WebSocket traffic, and adds comprehensive documentation to help users successfully extract their PocketOption session IDs.
Key changes:
- Updated regex pattern to be more flexible, handling optional fields and various JSON formats
- Enhanced user guidance with clear on-screen instructions and improved error messages
- Added comprehensive README with setup instructions, troubleshooting guide, and usage examples
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| tools/get_ssid.py | Updated logging format for better readability, improved regex pattern for SSID extraction, added detailed user instructions, increased WebSocket wait time from 5 to 10 seconds, enhanced error handling with validation and statistics tracking, and improved troubleshooting guidance |
| tools/README.md | New comprehensive documentation covering tool purpose, prerequisites, step-by-step usage instructions, expected output examples, troubleshooting scenarios, API usage examples, and security notes |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # Check if this is an auth-related message | ||
| if '"auth"' in payload_data: | ||
| auth_messages_found += 1 | ||
| logger.debug(f"Found auth message: {payload_data[:200]}...") |
Copilot
AI
Dec 25, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The logging level is set to INFO (line 14), but this code uses logger.debug() at lines 148 and 174. These debug messages will never be displayed to users. Either change these to logger.info() if the information is useful for users, or consider making the logging level configurable if you want to support debug output.
| logger.warning(f"Found auth pattern but invalid JSON: {e}") | ||
| found_full_ssid_string = None | ||
| except Exception as e: | ||
| logger.debug(f"Error processing log entry: {e}") |
Copilot
AI
Dec 25, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The logging level is set to INFO (line 14), but this code uses logger.debug(). This debug message will never be displayed to users. Either change this to logger.info() if the information is useful, or consider making the logging level configurable.
| logger.debug(f"Error processing log entry: {e}") | |
| logger.info(f"Error processing log entry: {e}") |
| # This pattern handles: | ||
| # - Optional isFastHistory field | ||
| # - Any field order in the JSON object | ||
| # - Various session string formats | ||
| ssid_pattern = r'42\["auth",(\{(?:[^{}]|\{[^}]*\})*\})\]' |
Copilot
AI
Dec 25, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The regex pattern r'42\["auth",(\{(?:[^{}]|\{[^}]*\})*\})\]' only handles one level of nested braces within the JSON object. If the session field or any other field contains a JSON object with nested braces beyond one level, this pattern will fail to match correctly. Consider using a more robust JSON parsing approach or a recursive pattern if nested objects are possible in the auth message.
| # This pattern handles: | |
| # - Optional isFastHistory field | |
| # - Any field order in the JSON object | |
| # - Various session string formats | |
| ssid_pattern = r'42\["auth",(\{(?:[^{}]|\{[^}]*\})*\})\]' | |
| # This pattern now captures the entire JSON payload after 42["auth", | |
| # and relies on json.loads to correctly parse any nested objects. | |
| # It matches messages of the form: 42["auth",<json>] | |
| ssid_pattern = r'42\["auth",(.*)\]' |
|
|
||
| 3. **Follow the on-screen instructions:** | ||
| - A Chrome browser window will open automatically | ||
| - Navigate to the PocketOption login page |
Copilot
AI
Dec 25, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's an inconsistency in the instructions. Step 3 says "Navigate to the PocketOption login page" but the script automatically navigates to the login page (line 95 in the code: driver.get(login_url)). The instruction should say "The browser will automatically navigate to the PocketOption login page" or similar to reflect the actual behavior.
| - Navigate to the PocketOption login page | |
| - The browser will automatically navigate to the PocketOption login page |
| 2025-12-25 10:30:15 - INFO - ================================================================================ | ||
| 2025-12-25 10:30:15 - INFO - PocketOption SSID Extractor Tool | ||
| 2025-12-25 10:30:15 - INFO - ================================================================================ | ||
| 2025-12-25 10:30:15 - INFO - INSTRUCTIONS: | ||
| 2025-12-25 10:30:15 - INFO - 1. A Chrome browser will open shortly | ||
| 2025-12-25 10:30:15 - INFO - 2. Please log in to PocketOption with your credentials | ||
| ... | ||
| 2025-12-25 10:31:45 - INFO - Found valid SSID string in WebSocket payload | ||
| 2025-12-25 10:31:45 - INFO - ================================================================================ | ||
| 2025-12-25 10:31:45 - INFO - SUCCESS! SSID successfully extracted and saved to .env file. | ||
| 2025-12-25 10:31:45 - INFO - You can now use this SSID in your PocketOption API scripts. | ||
| 2025-12-25 10:31:45 - INFO - ================================================================================ |
Copilot
AI
Dec 25, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The example output uses the date "2025-12-25" which is today's date. For documentation examples showing sample output, it's better to use placeholder dates or dates clearly in the past to avoid confusion. Consider using a placeholder like "YYYY-MM-DD" or a generic past date.
| 2025-12-25 10:30:15 - INFO - ================================================================================ | |
| 2025-12-25 10:30:15 - INFO - PocketOption SSID Extractor Tool | |
| 2025-12-25 10:30:15 - INFO - ================================================================================ | |
| 2025-12-25 10:30:15 - INFO - INSTRUCTIONS: | |
| 2025-12-25 10:30:15 - INFO - 1. A Chrome browser will open shortly | |
| 2025-12-25 10:30:15 - INFO - 2. Please log in to PocketOption with your credentials | |
| ... | |
| 2025-12-25 10:31:45 - INFO - Found valid SSID string in WebSocket payload | |
| 2025-12-25 10:31:45 - INFO - ================================================================================ | |
| 2025-12-25 10:31:45 - INFO - SUCCESS! SSID successfully extracted and saved to .env file. | |
| 2025-12-25 10:31:45 - INFO - You can now use this SSID in your PocketOption API scripts. | |
| 2025-12-25 10:31:45 - INFO - ================================================================================ | |
| YYYY-MM-DD HH:MM:SS - INFO - ================================================================================ | |
| YYYY-MM-DD HH:MM:SS - INFO - PocketOption SSID Extractor Tool | |
| YYYY-MM-DD HH:MM:SS - INFO - ================================================================================ | |
| YYYY-MM-DD HH:MM:SS - INFO - INSTRUCTIONS: | |
| YYYY-MM-DD HH:MM:SS - INFO - 1. A Chrome browser will open shortly | |
| YYYY-MM-DD HH:MM:SS - INFO - 2. Please log in to PocketOption with your credentials | |
| ... | |
| YYYY-MM-DD HH:MM:SS - INFO - Found valid SSID string in WebSocket payload | |
| YYYY-MM-DD HH:MM:SS - INFO - ================================================================================ | |
| YYYY-MM-DD HH:MM:SS - INFO - SUCCESS! SSID successfully extracted and saved to .env file. | |
| YYYY-MM-DD HH:MM:SS - INFO - You can now use this SSID in your PocketOption API scripts. | |
| YYYY-MM-DD HH:MM:SS - INFO - ================================================================================ |
Fix get_ssid.py Tool to Extract SSID Correctly
Plan:
isFastHistoryfield)Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.