-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.py
More file actions
49 lines (40 loc) · 1.7 KB
/
config.py
File metadata and controls
49 lines (40 loc) · 1.7 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
import os
from dataclasses import dataclass, field
from typing import List
from dotenv import load_dotenv
load_dotenv()
@dataclass(frozen=True)
class Config:
COOKIES_FILE: str = "cookies.json"
LOG_FILE: str = "codes_log.json"
USED_FILE: str = "codes_used.json"
REDEEM_URL: str = "https://shift.gearboxsoftware.com/rewards"
ENTITLEMENT_URL: str = "https://shift.gearboxsoftware.com/entitlement_offer_codes"
LOGIN_URL: str = "https://shift.gearboxsoftware.com/home"
SCAN_INTERVAL: int = 3600
PLAYWRIGHT_TIMEOUT: int = 30000
REQUEST_TIMEOUT: int = 15
SOURCES: List[str] = field(
default_factory=lambda: [
("https://www.ign.com/wikis/borderlands-4/" "Borderlands_4_SHiFT_Codes"),
"https://x.com/GearboxOfficial",
"https://twitter.com/DuvalMagic",
"https://www.facebook.com/GearboxSoftware",
"https://game8.co/games/Borderlands-4/archives/548406",
]
)
HEADERS: dict[str, str] = field(
default_factory=lambda: {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64)"
}
)
PREFERRED_PLATFORM: str = os.getenv("SHIFT_PLATFORM", "")
# Security settings
ENCRYPT_COOKIES: bool = os.getenv("ENCRYPT_COOKIES", "false").lower() == "true"
SECRET_KEY: str = os.getenv("SHIFT_SECRET_KEY", "")
APPRISE_URL: str = os.getenv("APPRISE_URL", "")
config = Config()
# Only require APPRISE_URL if we're actually running the main script
# Allow imports for testing/CI without requiring environment variables
if __name__ == "__main__" and not config.APPRISE_URL:
raise ValueError("Missing APPRISE_URL environment variable")