mirror of
https://github.com/Stone-Red-Code/HotspotAutoLogin.git
synced 2026-11-01 23:05:40 +01:00
Compare commits
17
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
12c5808dd0 | ||
|
|
e9428675e9 | ||
|
|
53bf01733e | ||
|
|
bbbb76d577 | ||
|
|
8c7b735cb1 | ||
|
|
9b6d42aff5 | ||
|
|
337c84e9a4 | ||
|
|
bcbad5b8f8 | ||
|
|
f55f09079a | ||
|
|
7ec6601554 | ||
|
|
10c3b7f233 | ||
|
|
bbc9be3b93 | ||
|
|
2ff513099f | ||
|
|
54eea0ad63 | ||
|
|
fee77034f4 | ||
|
|
af880b0e92 | ||
|
|
c495415df9 |
+27
@@ -0,0 +1,27 @@
|
||||
# macOS system files
|
||||
.DS_Store
|
||||
._*
|
||||
Thumbs.db
|
||||
Desktop.ini
|
||||
|
||||
# Python artifacts
|
||||
__pycache__/
|
||||
**/__pycache__
|
||||
*.py[cod]
|
||||
*.so
|
||||
*.exe
|
||||
*.zip
|
||||
*.tar.gz
|
||||
|
||||
# Virtual environments
|
||||
env/
|
||||
venv/
|
||||
.env/
|
||||
.venv/
|
||||
|
||||
# VS Code settings
|
||||
.vscode/
|
||||
# Runtime files
|
||||
main/log.txt
|
||||
main/session_state.json
|
||||
main/last_known_directory.txt
|
||||
@@ -16,8 +16,8 @@ HotspotAutoLogin is a script that designed to automate the login process for Wi-
|
||||
- Double-click on HotspotAutoLogin.exe to launch the application.
|
||||
|
||||
### Option 2: Run with Python
|
||||
- Clone or download the repository to your local machine.
|
||||
- Install Python to your computer.
|
||||
- Clone or [download the repository](https://github.com/denizsafak/HotspotAutoLogin/archive/refs/heads/main.zip) to your local machine.
|
||||
- Extract from zip.
|
||||
- Run "run.bat" file.
|
||||
|
||||
## `Features`
|
||||
@@ -26,12 +26,24 @@ HotspotAutoLogin is a script that designed to automate the login process for Wi-
|
||||
- Any important events or actions taken by the script are logged both in a log file (log.txt) and in the log window that can be accessed via the system tray icon.
|
||||
- The script reads its configuration from a config.json file. This file contains the necessary information, such as your login credentials, the URL of the authentication portal, the SSID (network name) to which you want to connect, and the frequency of network checks in seconds.
|
||||
|
||||
## `Auto Mode & Start with Windows`
|
||||
- **Auto mode:** Click the **Auto** button in the profile selection window (or run with `--auto`). Instead of using a single profile, the program looks at the network you are actually connected to and picks the matching profile automatically:
|
||||
- **Wi-Fi:** the profile whose `ssid` matches the connected Wi-Fi (case-insensitive).
|
||||
- **Ethernet:** profiles without an `ssid` are Ethernet profiles. The one whose login `url` is reachable on the current network is used.
|
||||
- If the connected network doesn't match any profile, nothing is sent and the program just waits for a known network. It never forces a connection to another network in this mode.
|
||||
- `config.json` is re-read on every check, so edits apply without restarting.
|
||||
- **Start with Windows:** Tick **Start with Windows (Auto)** in the profile selection window. The program will then start at sign-in in Auto mode, in the background (tray icon only). Untick it to disable. This uses the current user's `Run` registry key, so no admin rights are needed.
|
||||
- Command line flags: `--auto` (skip profile selection, use Auto mode) and `--background` (don't open the log window at startup). E.g. `run.bat --auto`.
|
||||
|
||||
## `Usage`
|
||||
- Edit the config.json file with your specific information, including your login credentials, the portal URL, the SSID of the network you want to connect to, and the check interval in seconds. [Click to learn how to Configure the config.json](#how-to-configure-the-configjson)
|
||||
- When you run the script, a system tray icon will appear. Right-click on the icon to access options like showing the log or exiting the application.
|
||||
- To check the connection right away instead of waiting for the next check, click **Check Now** in the tray menu or in the log window. If the internet is down, it logs in immediately.
|
||||
- You can view the log of the script's actions by clicking the "Show Log" option in the system tray menu.
|
||||
|
||||
## `How to Configure the config.json?`
|
||||
> [!TIP]
|
||||
> I recently, added "Add new" button to the program, so you can achieve the same thing without needing to edit the config.json.
|
||||
|
||||

|
||||
|
||||
@@ -46,6 +58,8 @@ HotspotAutoLogin is a script that designed to automate the login process for Wi-
|
||||
|
||||
`"url":` Enter the "Request URL" in the "Headers" tab here.
|
||||
|
||||
`"internet_check_url":` URL to check your internet connection. Program will try to access this address to check if you have internet connection. If 8.8.8.8 is accessible **before** you log into your network, change this.
|
||||
|
||||

|
||||
|
||||
|
||||
@@ -53,6 +67,8 @@ HotspotAutoLogin is a script that designed to automate the login process for Wi-
|
||||
|
||||
`"check_every_second":` The frequency of the script for checking your internet connection status. For example "100", it will try to check the internet every 100 seconds.
|
||||
|
||||
`"session_hours":` *(optional)* If your network logs you out a fixed time after logging in (for example every 24 hours), enter that here, e.g. `24`. The program remembers when it last logged in (in `session_state.json`) and checks the connection every 5 seconds from 2 minutes before the expected expiry until 10 minutes after it, so you are logged back in within seconds instead of waiting for the next `check_every_second` check.
|
||||
|
||||
> ## Example useage:
|
||||
>
|
||||
|
||||
@@ -60,9 +76,10 @@ HotspotAutoLogin is a script that designed to automate the login process for Wi-
|
||||
{
|
||||
"profiles": [
|
||||
{
|
||||
"name": "My School Wi-Fi",
|
||||
"ssid": "SCHOOL_WIFI_5G",
|
||||
"name": "Example Wi-Fi",
|
||||
"ssid": "EXAMPLE_WIFI_5G",
|
||||
"url": "https://connect.schoolwifi.com/api/portal/dynamic/authenticate",
|
||||
"internet_check_url": "8.8.8.8",
|
||||
"payload": {
|
||||
"username": "[email protected]",
|
||||
"password": "123455678"
|
||||
@@ -79,9 +96,10 @@ HotspotAutoLogin is a script that designed to automate the login process for Wi-
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "My School ETHERNET",
|
||||
"name": "Example ETHERNET",
|
||||
"url": "http://10.3.41.15:8002/index.php?zone=dormnet",
|
||||
"payload": "&auth_user=85795013%40myschool.com&auth_pass=123455678&redirurl=&accept=Login",
|
||||
"internet_check_url": "8.8.8.8",
|
||||
"headers": {
|
||||
"Content-Type": "application/x-www-form-urlencoded",
|
||||
"Connection": "keep-alive",
|
||||
@@ -97,6 +115,10 @@ HotspotAutoLogin is a script that designed to automate the login process for Wi-
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
> [!CAUTION]
|
||||
> Recent Windows updates restricts third-party apps from accessing Wi-Fi names unless location services are enabled. To fix this, turn on location services in your settings. For more details, check the article from 04/02/2024 [Changes to API behavior for Wi-Fi access and location](https://learn.microsoft.com/en-us/windows/win32/nativewifi/wi-fi-access-location-changes).
|
||||
|
||||
> [!NOTE]
|
||||
> - The script relies on the assumption that the web portal uses basic authentication. If the portal uses a more complex login mechanism, additional adjustments may be necessary.
|
||||
> - This script is primarily intended for Windows. Adaptations might be needed for other operating systems.
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 101 KiB |
+847
-100
File diff suppressed because it is too large
Load Diff
+9
-9
@@ -1,13 +1,13 @@
|
||||
{
|
||||
"profiles": [
|
||||
{
|
||||
"name": "NAME_OF_YOUR_PROFILE (WI-FI EXAMPLE)",
|
||||
"ssid": "SSID_OF_YOUR_WIFI",
|
||||
"url": "PAYLOAD_URL_HERE",
|
||||
"name": "Example Wi-Fi",
|
||||
"ssid": "EXAMPLE_WIFI_5G",
|
||||
"url": "https://connect.schoolwifi.com/api/portal/dynamic/authenticate",
|
||||
"internet_check_url": "8.8.8.8",
|
||||
"payload": {
|
||||
"username": "PLEASE WRITE YOUR OWN PAYLOAD VALUES HERE. THIS IS AN EXAMPLE",
|
||||
"password": "PLEASE WRITE YOUR OWN PAYLOAD VALUES HERE. THIS IS AN EXAMPLE"
|
||||
"username": "[email protected]",
|
||||
"password": "123455678"
|
||||
},
|
||||
"headers": {
|
||||
"Content-Type": "application/json;charset=UTF-8",
|
||||
@@ -21,10 +21,10 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "NAME_OF_YOUR_PROFILE (ETHERNET EXAMPLE)",
|
||||
"url": "PAYLOAD_URL_HERE",
|
||||
"name": "Example ETHERNET",
|
||||
"url": "http://10.3.41.15:8002/index.php?zone=dormnet",
|
||||
"payload": "&auth_user=85795013%40myschool.com&auth_pass=123455678&redirurl=&accept=Login",
|
||||
"internet_check_url": "8.8.8.8",
|
||||
"payload": "&auth_user=XXXX%40gmail.com&auth_pass=xxx&redirurl=&accept=Login",
|
||||
"headers": {
|
||||
"Content-Type": "application/x-www-form-urlencoded",
|
||||
"Connection": "keep-alive",
|
||||
@@ -37,4 +37,4 @@
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user