summaryrefslogtreecommitdiff
path: root/app/constants/constants.py
blob: f3ab71d7b8f9d3c89b32351b8af48b0ba3498662 (plain)
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
from app.login.credentials import *

# TODO: Organize this better

# Shared
genericRequestHeaders = {
    # set csrftoken
    'Accept': 'application/json, text/javascript, */*; q=0.01',
    'Accept-Language': 'en-US,en;q=0.9,la;q=0.8',
    'Cache-Control': 'no-cache',
    'Connection': 'keep-alive',
    'Content-Type': 'application/json; charset=UTF-8',
    'DNT': '1',
    'Origin': 'https://myaccount.cityutilities.net',
    'Pragma': 'no-cache',
    'Referer': 'https://myaccount.cityutilities.net/',
    'Sec-Fetch-Dest': 'empty',
    'Sec-Fetch-Mode': 'cors',
    'Sec-Fetch-Site': 'same-origin',
    'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36',
    'X-Requested-With': 'XMLHttpRequest',
    'isajax': '1',
    'sec-ch-ua': '"Chromium";v="118", "Google Chrome";v="118", "Not=A?Brand";v="99"',
    'sec-ch-ua-mobile': '?0',
    'sec-ch-ua-platform': '"Linux"',
}
################################################################
# Login
loginPageHeaders = {
    # no setting needed
    'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7',
    'Accept-Language': 'en-US,en;q=0.9,la;q=0.8',
    'Cache-Control': 'no-cache',
    'Connection': 'keep-alive',
    'DNT': '1',
    'Pragma': 'no-cache',
    'Sec-Fetch-Dest': 'document',
    'Sec-Fetch-Mode': 'navigate',
    'Sec-Fetch-Site': 'none',
    'Sec-Fetch-User': '?1',
    'Upgrade-Insecure-Requests': '1',
    'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36',
    'sec-ch-ua': '"Chromium";v="118", "Google Chrome";v="118", "Not=A?Brand";v="99"',
    'sec-ch-ua-mobile': '?0',
    'sec-ch-ua-platform': '"Linux"',
}

loginRequestJson = {
    # no setting needed
    'username': username,
    'password': password,
    'rememberme': False,
    'calledFrom': 'LN',
    'ExternalLoginId': '',
    'LoginMode': '1',
    'utilityAcountNumber': '',
}
################################################################
# Usage

usageRequestCookies = {
    # set the following:
    # ApplicationGatewayAffinityCORS
    # ApplicationGatewayAffinity
    # ASP.NET_SessionId
    # SCP
    'HomeInfoStatus': 'JTvtoeyEoms3X37GlOdLTgqBBOA=',
    'ClientTimeZone': 'fHqu9CayhyHioR9w4GOAmCGNfuI=',
    'ClientTimeId': 'YHGrE6y4VMYjLFGwicApVDP8CQ==',
    'Language_code': 'FAeYmCxPzfN/s2ABidwmk2yR',
    'IsModernStyle': 'BTvtoZ0jt+/Sat+a9yZhduxHX60=',
    'Language_Name': 'FCf/qJCh2GYtR4LS0rM5/Zpmrv4n89w=',
    'UName': uName,
}

electricUsageRequestJson = {
    # Set Mode
    'UsageOrGeneration': '1',
    'Type': 'K',
    'strDate': '',
    'hourlyType': 'H',
    'SeasonId': '',
    'weatherOverlay': 0,
    'usageyear': '',
    'MeterNumber': electricMeterNumber,
    'DateFromDaily': '',
    'DateToDaily': '',
}

waterUsageRequestJson = {
    # Set Mode
    "Type":"W",
    "strDate":"",
    "hourlyType":"H",
    "seasonId":"",
    "weatherOverlay":0,
    "usageyear":"",
    "MeterNumber": waterMeterNumber,
    "DateFromDaily":"",
    "DateToDaily":"",
    "isNoDashboard":True
}

################################################################
# Endpoints/URIs

waterRequestEndpoint = 'https://myaccount.cityutilities.net/Portal/Usages.aspx/LoadWaterUsage'
electricRequestEndpoint = 'https://myaccount.cityutilities.net/Portal/Usages.aspx/LoadUsage'
loginRequestEndpoint = 'https://myaccount.cityutilities.net/Portal/Default.aspx/validateLogin'
loginPageUri = 'https://myaccount.cityutilities.net/Portal/default.aspx'