-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.py
More file actions
69 lines (57 loc) · 3.42 KB
/
config.py
File metadata and controls
69 lines (57 loc) · 3.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
"""
Configuration file for WhatsApp Bulk Message Sender
Modify these settings to customize the behavior of the script.
"""
# Timing Configuration - Optimized for High Volume (5-10 messages per minute)
MIN_DELAY_SECONDS = 3 # Minimum delay between messages (6-12 second range)
MAX_DELAY_SECONDS = 10 # Maximum delay between messages (6-12 second range)
# Message Template Configuration
GLOBAL_MESSAGE = " Hi there! Hope you're doing well. This message includes an attachment."
GLOBAL_ATTACHMENT_PATH = r"C:\Users\CSELAB5\Desktop\bulk_wa_sender\ricky.jpg"
# Performance Optimization Settings
TYPING_DELAY_MS = 1 # Ultra-fast typing (10ms per character)
UI_INTERACTION_DELAY = 0.09 # Minimal UI delays (0.1 seconds)
POST_SEND_DELAY = 0.07 # Quick post-send confirmation (0.2 seconds)
ATTACHMENT_UPLOAD_DELAY = 0.09 # Fast attachment processing
# Browser Configuration
HEADLESS_MODE = False # Set to True to run browser in headless mode (not recommended for WhatsApp Web)
BROWSER_TIMEOUT = 0 # No timeout for browser operations
USE_DEFAULT_BROWSER = True # Set to True to use system's default browser, False to use Chromium
# File Configuration
DEFAULT_CSV_FILE = "contacts.csv" # Default CSV file name
LOG_FILE = "whatsapp_bulk_sender.log" # Log file name
# WhatsApp Web Configuration
WHATSAPP_WEB_URL = "https://web.whatsapp.com"
QR_CODE_TIMEOUT = 120000 # Timeout for QR code scan in milliseconds (2 minutes)
# File Size Limits
MAX_ATTACHMENT_SIZE = 100 * 1024 * 1024 # 100MB in bytes
# Selectors (CSS selectors for WhatsApp Web elements)
# Note: These may need to be updated if WhatsApp Web changes their interface
SELECTORS = {
"qr_code": 'div[data-testid="qr-code"], canvas, div[data-testid="qr-canvas"]',
"chat_list": 'div[data-testid="chat-list"], div[role="main"], div[aria-label="Chat list"]',
"message_input": 'p.selectable-text.copyable-text, div[contenteditable="true"][data-tab="10"], div[contenteditable="true"][role="textbox"], div[data-testid="conversation-compose-box-input"]',
"attachment_button": 'div[title="Attach"], span[data-testid="clip"], button[aria-label="Attach"], div[aria-label="Attach"], span[data-icon="attach-menu-plus"], button[data-testid="attach-menu-plus"], div[data-testid="attach-menu-plus"]',
"send_button": 'span[data-testid="send"], div[aria-label="Send"], button[data-testid="send"]',
"image_input": 'input[accept="image/*,video/mp4,video/3gpp,video/quicktime"], input[accept*="image"]',
"document_input": 'input[accept="*"], input[type="file"]',
"invalid_number_alert": 'div[data-testid="alert-phone-number-invalid"], div[role="alert"]'
}
# Supported file extensions for attachments
SUPPORTED_IMAGE_EXTENSIONS = ['.jpg', '.jpeg', '.png', '.gif', '.webp']
SUPPORTED_VIDEO_EXTENSIONS = ['.mp4', '.3gpp', '.mov']
SUPPORTED_DOCUMENT_EXTENSIONS = ['.pdf', '.doc', '.docx', '.txt', '.xlsx', '.pptx']
# Logging Configuration
LOG_LEVEL = "INFO" # DEBUG, INFO, WARNING, ERROR, CRITICAL
LOG_ROTATION = "10 MB" # Rotate log file when it reaches this size
LOG_RETENTION = "7 days" # Keep log files for this duration
LOG_COMPRESSION = "zip" # Compress old log files
# User Agent for browser
USER_AGENT = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
# Browser launch arguments
BROWSER_ARGS = [
"--no-sandbox",
"--disable-blink-features=AutomationControlled",
"--disable-web-security",
"--disable-features=VizDisplayCompositor"
]