Compare commits

...
Author SHA1 Message Date
Stone_RedandClaude Opus 5.5 12c5808dd0 Add Check Now button to skip the current wait
- "Check Now" in the tray menu and in the log window ends the current
  wait (the check_every_second interval, the auto mode network wait and
  the session expiry wait), so the connection is checked and the login
  is sent right away if needed.
- Document it in the README.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-07 21:13:13 +02:00
Stone_RedandClaude Opus 5.5 e9428675e9 Check quickly around the expected session expiry
Many portals log you out a fixed time after login (e.g. every 24 hours).
With check_every_second at 600, it could take up to 10 minutes to notice.

- New optional profile setting "session_hours" (also in the Add new dialog).
- The time of each successful login is saved per profile in
  session_state.json, so it survives restarts.
- While connected, the next check is timed to land 2 minutes before the
  expected expiry, then the connection is checked every 5 seconds until
  10 minutes after it, so the program logs in again within seconds.
- If still connected after that window, the session was renewed some
  other way and the normal interval is used again.
- Ignore runtime files (log.txt, session_state.json) in git.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-07 21:09:42 +02:00
Stone_RedandClaude Opus 5.5 53bf01733e Add Auto mode (network auto-detection) and Start with Windows
- Auto mode (Auto button or --auto): picks the profile matching the
  connected network instead of forcing one profile's SSID. Wi-Fi is
  matched by SSID; Ethernet profiles by whether their portal is reachable.
  Unknown networks are left alone. config.json is reloaded each check.
- Watches for network changes every 5 seconds while waiting, so switching
  between Ethernet and Wi-Fi is handled right away.
- Auto mode backs off instead of exiting after repeated errors.
- Start with Windows checkbox (HKCU Run key, --auto --background).
- --background flag to start without the log window.
- Resolve the program directory for both script and PyInstaller builds,
  so startup launches find config.json.
- Ignore Hyper-V/WSL vEthernet adapters when detecting Ethernet.
- Fix crash when pressing Enter in the profile list.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-07 19:30:29 +02:00
Deniz Şafak bbbb76d577 add .gitignore 2025-02-03 01:07:19 +03:00
Deniz Şafak 8c7b735cb1 Update README.md 2025-01-04 02:09:33 +01:00
Deniz Şafak 9b6d42aff5 v1.90fix4 2025-01-03 18:28:30 +03:00
Deniz Şafak 337c84e9a4 v1.90fix3 2025-01-01 18:56:54 +03:00
Deniz Şafak bcbad5b8f8 Update README.md 2025-01-01 04:02:31 +03:00
Deniz Şafak f55f09079a v1.90 2025-01-01 04:00:39 +03:00
Deniz Şafak 7ec6601554 v1.90fix2 2025-01-01 03:45:45 +03:00
Deniz Şafak 10c3b7f233 Add files via upload 2025-01-01 03:45:22 +03:00
Deniz Şafak bbc9be3b93 v.190fix 2025-01-01 03:39:27 +03:00
Deniz Şafak 2ff513099f v1.90 2025-01-01 03:11:00 +03:00
Deniz Şafak 54eea0ad63 Update README.md 2024-10-26 01:07:10 +03:00
Deniz Şafak fee77034f4 Update README.md 2024-10-26 01:06:56 +03:00
Deniz Şafak af880b0e92 Update README.md 2024-10-26 00:57:16 +03:00
Deniz Şafak c495415df9 v1.83 2024-10-26 00:48:35 +03:00
5 changed files with 910 additions and 114 deletions
+27
View File
@@ -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
+27 -5
View File
@@ -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.
![How to Animation.](/examples/howto.gif)
@@ -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.
![Example Request.](/examples/Request.png)
@@ -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
View File
File diff suppressed because it is too large Load Diff
+8 -8
View File
@@ -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",