Tello mobile plan automatic renewal system
Project description
Tello-Renewal
Automatic renewal system for Tello mobile plans using web automation.
Features
- 🔄 Automatic plan renewal using Selenium web automation
- 📧 Email notifications for success/failure
- 🧪 Dry run mode for testing
- ⚙️ TOML configuration with validation
- 🔒 Secure credential handling
- 📊 Comprehensive logging
- 🐳 Docker support with reusable base images
Installation
From Source
# Clone the repository
git clone <repository-url>
cd tello-renewal
# Install in development mode
pip install -e .
# Or install from PyPI (when published)
pip install tello-renewal
Requirements
- Python 3.10+
- Firefox, Chrome, or Edge browser
- WebDriver for your chosen browser (geckodriver for Firefox)
Quick Start
-
Create configuration file:
tello-renewal config-init -
Edit the configuration:
# Edit config.toml with your settings nano config.toml
-
Test your configuration:
# Validate configuration tello-renewal config-validate # Test email notifications tello-renewal email-test # Check account status tello-renewal status
-
Run renewal (dry run first):
# Test renewal without actually renewing tello-renewal renew --dry-run # Perform actual renewal tello-renewal renew
Configuration
The system uses TOML configuration files. Here's a minimal example:
[tello]
email = "your_email@example.com"
password = "your_password"
card_expiration = "1/25" # MM/YY format
[smtp]
server = "smtp.gmail.com"
port = 587
username = "your_email@gmail.com"
password = "your_app_password"
from_email = '"Tello Renewal" <your_email@gmail.com>'
[notifications]
email_enabled = true
recipients = ["admin@example.com"]
Configuration Sections
[tello]- Tello account credentials and settings[browser]- Browser automation settings[renewal]- Renewal behavior configuration[smtp]- Email server settings[notifications]- Notification preferences[logging]- Logging configuration
CLI Commands
Basic Operations
# Execute renewal
tello-renewal renew [--dry-run]
# Check account status and balance information
tello-renewal status
Configuration Management
# Create example configuration
tello-renewal config-init [--output config.toml]
# Validate configuration
tello-renewal config-validate
Testing
# Test email notifications
tello-renewal email-test
Options
--config, -c- Specify configuration file path--verbose, -v- Enable verbose logging--help- Show help information
Exit Codes
| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | General error |
| 2 | Configuration error |
| 5 | Renewal failed |
| 6 | Not due for renewal |
Scheduling
Cron Job
Add to your crontab to run daily:
# Run daily at 9 AM
0 9 * * * /path/to/venv/bin/tello-renewal renew
# With logging
0 9 * * * /path/to/venv/bin/tello-renewal renew >> /var/log/tello-renewal.log 2>&1
Systemd Service
Create /etc/systemd/system/tello-renewal.service:
[Unit]
Description=Tello Plan Auto Renewal
After=network.target
[Service]
Type=oneshot
User=tello
WorkingDirectory=/opt/tello-renewal
ExecStart=/opt/tello-renewal/venv/bin/tello-renewal renew
Create /etc/systemd/system/tello-renewal.timer:
[Unit]
Description=Run Tello renewal daily
Requires=tello-renewal.service
[Timer]
OnCalendar=daily
Persistent=true
[Install]
WantedBy=timers.target
Enable and start:
sudo systemctl enable tello-renewal.timer
sudo systemctl start tello-renewal.timer
Security Considerations
- Store sensitive configuration files with restricted permissions (600)
- Use app passwords for email authentication
- Consider encrypting configuration files containing passwords
- Run with minimal privileges
- Regularly update dependencies
Troubleshooting
Common Issues
-
WebDriver not found:
# Install geckodriver for Firefox # On Ubuntu/Debian: sudo apt install firefox-geckodriver # On macOS: brew install geckodriver
-
Login failures:
- Verify credentials in configuration
- Check if Tello website structure has changed
- Try running with
--verbosefor detailed logs
-
Email sending failures:
- Verify SMTP settings
- Use app passwords for Gmail
- Test with
tello-renewal email-test
-
Browser automation issues:
- Try different browser types in configuration
- Disable headless mode for debugging
- Check browser and WebDriver versions
Debug Mode
Run with verbose logging to troubleshoot issues:
tello-renewal --verbose renew --dry-run
Log Files
Check log files for detailed error information:
tail -f tello_renewal.log
Docker Usage
For detailed Docker usage instructions, see docker/README_en.md or docker/README_zh.md.
Quick Docker Start
# Build and run with Docker
make build-docker
docker run --rm -v $(pwd)/config:/app/config oaklight/tello-renewal:latest
# Or use the provided scripts
./scripts/run.sh --help
Available Docker Commands
# Build base image (Alpine Python + Selenium + geckodriver)
make build-docker-base
make push-docker-base
# Build application image
make build-docker
make push-docker
# Build with specific version
make build-docker V=1.0.0
# Build with PyPI mirror
make build-docker MIRROR=https://pypi.tuna.tsinghua.edu.cn/simple
# Package management
make build-package
make push-package
make clean-package
# Clean up
make clean-docker
Development
Setup Development Environment
# Clone repository
git clone <repository-url>
cd tello-renewal
# Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install in development mode with dev dependencies
pip install -e ".[dev]"
# Install pre-commit hooks
pre-commit install
Running Tests
# Run all tests
pytest
# Run with coverage
pytest --cov=tello_renewal
# Run specific test file
pytest tests/test_models.py
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests for new functionality
- Ensure all tests pass
- Submit a pull request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Disclaimer
This software is provided as-is for educational and automation purposes. Users are responsible for:
- Ensuring compliance with Tello's terms of service
- Maintaining the security of their credentials
- Monitoring the renewal process
- Having backup payment methods available
The authors are not responsible for any service interruptions, failed renewals, or other issues that may arise from using this software.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tello_renewal-0.1.2.tar.gz.
File metadata
- Download URL: tello_renewal-0.1.2.tar.gz
- Upload date:
- Size: 27.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0511221fabfd5f24c8020375cb1c178e87638ef561e6553d8e591506adf40eab
|
|
| MD5 |
56a8ae28846f9d7ae4a7c72654245774
|
|
| BLAKE2b-256 |
d738c44e788f9505b582811599ee2514f5d99fed74a3943f23aa0dccd3fe81bf
|
File details
Details for the file tello_renewal-0.1.2-py3-none-any.whl.
File metadata
- Download URL: tello_renewal-0.1.2-py3-none-any.whl
- Upload date:
- Size: 27.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a97847ad07a4802229b170f89dc2df1402cbf9a2aad757f4cacf5a27859ab626
|
|
| MD5 |
01d51137e0419f9be41a785348cca97f
|
|
| BLAKE2b-256 |
7037a48cd90607b85f68e16ece2e9947be1dbc21331696cd3a651185244136b6
|