Automated system for scraping prayer times and uploading them to Mawaqit.
This project automates the process of:
- Scraping prayer times from a source
- Uploading the times to Mawaqit (both Athan and Iqama times)
- Running on a scheduled basis via GitHub Actions
The following environment variables are required:
MAWAQIT_USER: Your Mawaqit account email/usernameMAWAQIT_PASS: Your Mawaqit account password
For enhanced functionality (2FA, captcha solving):
GMAIL_USER: Gmail address for receiving 2FA codes (if 2FA is enabled)GMAIL_APP_PASSWORD: Gmail app-specific password for IMAP accessTWOCAPTCHA_API_KEY: API key for 2Captcha service (for solving reCAPTCHA)
PRAYER_TIMES_DIR: Directory containing prayer times CSV files (default:./prayer_times)HEADLESS: Run browser in headless mode (default:truein CI/CD)DEBUG_MODE: Enable debug mode with screenshots (default:false)
- Python 3.11+
- Node.js (for prayer times extraction)
- Chrome/Chromium browser
# Install Python dependencies
pip install -r requirements.txt
# Install Playwright browsers
playwright install chromium
# Install Node.js dependencies (for prayer times scraper)
npm installCreate a .env file in the project root (never commit this file):
MAWAQIT_USER=your_email@example.com
MAWAQIT_PASS=your_password
GMAIL_USER=your_gmail@gmail.com
GMAIL_APP_PASSWORD=your_app_password
TWOCAPTCHA_API_KEY=your_captcha_key# Run directly (will use .env file if present, or environment variables)
python mawaqit_uploader.py
# Or set environment variables directly
export MAWAQIT_USER=your_email@example.com
export MAWAQIT_PASS=your_password
python mawaqit_uploader.pyThe project is configured to run automatically via GitHub Actions.
- Go to your repository on GitHub
- Navigate to Settings → Secrets and variables → Actions
- Add the following repository secrets:
MAWAQIT_USERMAWAQIT_PASSGMAIL_USER(optional)GMAIL_APP_PASSWORD(optional)TWOCAPTCHA_API_KEY(optional)
- mawaqit-automation.yml: Main workflow that runs weekly to update prayer times
- prayer-times.yml: Extracts prayer times from source
When running in GitHub Actions:
- Environment variables are automatically loaded from GitHub secrets
- No
.envfile is required or expected - Warnings about missing
.envfiles are suppressed - Clear "Running in CI/CD environment" message is displayed
The configuration system follows this priority order:
- Environment variables (highest priority) - from GitHub secrets or shell
.envfile in current directory.envfile in package directory.envfile in parent directory
Environment variables always override .env file values.
Ensure MAWAQIT_USER and MAWAQIT_PASS are set either:
- As environment variables, OR
- In a
.envfile in the project root
This is informational only. If you see this message:
- In CI/CD: This is normal and expected (not shown)
- In local development: Either create a
.envfile or set environment variables
If you see warnings about GMAIL_USER, GMAIL_APP_PASSWORD, or TWOCAPTCHA_API_KEY:
- These are optional features
- 2FA and captcha solving will be disabled
- The uploader will still work if 2FA is not required
- config.py: Configuration management with environment variable support
- mawaqit_uploader.py: Main uploader using Selenium for browser automation
- prayer_times_scraper.py: Prayer times extraction (if applicable)
- email_helper.py: Gmail IMAP helper for 2FA code retrieval
See LICENSE file for details.
For issues, questions, or contributions, please open an issue on GitHub.