Thiloid commited on
Commit
e817a1d
·
verified ·
1 Parent(s): 96b40d7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -4
app.py CHANGED
@@ -177,9 +177,17 @@ def get_value_after_question_mark(url):
177
 
178
  # Extract the part after the question mark
179
  if question_mark_index != -1:
180
- # Get the part after the question mark and split by '='
181
- value = url[question_mark_index + 1:].split('=')[1]
182
- return value
 
 
 
 
 
 
 
 
183
 
184
  return ""
185
  def extract_ip_and_device(headers_obj):
@@ -220,7 +228,7 @@ def responsefull(
220
  #get ID
221
  full_url = request.url
222
  IDval= get_value_after_question_mark(full_url)
223
- IDval=str(full_url)
224
  print("URL")
225
  print(full_url)
226
  headers = request.headers
 
177
 
178
  # Extract the part after the question mark
179
  if question_mark_index != -1:
180
+ # Get the part after the question mark
181
+ query_string = url[question_mark_index + 1:]
182
+
183
+ # Split the query string into key-value pairs
184
+ pairs = query_string.split('&')
185
+
186
+ # Iterate over the key-value pairs
187
+ for pair in pairs:
188
+ key, value = pair.split('=')
189
+ if key == 'var1': # Replace 'var1' with the key you are interested in
190
+ return value
191
 
192
  return ""
193
  def extract_ip_and_device(headers_obj):
 
228
  #get ID
229
  full_url = request.url
230
  IDval= get_value_after_question_mark(full_url)
231
+ IDval=str(IDval)
232
  print("URL")
233
  print(full_url)
234
  headers = request.headers