DmitrMakeev commited on
Commit
f2a3d9d
·
verified ·
1 Parent(s): 6e987e4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -21
app.py CHANGED
@@ -2269,24 +2269,21 @@ def serve_html_vk(filename):
2269
  logging.debug(f"Decoded URL: {decoded_url}")
2270
  logging.debug(f"Parsed base URL: {base_url}")
2271
 
2272
-
2273
- vk_access_token_settings = request.args.get('vk_access_token_settings', '')
2274
-
2275
-
2276
- vk_app_id = request.args.get('vk_app_id')
2277
- vk_are_notifications_enabled = request.args.get('vk_are_notifications_enabled')
2278
- vk_is_app_user = request.args.get('vk_is_app_user')
2279
- vk_is_favorite = request.args.get('vk_is_favorite')
2280
- vk_language = request.args.get('vk_language')
2281
- vk_platform = request.args.get('vk_platform')
2282
- vk_ref = request.args.get('vk_ref')
2283
- vk_ts = request.args.get('vk_ts')
2284
- vk_user_id = request.args.get('vk_user_id')
2285
- sign = request.args.get('sign')
2286
-
2287
-
2288
-
2289
-
2290
 
2291
  # Параметры запроса
2292
  params = {
@@ -2303,12 +2300,11 @@ def serve_html_vk(filename):
2303
  "sign": sign
2304
  }
2305
 
2306
-
2307
  # Формирование URL с использованием f-строк
2308
- fullUrl = f"{base_url}?{'&'.join([f'{key}={value}' for key, value in params.items()])}"
2309
 
2310
  logging.debug(f"Received params: fullUrl={fullUrl}")
2311
-
2312
  # Преобразуем строку в JSON
2313
  try:
2314
  api_key_apps_vk_dict = json.loads(api_key_apps_vk)
 
2269
  logging.debug(f"Decoded URL: {decoded_url}")
2270
  logging.debug(f"Parsed base URL: {base_url}")
2271
 
2272
+ # Парсим параметры из декодированного URL
2273
+ query_params = dict(parse_qsl(parsed_url.query, keep_blank_values=True))
2274
+
2275
+ # Извлекаем параметры
2276
+ vk_access_token_settings = query_params.get('vk_access_token_settings', '')
2277
+ vk_app_id = query_params.get('vk_app_id')
2278
+ vk_are_notifications_enabled = query_params.get('vk_are_notifications_enabled')
2279
+ vk_is_app_user = query_params.get('vk_is_app_user')
2280
+ vk_is_favorite = query_params.get('vk_is_favorite')
2281
+ vk_language = query_params.get('vk_language')
2282
+ vk_platform = query_params.get('vk_platform')
2283
+ vk_ref = query_params.get('vk_ref')
2284
+ vk_ts = query_params.get('vk_ts')
2285
+ vk_user_id = query_params.get('vk_user_id')
2286
+ sign = query_params.get('sign')
 
 
 
2287
 
2288
  # Параметры запроса
2289
  params = {
 
2300
  "sign": sign
2301
  }
2302
 
 
2303
  # Формирование URL с использованием f-строк
2304
+ fullUrl = f"{base_url}?{'&'.join([f'{key}={value}' for key, value in params.items()])}"
2305
 
2306
  logging.debug(f"Received params: fullUrl={fullUrl}")
2307
+
2308
  # Преобразуем строку в JSON
2309
  try:
2310
  api_key_apps_vk_dict = json.loads(api_key_apps_vk)