This Python script is a tool designed to automate interactions with Xiaomi's community services, for unlocking privileges.
-
Logs You Into Your Xiaomi Account
- The script prompts you to enter your Xiaomi username (e.g., email or phone number) and password securely.
- It attempts to log in to Xiaomi's authentication server up to 3 times, retrying if there are network issues or invalid credentials.
- If successful, it retrieves your account's region and session cookies for further use.
-
Handles Account Verification
- If Xiaomi requires additional verification (e.g., adding an email or phone number), the script notifies you with a specific URL and stops, as manual action is needed.
-
Schedules and Applies for Privileges
- Once logged in, the script runs an automated process that checks your account's status with Xiaomi's community API every minute.
- It applies for a specific privilege or authorization (possibly related to bootloader unlocking or community features) with random timing (0-10 seconds jitter) to avoid detection as a bot.
- It uses accurate time from internet time servers (NTP) to schedule these actions precisely.
-
Manages Retries and Waiting Periods
- If the application fails (e.g., temporary errors or cooldowns), it retries up to 5 times with a 60-second delay between attempts.
- If Xiaomi imposes a waiting period (e.g., "retry after X time"), the script waits until that time before trying again.
-
Provides Feedback and Logs
- The script logs all actions (e.g., login attempts, successes, errors) with timestamps, making it easy to track what’s happening.
- It informs you if access is granted, including any deadlines, or if something goes wrong.
-
Runs Continuously Until Stopped
- The script keeps running in a loop, checking and applying every minute, until you stop it manually (e.g., with Ctrl+C) or a critical error occurs, after which it restarts after a delay.
- Automation: Saves you from manually checking or applying for Xiaomi community bootloader unlocking repeatedly.
- Reliability: Handles network errors, retries, and waiting periods automatically.
- Use Case: intended for users trying to unlock their Xiaomi device’s bootloader by requiring approval from Xiaomi’s community.
- Requirements: You need Python installed with the
requests
,ntplib
, and standard libraries. (to install a pylib like ntplib for example you can use this command : "py -m pip install ntplib" ) - Running It: Run the script in a terminal, enter your Xiaomi credentials when prompted, and let it work in the background.
- Stopping It: Press Ctrl+C to exit gracefully.
- It aligns with bootloader unlocking in mi community.
- If Xiaomi’s policies or APIs change, the script might need updates.