Update app.py
Browse files
app.py
CHANGED
@@ -11,13 +11,39 @@ CORS(app) # Enable CORS for all routes
|
|
11 |
def home():
|
12 |
return ""
|
13 |
|
14 |
-
|
15 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
}
|
17 |
|
18 |
@app.route('/get_ecpm_player', methods=['GET'])
|
19 |
def get_ecpm():
|
20 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
|
22 |
|
23 |
@app.route('/get_latest_version', methods=['GET'])
|
|
|
11 |
def home():
|
12 |
return ""
|
13 |
|
14 |
+
# Define ECPM values for different countries based on timezones
|
15 |
+
ECPM_VALUES = {
|
16 |
+
"America/New_York": 60, # USA (Eastern)
|
17 |
+
"America/Chicago": 58, # USA (Central)
|
18 |
+
"America/Denver": 55, # USA (Mountain)
|
19 |
+
"America/Los_Angeles": 52, # USA (Pacific)
|
20 |
+
"Europe/London": 70, # UK
|
21 |
+
"Europe/Paris": 65, # France
|
22 |
+
"Europe/Berlin": 67, # Germany
|
23 |
+
"Europe/Zurich": 66, # Switzerland
|
24 |
+
"Europe/Copenhagen": 64, # Denmark
|
25 |
+
"Europe/Madrid": 63, # Spain
|
26 |
+
"Europe/Rome": 62, # Italy
|
27 |
+
"Europe/Stockholm": 68, # Sweden
|
28 |
+
"Europe/Oslo": 69, # Norway
|
29 |
+
"America/Sao_Paulo": 45, # Brazil
|
30 |
+
"Australia/Sydney": 75, # Australia
|
31 |
+
"Europe/Chisinau": 55, # Moldova
|
32 |
+
"Europe/Amsterdam": 66, # Netherlands
|
33 |
+
"Europe/Lisbon": 61, # Portugal
|
34 |
+
"Europe/Brussels": 64, # Belgium
|
35 |
+
"Pacific/Auckland": 80 # New Zealand
|
36 |
}
|
37 |
|
38 |
@app.route('/get_ecpm_player', methods=['GET'])
|
39 |
def get_ecpm():
|
40 |
+
# Get timezone from request
|
41 |
+
user_timezone = request.args.get('timezone', 'Unknown')
|
42 |
+
|
43 |
+
# Get corresponding ECPM value
|
44 |
+
ecpm_value = ECPM_VALUES.get(user_timezone, 50) # Default to 50 if not found
|
45 |
+
|
46 |
+
return jsonify({"ecpm": ecpm_value, "timezone": user_timezone})
|
47 |
|
48 |
|
49 |
@app.route('/get_latest_version', methods=['GET'])
|